summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--base/test/src/com/netscape/test/TestRunner.java24
-rw-r--r--specs/pki-core.spec6
2 files changed, 28 insertions, 2 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 {
diff --git a/specs/pki-core.spec b/specs/pki-core.spec
index 05c6850bb..003981411 100644
--- a/specs/pki-core.spec
+++ b/specs/pki-core.spec
@@ -5,7 +5,7 @@ distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
Name: pki-core
Version: 10.0.2
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Certificate System - PKI Core Components
URL: http://pki.fedoraproject.org/
License: GPLv2
@@ -1071,6 +1071,10 @@ fi
%changelog
+* Sat May 4 2013 Ade Lee <alee@redhat.com> 10.0.2-4
+- TRAC Ticket 605 Junit internal function used in TestRunner,
+ breaks F19 build
+
* Sat May 4 2013 Ade Lee <alee@redhat.com> 10.0.2-3
- TRAC Ticket 604 Added fallback methods for pkispawn tests