db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r470492 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java
Date Thu, 02 Nov 2006 19:53:27 GMT
Author: djd
Date: Thu Nov  2 11:53:26 2006
New Revision: 470492

URL: http://svn.apache.org/viewvc?view=rev&rev=470492
Log:
DERBY-2021 Fix ConcurrencyTest to run embedded and client.

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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java?view=diff&rev=470492&r1=470491&r2=470492
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java
Thu Nov  2 11:53:26 2006
@@ -30,6 +30,7 @@
 
 import org.apache.derbyTesting.junit.DatabasePropertyTestSetup;
 import org.apache.derbyTesting.junit.JDBC;
+import org.apache.derbyTesting.junit.TestConfiguration;
 
 /**
  * Testing concurrency behaviour in derby when creating the resultsets with
@@ -837,8 +838,25 @@
     // By providing a static suite(), you can customize which tests to run.
     // The default is to run all tests in the TestCase subclass.
     
-    public static Test suite() {
+    /**
+     * Run in embedded and client.
+     */
+    public static Test suite()
+    {
         final TestSuite suite = new TestSuite("ConcurrencyTest");
+        suite.addTest(baseSuite("ConcurrencyTest:embedded", true));
+        
+        suite.addTest(
+                TestConfiguration.clientServerDecorator(
+                        baseSuite("ConcurrencyTest:client", false)));
+        
+        // Since this test relies on lock waiting, setting this property will
+        // make it go a lot faster:
+        return DatabasePropertyTestSetup.setLockTimeouts(suite, -1, 4);
+    }
+    
+    private static Test baseSuite(String name, boolean embedded) {
+        final TestSuite suite = new TestSuite(name);
         
         // This testcase does not require JDBC3/JSR169, since it does not
         // specify result set concurrency) in Connection.createStatement().
@@ -869,7 +887,7 @@
                 
                 // This testcase fails in DerbyNetClient framework due to 
                 // DERBY-1696
-                if (usingEmbedded()) {
+                if (embedded) {
                     suite.addTest
                         (new ConcurrencyTest("testUpdatePurgedTuple1"));
                 }
@@ -877,12 +895,7 @@
             }         
         }
         
-        // Since this test relies on lock waiting, setting this property will
-        // make it go a lot faster:
-        final Properties properties = new Properties();
-        properties.setProperty("derby.locks.waitTimeout", "4");
-        
-        return new DatabasePropertyTestSetup(suite, properties);
+        return suite;
     }
     
 }



Mime
View raw message