db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r464999 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/tests/jdbcapi/ functionTests/tests/lang/ junit/
Date Tue, 17 Oct 2006 18:45:58 GMT
Author: djd
Date: Tue Oct 17 11:45:55 2006
New Revision: 464999

URL: http://svn.apache.org/viewvc?view=rev&rev=464999
Log:
DERBY-1952 (partial) DERBY-1971 (partial) Change more of the tests run from jdbcapi._Suite
to return suites
that run in embedded and client as primary configurations. Name some of the TestSuites returned
from TestConfiguration
to make the hierarchy view in the Swing Test Runner more useful.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/HoldabilityTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ScrollResultSetTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/URCoveringIndexTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangScripts.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/HoldabilityTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/HoldabilityTest.java?view=diff&rev=464999&r1=464998&r2=464999
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/HoldabilityTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/HoldabilityTest.java
Tue Oct 17 11:45:55 2006
@@ -22,6 +22,7 @@
 import java.sql.*;
 
 import org.apache.derbyTesting.junit.CleanDatabaseTestSetup;
+import org.apache.derbyTesting.junit.TestConfiguration;
 
 /**
  * Tests holdable resultsets.
@@ -34,16 +35,12 @@
     }
     
     public static Test suite() {
-        TestSuite suite = new TestSuite();
                
         // DB2 client doesn't support this functionality
         if (usingDerbyNet())
-            return suite;
+            return new TestSuite();
         
-        suite.addTestSuite(HoldabilityTest.class);
-        
-        return new CleanDatabaseTestSetup(suite);
-
+        return TestConfiguration.defaultSuite(HoldabilityTest.class);
     }
 
     /**

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java?view=diff&rev=464999&r1=464998&r2=464999
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java
Tue Oct 17 11:45:55 2006
@@ -56,16 +56,6 @@
         conn.setAutoCommit(false);
         conn.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);   
     }
-
-    /**
-     * Set up the connection to the database.
-     */
-    public void setUp() throws  Exception {       
-        println("SetUp");
-        // temp save the connection in this class as con
-        // as well as the default connection in the parent
-        con = getConnection();
-    }
     
     /**
      * Verify the data of a tuple in the ResultSet, based on the data 
@@ -276,7 +266,6 @@
         }
     }
     
-    protected Connection con = null; // Connection established in setUp()
     final int recordCount;
     
        

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java?view=diff&rev=464999&r1=464998&r2=464999
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java
Tue Oct 17 11:45:55 2006
@@ -558,11 +558,4 @@
         }
         return mainSuite;
     }
-
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        con = null;
-    }
-    
-  
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURTest.java?view=diff&rev=464999&r1=464998&r2=464999
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURTest.java
Tue Oct 17 11:45:55 2006
@@ -1605,9 +1605,4 @@
         
         return mainSuite;
     }
-
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        con = null;
-    }
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ScrollResultSetTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ScrollResultSetTest.java?view=diff&rev=464999&r1=464998&r2=464999
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ScrollResultSetTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ScrollResultSetTest.java
Tue Oct 17 11:45:55 2006
@@ -22,6 +22,7 @@
 import org.apache.derbyTesting.functionTests.util.SQLStateConstants;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.JDBC;
+import org.apache.derbyTesting.junit.TestConfiguration;
 
 import junit.framework.*;
 
@@ -51,14 +52,15 @@
     }
     
     public static Test suite() {
-        TestSuite suite = new TestSuite();
                 
         // Requires holdability
         if (JDBC.vmSupportsJDBC3() || JDBC.vmSupportsJSR169()) {
-        	suite.addTestSuite(ScrollResultSetTest.class);
+            // Run embedded and client
+        	return TestConfiguration.defaultSuite(ScrollResultSetTest.class);
         }
         
-        return suite;
+        // empty suite, no holdability supported.
+        return new TestSuite();
     }
 
     /**

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/URCoveringIndexTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/URCoveringIndexTest.java?view=diff&rev=464999&r1=464998&r2=464999
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/URCoveringIndexTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/URCoveringIndexTest.java
Tue Oct 17 11:45:55 2006
@@ -21,6 +21,7 @@
 import org.apache.derbyTesting.functionTests.util.TestUtil;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.JDBC;
+import org.apache.derbyTesting.junit.TestConfiguration;
 
 import junit.framework.*;
 import java.sql.*;
@@ -35,10 +36,15 @@
  */
 public class URCoveringIndexTest extends BaseJDBCTestCase {
     
+    public static Test suite() {
+        return TestConfiguration.defaultSuite(URCoveringIndexTest.class);
+    }
+    
     /** Creates a new instance of SURBaseTest */
     public URCoveringIndexTest(String name) {
         super(name);
     }
+    
 
     /**
      * Set up the connection to the database.

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java?view=diff&rev=464999&r1=464998&r2=464999
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java
Tue Oct 17 11:45:55 2006
@@ -21,6 +21,7 @@
 import org.apache.derbyTesting.functionTests.util.TestUtil;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.JDBC;
+import org.apache.derbyTesting.junit.TestConfiguration;
 
 import junit.framework.*;
 import java.sql.*;
@@ -81,15 +82,14 @@
     
     /** Create a test suite with all tests in this class. */
     public static Test suite() {
-        TestSuite ts = new TestSuite();
 
         // Test will fail with JCC.
         if (usingDerbyNet()) {
-            return ts;
+            // empty suite
+            return new TestSuite();
         }
 
-        ts.addTestSuite(UpdatableResultSetTest.class);
-        return ts;
+        return TestConfiguration.defaultSuite(UpdatableResultSetTest.class);
     }
     
     /**

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java?view=diff&rev=464999&r1=464998&r2=464999
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
Tue Oct 17 11:45:55 2006
@@ -55,7 +55,7 @@
 		suite.addTest(SURTest.suite());
 		suite.addTest(UpdatableResultSetTest.suite());
 		suite.addTest(UpdateXXXTest.suite());
-		suite.addTestSuite(URCoveringIndexTest.class);
+		suite.addTest(URCoveringIndexTest.suite());
         suite.addTest(ResultSetCloseTest.suite());
         suite.addTest(DataSourcePropertiesTest.suite());
 		

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangScripts.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangScripts.java?view=diff&rev=464999&r1=464998&r2=464999
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangScripts.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangScripts.java
Tue Oct 17 11:45:55 2006
@@ -85,13 +85,13 @@
 	 */
 	public static Test suite() {
         
-        TestSuite suite = new TestSuite();
+        TestSuite suite = new TestSuite("LangScripts");
         suite.addTest(getSuite(SQL_LANGUAGE_TESTS));
         suite.addTest(getSuite(DERBY_TESTS));
         suite.addTest(getSuite(EMBEDDED_TESTS));
         
         // Set up the scripts run with the network client
-        TestSuite clientTests = new TestSuite();
+        TestSuite clientTests = new TestSuite("LangScripts:client");
         clientTests.addTest(getSuite(SQL_LANGUAGE_TESTS));
         clientTests.addTest(getSuite(DERBY_TESTS));
         Test client = TestConfiguration.clientServerDecorator(clientTests);
@@ -116,7 +116,7 @@
       */
 	private static Test getSuite(String[] list)
 	{
-        TestSuite suite = new TestSuite();
+        TestSuite suite = new TestSuite("SQL scripts");
         for (int i = 0; i < list.length; i++)
             suite.addTest(
             		new CleanDatabaseTestSetup(

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java?view=diff&rev=464999&r1=464998&r2=464999
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java
Tue Oct 17 11:45:55 2006
@@ -169,7 +169,7 @@
      */
     public static Test defaultSuite(Class testClass)
     {
-        final TestSuite suite = new TestSuite();
+        final TestSuite suite = new TestSuite(suiteName(testClass));
         
         suite.addTest(embeddedSuite(testClass));            
         suite.addTest(clientServerSuite(testClass));
@@ -178,13 +178,28 @@
     }
     
     /**
+     * Generate a suite name from a class name, taking
+     * only the last element of the fully qualified class name.
+     */
+    private static String suiteName(Class testClass)
+    {
+        int lastDot = testClass.getName().lastIndexOf('.');
+        String suiteName = testClass.getName();
+        if (lastDot != -1)
+            suiteName = suiteName.substring(lastDot + 1, suiteName.length());
+        
+        return suiteName;
+    }
+    
+    /**
      * Create a suite for the passed test class that includes
      * all the default fixtures from the class, wrapped
      * in a single CleanDatabaseTestSetup.
       */
     public static Test embeddedSuite(Class testClass)
     {
-        return new TestSuite(testClass);
+        return new TestSuite(testClass,
+                suiteName(testClass)+":embedded");
     }
     
     /**
@@ -196,7 +211,8 @@
       */
     public static Test clientServerSuite(Class testClass)
     {           
-        TestSuite suite = new TestSuite(testClass);
+        TestSuite suite = new TestSuite(testClass,
+                suiteName(testClass)+":client");
         return clientServerDecorator(suite);
     }
     /**



Mime
View raw message