|
@@ -94,6 +94,9 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR |
|
|
*/ |
|
|
*/ |
|
|
private Permissions perm = null; |
|
|
private Permissions perm = null; |
|
|
|
|
|
|
|
|
|
|
|
private static final String JUNIT_4_TEST_ADAPTER |
|
|
|
|
|
= "junit.framework.JUnit4TestAdapter"; |
|
|
|
|
|
|
|
|
private static final String[] DEFAULT_TRACE_FILTERS = new String[] { |
|
|
private static final String[] DEFAULT_TRACE_FILTERS = new String[] { |
|
|
"junit.framework.TestCase", |
|
|
"junit.framework.TestCase", |
|
|
"junit.framework.TestResult", |
|
|
"junit.framework.TestResult", |
|
@@ -370,10 +373,10 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR |
|
|
Class.forName("java.lang.annotation.Annotation"); |
|
|
Class.forName("java.lang.annotation.Annotation"); |
|
|
if (loader == null) { |
|
|
if (loader == null) { |
|
|
junit4TestAdapterClass = |
|
|
junit4TestAdapterClass = |
|
|
Class.forName("junit.framework.JUnit4TestAdapter"); |
|
|
|
|
|
|
|
|
Class.forName(JUNIT_4_TEST_ADAPTER); |
|
|
} else { |
|
|
} else { |
|
|
junit4TestAdapterClass = |
|
|
junit4TestAdapterClass = |
|
|
Class.forName("junit.framework.JUnit4TestAdapter", |
|
|
|
|
|
|
|
|
Class.forName(JUNIT_4_TEST_ADAPTER, |
|
|
true, loader); |
|
|
true, loader); |
|
|
} |
|
|
} |
|
|
} catch (ClassNotFoundException e) { |
|
|
} catch (ClassNotFoundException e) { |
|
@@ -419,7 +422,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR |
|
|
logTestListenerEvent("tests to run: " + suite.countTestCases()); |
|
|
logTestListenerEvent("tests to run: " + suite.countTestCases()); |
|
|
suite.run(res); |
|
|
suite.run(res); |
|
|
} finally { |
|
|
} finally { |
|
|
if (junit4) { |
|
|
|
|
|
|
|
|
if (junit4 || |
|
|
|
|
|
suite.getClass().getName().equals(JUNIT_4_TEST_ADAPTER)) { |
|
|
int[] cnts = findJUnit4FailureErrorCount(res); |
|
|
int[] cnts = findJUnit4FailureErrorCount(res); |
|
|
junitTest.setCounts(res.runCount(), cnts[0], cnts[1]); |
|
|
junitTest.setCounts(res.runCount(), cnts[0], cnts[1]); |
|
|
} else { |
|
|
} else { |
|
|