Browse Source

disable FailureRecorder test when running JUnit4

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@644677 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
b1e478fd6c
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java

+ 12
- 0
src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java View File

@@ -24,6 +24,7 @@ import java.io.IOException;

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 @@ public class JUnitTaskTest extends BuildFileTest {
// $ 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(),


Loading…
Cancel
Save