db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andre...@apache.org
Subject svn commit: r433607 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/tests/jdbcapi/ junit/
Date Tue, 22 Aug 2006 11:46:14 GMT
Author: andreask
Date: Tue Aug 22 04:46:13 2006
New Revision: 433607

URL: http://svn.apache.org/viewvc?rev=433607&view=rev
Log:
DERBY-1558 enable more testcases in ConcurrencyTest. The patch makes use of SystemPropertiesTestSetup
within the ConcurrencyTest.suite method to reduce lock timeout. It additionally makes use
of NetworkServerTestSetup from the _Suite.suite() method. The _Suite_app.properties has been
added to disable starting of network server. 

Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite_app.properties
  (with props)
Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/NetworkServerTestSetup.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?rev=433607&r1=433606&r2=433607&view=diff
==============================================================================
--- 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
Tue Aug 22 04:46:13 2006
@@ -20,8 +20,9 @@
 package org.apache.derbyTesting.functionTests.tests.jdbcapi;
 import junit.framework.*;
 import java.sql.*;
-
+import java.util.Properties;
 import org.apache.derbyTesting.junit.JDBC;
+import org.apache.derbyTesting.junit.SystemPropertyTestSetup;
 
 /**
  * Testing concurrency behaviour in derby when creating the resultsets with
@@ -830,42 +831,51 @@
     // The default is to run all tests in the TestCase subclass.
     
     public static Test suite() {
-        TestSuite suite = new TestSuite();
+        final TestSuite suite = new TestSuite();
         
-        // DB2 client doesn't support this functionality
-        if (usingDerbyNet())
-            return suite;
-
-                
-        // Requires holdability
-        if (JDBC.vmSupportsJDBC3() || JDBC.vmSupportsJSR169()) {
-        
-        suite.addTest(new ConcurrencyTest("testUpdateLockDownGrade1"));
-        suite.addTest(new ConcurrencyTest("testAquireUpdateLock1"));
-                
-        suite.addTest(new ConcurrencyTest("testSharedLocks1"));
+        // This testcase does not require JDBC3/JSR169, since it does not
+        // specify result set concurrency) in Connection.createStatement().
         suite.addTest(new ConcurrencyTest("testSharedLocks2"));
-        suite.addTest(new ConcurrencyTest("testSharedAndUpdateLocks1"));
-        suite.addTest(new ConcurrencyTest("testSharedAndUpdateLocks2"));
         
-        // The following testcases requires Scrollable Updatable ResultSets:
-//         suite.addTest(new ConcurrencyTest("testUpdatePurgedTuple1"));
-//         suite.addTest(new ConcurrencyTest("testUpdatePurgedTuple2"));
-//         suite.addTest(new ConcurrencyTest("testUpdatePurgedTuple3"));
-//         suite.addTest(new ConcurrencyTest("testUpdatePurgedTuple4"));
-        
-        
-//         suite.addTest(new ConcurrencyTest("testUpdateModifiedTuple1"));
-//         suite.addTest(new ConcurrencyTest("testUpdateModifiedTuple2"));
-//         suite.addTest(new ConcurrencyTest("testTableIntentLock1"));
-//         suite.addTest(new ConcurrencyTest("testUpdateLockInReadUncommitted"));
-//         suite.addTest(new ConcurrencyTest("testDefragmentDuringScan"));
-//         suite.addTest(new ConcurrencyTest("testTruncateDuringScan"));
-        /// ---------------
+        // The following testcases requires JDBC3/JSR169:
+        if ((JDBC.vmSupportsJDBC3() || JDBC.vmSupportsJSR169())) {
+            
+            // The following testcases do not use updatable result sets:
+            suite.addTest(new ConcurrencyTest("testUpdateLockDownGrade1"));
+            suite.addTest(new ConcurrencyTest("testAquireUpdateLock1"));
+            suite.addTest(new ConcurrencyTest("testSharedLocks1"));
+            suite.addTest(new ConcurrencyTest("testSharedAndUpdateLocks1"));
+            suite.addTest(new ConcurrencyTest("testSharedAndUpdateLocks2"));
+            
+            // The following testcases do use updatable result sets.            
+            if (!usingDerbyNet()) { // DB2 client does not support UR with Derby
+                suite.addTest(new ConcurrencyTest ("testUpdatePurgedTuple2"));
+                suite.addTest(new ConcurrencyTest("testUpdatePurgedTuple3"));
+                suite.addTest(new ConcurrencyTest("testUpdatePurgedTuple4"));
+                suite.addTest(new ConcurrencyTest("testUpdateModifiedTuple1"));
+                suite.addTest(new ConcurrencyTest("testUpdateModifiedTuple2"));
+                suite.addTest(new ConcurrencyTest("testTableIntentLock1"));
+                suite.addTest
+                    (new ConcurrencyTest("testUpdateLockInReadUncommitted"));
+                suite.addTest(new ConcurrencyTest("testDefragmentDuringScan"));
+                suite.addTest(new ConcurrencyTest("testTruncateDuringScan"));
+                
+                // This testcase fails in DerbyNetClient framework due to 
+                // DERBY-1696
+                if (usingEmbedded()) {
+                    suite.addTest
+                        (new ConcurrencyTest("testUpdatePurgedTuple1"));
+                }
                 
+            }         
         }
-            
-        return suite;
+        
+        // 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 SystemPropertyTestSetup(suite, properties);
     }
     
 }

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?rev=433607&r1=433606&r2=433607&view=diff
==============================================================================
--- 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 Aug 22 04:46:13 2006
@@ -23,6 +23,7 @@
 
 import org.apache.derbyTesting.junit.BaseTestCase;
 import org.apache.derbyTesting.junit.JDBC;
+import org.apache.derbyTesting.junit.NetworkServerTestSetup;
 
 import junit.framework.Test; 
 import junit.framework.TestSuite;
@@ -63,6 +64,6 @@
 			suite.addTest(ScrollResultSetTest.suite());
 		}
 
-		return suite;
+		return new NetworkServerTestSetup(suite);
 	}
 }

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite_app.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite_app.properties?rev=433607&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite_app.properties
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite_app.properties
Tue Aug 22 04:46:13 2006
@@ -0,0 +1,6 @@
+#Don't want harness to start up network server.
+#It will be started in test
+startServer=false
+#Don't want harness to start up network server.
+#It will be started in test
+startServer=false

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite_app.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/NetworkServerTestSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/NetworkServerTestSetup.java?rev=433607&r1=433606&r2=433607&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/NetworkServerTestSetup.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/NetworkServerTestSetup.java
Tue Aug 22 04:46:13 2006
@@ -58,7 +58,7 @@
             networkServerController = new NetworkServerControl
                 (InetAddress.getByName(config.getHostName()), config.getPort());
             
-            networkServerController.start(new PrintWriter(System.out));
+            networkServerController.start(null);
             
             final long startTime = System.currentTimeMillis();
             while (true) {



Mime
View raw message