db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r470476 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi: DataSourcePropertiesTest.java SURQueryMixTest.java
Date Thu, 02 Nov 2006 19:05:49 GMT
Author: djd
Date: Thu Nov  2 11:05:48 2006
New Revision: 470476

URL: http://svn.apache.org/viewvc?view=rev&rev=470476
Log:
DERBY-2021 Fix DataSourceProperties and SURQueryMixTest to runs tests in client and embedded
as needed.
Fix DataSourceProperties to actually run some tests.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourcePropertiesTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourcePropertiesTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourcePropertiesTest.java?view=diff&rev=470476&r1=470475&r2=470476
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourcePropertiesTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourcePropertiesTest.java
Thu Nov  2 11:05:48 2006
@@ -49,7 +49,9 @@
 
     // SETUP
 
-    /** Creates a test suite with all test cases. */
+    /** Creates a test suite with all test cases
+     * only running in embedded at the moment.
+     */
     public static Test suite() {
         
         
@@ -63,21 +65,17 @@
         
             // Add all methods starting with 'test'.
             //suite.addTestSuite(DataSourcePropertiesTest.class);
-            
-            if (usingEmbedded()) {
-           
-                // When using embedded, add all methods starting with 'embedded'.
-                Method[] methods = DataSourcePropertiesTest.class.getMethods();
-                for (int i = 0; i < methods.length; i++) {
-                    Method m = methods[i];
-                    if (m.getParameterTypes().length > 0 ||
-                            m.getReturnType().equals(Void.TYPE)) {
-                        continue;
-                    }
-                    String name = m.getName();
-                    if (name.startsWith("embedded")) {
-                        suite.addTest(new DataSourcePropertiesTest(name));
-                    }
+ 
+            Method[] methods = DataSourcePropertiesTest.class.getMethods();
+            for (int i = 0; i < methods.length; i++) {
+                Method m = methods[i];
+                if (m.getParameterTypes().length > 0 ||
+                        !m.getReturnType().equals(Void.TYPE)) {
+                    continue;
+                }
+                String name = m.getName();
+                if (name.startsWith("embedded")) {
+                    suite.addTest(new DataSourcePropertiesTest(name));
                 }
             }
         }

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=470476&r1=470475&r2=470476
==============================================================================
--- 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
Thu Nov  2 11:05:48 2006
@@ -33,6 +33,9 @@
 import java.util.Map;
 import java.util.Random;
 import java.util.Set;
+
+import org.apache.derbyTesting.junit.TestConfiguration;
+
 import junit.extensions.TestSetup;
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -534,7 +537,8 @@
     }
     
     /**
-     * The suite contains all testcases in this class running on different data models
+     * Run in client and embedded.
+     * @return
      */
     public static Test suite() 
     {   
@@ -543,8 +547,22 @@
         // DB2 client doesn't support this functionality
         if (usingDerbyNet())
             return mainSuite;
-  
         
+        mainSuite.addTest(baseSuite("SURQueryMixTest:embedded"));
+        mainSuite.addTest(
+                TestConfiguration.clientServerDecorator(
+                        baseSuite("SURQueryMixTest:client")));
+        
+        return mainSuite;
+        
+    }
+  
+    /**
+     * The suite contains all testcases in this class running on different data models
+     */
+    private static Test baseSuite(String name) {
+        TestSuite mainSuite = new TestSuite(name);
+      
         // Iterate over all data models and decorate the tests:
         for (Iterator i = SURDataModelSetup.SURDataModel.values().iterator();
              i.hasNext();) {



Mime
View raw message