You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ka...@apache.org on 2010/06/21 15:03:20 UTC

svn commit: r956559 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/HoldCursorTest.java

Author: kahatlen
Date: Mon Jun 21 13:03:20 2010
New Revision: 956559

URL: http://svn.apache.org/viewvc?rev=956559&view=rev
Log:
Make HoldCursorTest run with the client driver.

Patch contributed by Yun Lee <yu...@gmail.com>.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/HoldCursorTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/HoldCursorTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/HoldCursorTest.java?rev=956559&r1=956558&r2=956559&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/HoldCursorTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/HoldCursorTest.java Mon Jun 21 13:03:20 2010
@@ -31,6 +31,7 @@ import junit.framework.TestSuite;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.JDBC;
 import org.apache.derbyTesting.junit.CleanDatabaseTestSetup;
+import org.apache.derbyTesting.junit.TestConfiguration;
 
 /**
  * Test hold cursor after commit
@@ -45,26 +46,35 @@ public class HoldCursorTest extends Base
 	/**
      * Create a suite of tests.
      */
-	
-	
-	  public static Test suite() {
+    public static Test suite() {
         TestSuite suite = new TestSuite("HoldCursorTest");
-        suite.addTest(baseSuite("HoldCursorTest:embedded"));
-        suite.addTest(baseSuite("HoldCursorTest:client"));
+
+        suite.addTest(baseSuite(true));
+        suite.addTest(baseSuite(false));
+
         return suite;
     }
-    private static Test baseSuite(String name) {
 
+    private static Test baseSuite(boolean embeddedMode) {
+        String name = "HoldCursorTest:" + (embeddedMode ? "embedded" : "client");
         TestSuite suite = new TestSuite(name);
 
         // Add tests that every JVM jdk1.4 or above should be able to run.
         suite.addTestSuite(HoldCursorTest.class);
+
         if (!JDBC.vmSupportsJSR169()) {
              suite.addTest (new HoldCursorTest("StatementsInProcedureTest"));
+        }
 
-           }
-        return new CleanDatabaseTestSetup(suite); 
+        Test test = suite;
+
+        if (!embeddedMode) {
+            test = TestConfiguration.clientServerDecorator(suite);
+        }
+
+        return new CleanDatabaseTestSetup(test);
     }
+
     /**
      * Set the fixture up with tables and insert rows .
      */