You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by as...@apache.org on 2008/02/26 21:56:39 UTC
svn commit: r631373 -
/incubator/buildr/trunk/spec/java_test_frameworks_spec.rb
Author: assaf
Date: Tue Feb 26 12:56:37 2008
New Revision: 631373
URL: http://svn.apache.org/viewvc?rev=631373&view=rev
Log:
Updated specs to new TestNG behavior
Modified:
incubator/buildr/trunk/spec/java_test_frameworks_spec.rb
Modified: incubator/buildr/trunk/spec/java_test_frameworks_spec.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/java_test_frameworks_spec.rb?rev=631373&r1=631372&r2=631373&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/java_test_frameworks_spec.rb (original)
+++ incubator/buildr/trunk/spec/java_test_frameworks_spec.rb Tue Feb 26 12:56:37 2008
@@ -298,15 +298,28 @@
project('foo').test.dependencies.should include(*artifacts(JMock::REQUIRES))
end
- it 'should include classes starting with and ending with Test' do
- write 'src/test/java/com/example/TestThis.java', 'package com.example; public class TestThis {}'
- write 'src/test/java/com/example/ThisTest.java', 'package com.example; public class ThisTest {}'
+ it 'should include classes using TestNG annotations' do
+ write 'src/test/java/com/example/AnnotatedClass.java', <<-JAVA
+ package com.example;
+ import org.testng.annotations.Test
+ @Test
+ public class AnnotatedClass {
+ }
+ JAVA
+ write 'src/test/java/com/example/AnnotatedMethod.java', <<-JAVA
+ package com.example;
+ import org.testng.annotations.Test
+ public class AnnotatedMethod {
+ @Test
+ publid void annotated {};
+ }
+ JAVA
define('foo') { test.using(:testng) }
project('foo').test.invoke
- project('foo').test.tests.should include('com.example.TestThis', 'com.example.ThisTest')
+ project('foo').test.tests.should include('com.example.AnnotatedClass', 'com.example.AnnotatedMethod')
end
- it 'should ignore classes not using Test prefix or suffix' do
+ it 'should ignore classes not using TestNG annotations' do
write 'src/test/java/NotATestClass.java', 'public class NotATestClass {}'
define('foo') { test.using(:testng) }
project('foo').test.invoke
@@ -315,6 +328,8 @@
it 'should ignore inner classes' do
write 'src/test/java/InnerClassTest.java', <<-JAVA
+ import org.testng.annotations.Test;
+ @Test
public class InnerClassTest {
public class InnerTest {
}