db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r749601 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/jdbc/ClobAccessTest.java
Date Tue, 03 Mar 2009 12:38:51 GMT
Author: kristwaa
Date: Tue Mar  3 12:38:51 2009
New Revision: 749601

URL: http://svn.apache.org/viewvc?rev=749601&view=rev
Log:
DERBY-3810: Create a simple Clob performance regression test.
Added a mechanism to run only selected tests.
Also added a forgotten test to the default suite
(testLargeClobGetLengthModified).
Patch file: derby-3810-2a-run_specific_tests.diff


Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/jdbc/ClobAccessTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/jdbc/ClobAccessTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/jdbc/ClobAccessTest.java?rev=749601&r1=749600&r2=749601&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/jdbc/ClobAccessTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/jdbc/ClobAccessTest.java
Tue Mar  3 12:38:51 2009
@@ -63,11 +63,20 @@
  * tested with the tests that modify the Clob content.
  * <p>
  * System properties controlling test behavior:
- * <lu><li>derby.tests.disableSmallClobs</li>
- *     <li>derby.tests.disableLargeClobs</li>
- *     <li>derby.tests.disableConcurrencyTest</li>
- *     <li>derby.tests.largeClobSize (in MB, 15 is the default)</li>
- * </ul>
+ * <dl>
+ *      <dt>derby.tests.disableSmallClobs</dt>
+ *      <dd>Whether or not to disable the testing of small Clobs.</dd>
+ *      <dt>derby.tests.disableLargeClobs</dt>
+ *      <dd>Whether or not to disable the testing of large Clobs.</dd>
+ *      <dt>derby.tests.disableConcurrencyTest</dt>
+ *      <dd>Whether or not to disable the concurrency test.</dd>
+ *      <dt>derby.tests.largeClobSize</dt>
+ *      <dd>Size of the large Clobs in MB, 15 MB is the default.</dd>
+ *      <dt>derby.tests.runLargeClobTests</dt>
+ *      <dd>A list of one or more tests to run. Only tests using large Clobs
+ *          should be specified, but this is not enforced. Example:
+ *          <tt>testFetchLargeClobPieceByPiece,testLargeClobGetLength</tt></dd>
+ * </dl>
  *
  * <p>
  * <b>NOTE</b>: Currently there are no tests for the client driver (network)
@@ -82,6 +91,12 @@
             Boolean.getBoolean("derby.tests.disableLargeClobs");
     private static final boolean disableConcurrencyTest =
             Boolean.getBoolean("derby.tests.disableConcurrencyTest");
+    /**
+     * A list of one or more tests to be run. Only tests using a large Clob
+     * should be specified.
+     */
+    private static final String runLargeClobTests =
+            System.getProperty("derby.tests.runLargeClobTests", null);
     private static final int largeClobSizeMB =
             Integer.getInteger("derby.tests.largeClobSize", 15).intValue();
 
@@ -127,28 +142,31 @@
         if (!disableLargeClobs) {
             int iters = 5;
             int reps = 1;
-            println("Adding large Clob tests.");
+            String[] tests = new String[] {
+                    "testFetchLargeClobs",
+                    "testFetchLargeClobsModified",
+                    "testFetchLargeClobWithStream",
+                    "testFetchLargeClobOneByOneCharBaseline",
+                    "testFetchLargeClobOneByOneCharModified",
+                    "testFetchLargeClobOneByOneChar",
+                    "testFetchLargeClobPieceByPiece",
+                    "testFetchLargeClobPieceByPieceModified",
+                    "testLargeClobGetLength",
+                    "testLargeClobGetLengthModified",
+                    "testFetchLargeClobPieceByPieceBackwards",
+                };
+            // See if the user has overridden which tests to run.
+            if (runLargeClobTests != null) {
+                String[] specifiedTests = runLargeClobTests.split(",");
+                if (specifiedTests.length > 0) {
+                    tests = specifiedTests;
+                }
+            }
+            println("Adding " + tests.length + " large Clob tests.");
             TestSuite largeSuite = new TestSuite("Large Clob suite");
-            largeSuite.addTest(new ClobAccessTest(
-                    "testFetchLargeClobs", iters, reps));
-            largeSuite.addTest(new ClobAccessTest(
-                    "testFetchLargeClobsModified", iters, reps));
-            largeSuite.addTest(new ClobAccessTest(
-                    "testFetchLargeClobWithStream", iters, reps));
-            largeSuite.addTest(new ClobAccessTest(
-                    "testFetchLargeClobOneByOneCharBaseline", iters, reps));
-            largeSuite.addTest(new ClobAccessTest(
-                    "testFetchLargeClobOneByOneCharModified", iters, reps));
-            largeSuite.addTest(new ClobAccessTest(
-                    "testFetchLargeClobOneByOneChar", iters, reps));
-            largeSuite.addTest(new ClobAccessTest(
-                    "testFetchLargeClobPieceByPiece", iters, reps));
-            largeSuite.addTest(new ClobAccessTest(
-                    "testFetchLargeClobPieceByPieceModified", iters, reps));
-            largeSuite.addTest(new ClobAccessTest(
-                    "testLargeClobGetLength", iters, reps));
-            largeSuite.addTest(new ClobAccessTest(
-                    "testFetchLargeClobPieceByPieceBackwards", iters, reps));
+            for (int i=0; i < tests.length; i++) {
+                largeSuite.addTest(new ClobAccessTest(tests[i] , iters, reps));
+            }
             mainSuite.addTest(largeSuite);
         }
         if (!disableConcurrencyTest) {



Mime
View raw message