class Buildr::JUnit

JUnit test framework, the default test framework for Java tests.

Support the following options:

  • :fork – If true/:once (default), fork for each test class. If :each, fork for each individual

    test case. If false, run all tests in the same VM (fast, but dangerous).
  • :clonevm – If true clone the VM each time it is forked.

  • :properties – Hash of system properties available to the test case.

  • :environment – Hash of environment variables available to the test case.

  • :java_args – Arguments passed as is to the JVM.

Constants

VERSION

JUnit version number.

Public Class Methods

dependencies() click to toggle source
# File lib/buildr/java/tests.rb, line 193
def dependencies
 four11_or_newer = version >= '4.11'
 @dependencies ||= ["junit:junit:jar:#{version}"]+ (four11_or_newer ? JMock.dependencies({:hamcrest => '1.3'}) : JMock.dependencies)
end
report() click to toggle source

Returns the Report object used by the junit:report task. You can use this object to set various options that affect your report, for example:

JUnit.report.frames = false
JUnit.report.params['title'] = 'My App'
# File lib/buildr/java/tests.rb, line 185
def report
 @report ||= Report.new
end
version() click to toggle source
# File lib/buildr/java/tests.rb, line 189
def version
 Buildr.settings.build['junit'] || VERSION
end