ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r454207 - /ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunnerTest.java
Date Sun, 08 Oct 2006 20:53:25 GMT
Author: peterreilly
Date: Sun Oct  8 13:53:25 2006
New Revision: 454207

URL: http://svn.apache.org/viewvc?view=rev&rev=454207
Log:
For JUnitTestRunnerTest: testInvalidTestCase and testNoTestCase
JUnit4 adaption returns an ERROR wheres JUnit3 returns a FAILURE.
Modify testcase to reflect this.


Modified:
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunnerTest.java

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunnerTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunnerTest.java?view=diff&rev=454207&r1=454206&r2=454207
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunnerTest.java
(original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunnerTest.java
Sun Oct  8 13:53:25 2006
@@ -61,15 +61,27 @@
     public void testNoTestCase(){
         TestRunner runner = createRunner(NoTestCase.class);
         runner.run();
-        assertEquals(runner.getFormatter().getError(), JUnitTestRunner.FAILURES, runner.getRetCode());
+        // On junit3 this is a FAILURE, on junit4 this is an ERROR
+        int ret = runner.getRetCode();
+        
+        if (ret != JUnitTestRunner.FAILURES && ret != JUnitTestRunner.ERRORS) {
+            fail("Unexpected result " + ret + " from junit runner");
+        }
+        // JUnit3 test
+        //assertEquals(runner.getFormatter().getError(), JUnitTestRunner.FAILURES, runner.getRetCode());
     }
 
     // check that an exception in the constructor is noticed
     public void testInvalidTestCase(){
         TestRunner runner = createRunner(InvalidTestCase.class);
         runner.run();
-        String error = runner.getFormatter().getError();
-        assertEquals(error, JUnitTestRunner.FAILURES, runner.getRetCode());
+        // On junit3 this is a FAILURE, on junit4 this is an ERROR
+        int ret = runner.getRetCode();
+        if (ret != JUnitTestRunner.FAILURES && ret != JUnitTestRunner.ERRORS) {
+            fail("Unexpected result " + ret + " from junit runner");
+        }
+        // JUNIT3 test
+        //assertEquals(error, JUnitTestRunner.FAILURES, runner.getRetCode());
         //@fixme as of now does not report the original stacktrace.
         //assertTrue(error, error.indexOf("thrown on purpose") != -1);
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message