lib/java/test.rb in buildr-1.2.6 vs lib/java/test.rb in buildr-1.2.7
- old
+ new
@@ -367,11 +367,11 @@
else
puts "Running tests in #{@project.name}" if verbose
@failed_tests = send("#{framework}_run",
:classes => classes,
:classpath => @classpath + [compile.target],
- :properties => { "baseDir" => compile.target.to_s }.merge(options[:properties] || {}),
+ :properties => { 'baseDir' => compile.target.to_s }.merge(options[:properties] || {}),
:environment=> options[:environment] || {},
:java_args => options[:java_args] || Buildr.options.java_args)
unless @failed_tests.empty?
warn "The following tests failed:\n#{@failed_tests.join("\n")}" if verbose
fail "Tests failed!"
@@ -393,11 +393,11 @@
# options for that task, for example:
# JUnit.report.frames = false
class Report
# Ant-Trax required for running the JUnitReport task.
- Java.rjb.onload { |rjb| rjb.classpath << "org.apache.ant:ant-trax:jar:#{Ant::VERSION}" }
+ Java.wrapper.setup { |jw| jw.classpath << "org.apache.ant:ant-trax:jar:#{Ant::VERSION}" }
# Parameters passed to the Ant JUnitReport task.
attr_reader :params
# True (default) to produce a report using frames, false to produce a single-page report.
attr_accessor :frames
@@ -445,11 +445,11 @@
# Pattern for selecting JUnit test classes. Regardless of include/exclude patterns, only classes
# that match this pattern are used.
JUNIT_TESTS_PATTERN = [ "Test*", "*Test" ]
# Ant-JUnit requires for JUnit and JUnit reports tasks.
- Java.rjb.onload { |rjb| rjb.classpath << "org.apache.ant:ant-junit:jar:#{Ant::VERSION}" }
+ Java.wrapper.setup { |jw| jw.classpath << "org.apache.ant:ant-junit:jar:#{Ant::VERSION}" }
class << self
# :call-seq:
# report()
@@ -483,10 +483,10 @@
when true, :once
forking = { :fork=>true, :forkmode=>"once" }
else
fail "Option fork must be :once, :each or false."
end
- ant.junit forking.merge(:clonevm=>true) do
+ ant.junit forking.merge(:clonevm=>options[:clonevm] || false, :dir=>@project.path_to) do
ant.classpath :path=>args[:classpath].map(&:to_s).each { |path| file(path).invoke }.join(File::PATH_SEPARATOR)
args[:properties].each { |key, value| ant.sysproperty :key=>key, :value=>value }
args[:environment].each { |key, value| ant.env :key=>key, :value=>value }
java_args = args[:java_args]
java_args = java_args.split(" ") if String === java_args