db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r292289 - in /incubator/jdo/trunk/tck20: ./ test/conf/ test/java/org/apache/jdo/tck/util/
Date Wed, 28 Sep 2005 20:35:15 GMT
Author: mbo
Date: Wed Sep 28 13:35:06 2005
New Revision: 292289

URL: http://svn.apache.org/viewcvs?rev=292289&view=rev
Log:
JDO-92 Remove support for GUI test runner

Removed:
    incubator/jdo/trunk/tck20/test/conf/JDOTCKTestCases.list
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/util/SwingTestRunner.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/util/TestListSuite.java
Modified:
    incubator/jdo/trunk/tck20/project.xml
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/util/BatchTestRunner.java

Modified: incubator/jdo/trunk/tck20/project.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/project.xml?rev=292289&r1=292288&r2=292289&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/project.xml (original)
+++ incubator/jdo/trunk/tck20/project.xml Wed Sep 28 13:35:06 2005
@@ -155,7 +155,6 @@
             <resource>
                 <directory>${basedir}/test/conf</directory>
                 <includes>
-                    <include>JDOTCKTestCases.list</include>
                     <include>enhancement-test.properties</include>
                     <include>commons-logging.properties</include>
                     <include>simplelog.properties</include>

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/util/BatchTestRunner.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/util/BatchTestRunner.java?rev=292289&r1=292288&r2=292289&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/util/BatchTestRunner.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/util/BatchTestRunner.java Wed Sep
28 13:35:06 2005
@@ -30,6 +30,8 @@
 import junit.textui.ResultPrinter;
 import junit.textui.TestRunner;
 
+import javax.jdo.JDOFatalException;
+
 /**
  * TestRunner class for running a single test or a test suite in batch
  * mode. The format of the test output is specified by the result printer
@@ -86,7 +88,7 @@
     /** 
      * Runs in batch mode and sets an exit code. If the specified String
      * array includes a single fully qualified class name, this test class
-     * is executed. If it is empty it runs the TestListSuite.
+     * is executed.
      */
     public static void main(String args[]) {
         try {
@@ -104,15 +106,37 @@
     public TestResult start(String[] args) {
         Test suite = null;
         if ((args == null) || args.length == 0) {
-            suite = getTest(TestListSuite.class.getName());
+            String conf = System.getProperty("jdo.tck.cfg");
+            throw new JDOFatalException(
+                "Missing JDO TCK test classes for configuration '" + conf + 
+                "'. Please check the property 'jdo.tck.classes'.");
         }
         else if (args.length == 1) {
             suite = getTest(args[0]);
         }
         else {
-            suite = new TestListSuite("JDO TCK", Arrays.asList(args));
+            suite = getTestSuite(args);
         }
         return doRun(suite);
+    }
+    
+    /**
+     * Returns a JUnit TestSuite instance for the classes of the specified
+     * list of class names.
+     */
+    protected TestSuite getTestSuite(String[] classNames) {
+        TestSuite testSuite = new TestSuite();
+        for (int i = 0; i < classNames.length; i++) {
+            String className = classNames[i];
+            try {
+                testSuite.addTestSuite(Class.forName(className));
+            }
+            catch (ClassNotFoundException ex) {
+                System.out.println(
+                    "Cannot find test class '" + className + "'.");
+            }
+        }
+        return testSuite;
     }
 
     /** 



Mime
View raw message