Class: Buildr::TestNG
- Inherits:
-
Buildr::TestFramework::Java
- Object
- Buildr::TestFramework::Base
- Buildr::TestFramework::Java
- Buildr::TestNG
- Defined in:
- lib/buildr/java/tests.rb
Overview
TestNG test framework. To use in your project:
test.using :testng
Support the following options:
-
:properties – Hash of properties passed to the test suite.
-
:java_args – Arguments passed to the JVM.
Constant Summary collapse
- VERSION =
'5.7'
Instance Attribute Summary
Attributes inherited from Buildr::TestFramework::Base
Class Method Summary collapse
Instance Method Summary collapse
-
#run(tests, dependencies) ⇒ Object
:nodoc:.
-
#tests(dependencies) ⇒ Object
:nodoc:.
Methods inherited from Buildr::TestFramework::Java
Methods inherited from Buildr::TestFramework::Base
applies_to?, #dependencies, #initialize, to_sym
Constructor Details
This class inherits a constructor from Buildr::TestFramework::Base
Class Method Details
.dependencies ⇒ Object
285 286 287 |
# File 'lib/buildr/java/tests.rb', line 285 def dependencies ["org.testng:testng:jar:jdk15:#{version}"]+ JMock.dependencies end |
Instance Method Details
#run(tests, dependencies) ⇒ Object
:nodoc:
303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/buildr/java/tests.rb', line 303 def run(tests, dependencies) #:nodoc: cmd_args = [ 'org.testng.TestNG', '-sourcedir', task.compile.sources.join(';'), '-suitename', task.send(:project).name ] cmd_args << '-d' << task.report_to.to_s = { :properties=>[:properties], :java_args=>[:java_args], :classpath=>dependencies } tests.inject([]) do |passed, test| begin Java::Commands.java cmd_args, '-testclass', test, .merge(:name=>test) passed << test rescue passed end end end |
#tests(dependencies) ⇒ Object
:nodoc:
297 298 299 300 301 |
# File 'lib/buildr/java/tests.rb', line 297 def tests(dependencies) #:nodoc: filter_classes(dependencies, :class_annotations => %w{org.testng.annotations.Test}, :method_annotations => %w{org.testng.annotations.Test}) end |