summaryrefslogtreecommitdiffstats
path: root/base/test
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2013-05-04 16:14:50 -0400
committerAde Lee <alee@redhat.com>2013-05-04 16:14:50 -0400
commitd27b684ce9221edcd11e7a746f8e35e2d39b2a43 (patch)
treeb21c7a50b9432b3b4fe6b9fddf29a327dc7e0ff2 /base/test
parent9d00ecc4005ce029525512ab4cdcfe1e26065bfa (diff)
downloadpki-d27b684ce9221edcd11e7a746f8e35e2d39b2a43.tar.gz
pki-d27b684ce9221edcd11e7a746f8e35e2d39b2a43.tar.xz
pki-d27b684ce9221edcd11e7a746f8e35e2d39b2a43.zip
JUnit internal class used in TestRunner
runMain() has been changed to private access in latest junit(), breaking the 19 build. We should not have been using this class in the first place. Replaced it with the implementation of runMain() which uses run(classes). Ticket 605
Diffstat (limited to 'base/test')
-rw-r--r--base/test/src/com/netscape/test/TestRunner.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/base/test/src/com/netscape/test/TestRunner.java b/base/test/src/com/netscape/test/TestRunner.java
index 7eb4bfd3e..746b376f8 100644
--- a/base/test/src/com/netscape/test/TestRunner.java
+++ b/base/test/src/com/netscape/test/TestRunner.java
@@ -1,8 +1,13 @@
package com.netscape.test;
+import java.util.ArrayList;
+import java.util.List;
+
import org.junit.internal.RealSystem;
+import org.junit.runner.Description;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
+import org.junit.runner.notification.Failure;
public class TestRunner {
@@ -10,8 +15,25 @@ public class TestRunner {
JUnitCore core = new JUnitCore();
core.addListener(new TestListener());
+ RealSystem system = new RealSystem();
+
+ List<Class<?>> classes= new ArrayList<Class<?>>();
+ List<Failure> missingClasses= new ArrayList<Failure>();
+ for (String each : args) {
+ try {
+ classes.add(Class.forName(each));
+ } catch (ClassNotFoundException e) {
+ system.out().println("Could not find class: " + each);
+ Description description= Description.createSuiteDescription(each);
+ Failure failure= new Failure(description, e);
+ missingClasses.add(failure);
+ }
+ }
+ Result result= core.run(classes.toArray(new Class[0]));
+ for (Failure each : missingClasses)
+ result.getFailures().add(each);
- return core.runMain(new RealSystem(), args);
+ return result;
}
public static void main(String... args) throws Exception {