You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2008/04/04 12:47:31 UTC
svn commit: r644677 -
/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
Author: bodewig
Date: Fri Apr 4 03:47:22 2008
New Revision: 644677
URL: http://svn.apache.org/viewvc?rev=644677&view=rev
Log:
disable FailureRecorder test when running JUnit4
Modified:
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java?rev=644677&r1=644676&r2=644677&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java Fri Apr 4 03:47:22 2008
@@ -24,6 +24,7 @@
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.BuildFileTest;
+import org.apache.tools.ant.util.JavaEnvUtils;
public class JUnitTaskTest extends BuildFileTest {
@@ -100,6 +101,17 @@
// $ ant -f junit.xml failureRecorder.runtest
// But running the JUnit testcase fails in 4th run.
public void testFailureRecorder() {
+ if (JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_1_5)) {
+ try {
+ Class.forName("junit.framework.JUnit4TestAdapter");
+ System.err.println("skipping tests since it fails when"
+ + " using JUnit 4");
+ return;
+ } catch (ClassNotFoundException e) {
+ // OK, this is JUnit3, can run test
+ }
+ }
+
try {
File testDir = new File(getProjectDir(), "out");
File collectorFile = new File(getProjectDir(),