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 mi...@apache.org on 2013/04/17 01:06:31 UTC

svn commit: r1468661 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java

Author: mikem
Date: Tue Apr 16 23:06:31 2013
New Revision: 1468661

URL: http://svn.apache.org/r1468661
Log:
DERBY-6154 add non-order by cases to the BlobClob4BlobTest

While debugging DERBY-6092 it was noted that some other code
paths could be exercised by adding non order by queries to
one of the test cases. This change just reruns one of the
test cases with order by queries and then again with non-order by
queries.

This change adds non-order by test runs based on the 
testTriggersWithClobColumn() test case.


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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java?rev=1468661&r1=1468660&r2=1468661&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java Tue Apr 16 23:06:31 2013
@@ -383,7 +383,9 @@ public class BlobClob4BlobTest extends B
     /**
      * Test triggers on CLOB columns.
      */
-    public void testTriggersWithClobColumn() throws Exception {
+    public void baseTestTriggersWithClobColumn(boolean useOrderBy) 
+        throws Exception {
+
         insertDefaultData();
 
         Statement stmt = createStatement();
@@ -413,12 +415,32 @@ public class BlobClob4BlobTest extends B
         Statement trigASt = createStatement();
         Statement trigBSt = createStatement();
 
-        ResultSet origRS = origSt.executeQuery(
-                "select a, length(a), b  from testClob order by b");
-        ResultSet trigARS = trigASt.executeQuery(
-                "select a, length(a), b from testClobTriggerA order by b");
-        ResultSet trigBRS = trigBSt.executeQuery(
-                "select a, length(a), b from testClobTriggerB order by b");
+        ResultSet origRS  = null;
+        ResultSet trigARS = null;
+        ResultSet trigBRS = null;
+
+        if (useOrderBy) {
+            origRS = 
+                origSt.executeQuery(
+                    "select a, length(a), b  from testClob order by b");
+            trigARS = 
+                trigASt.executeQuery(
+                    "select a, length(a), b from testClobTriggerA order by b");
+            trigBRS = 
+                trigBSt.executeQuery(
+                    "select a, length(a), b from testClobTriggerB order by b");
+
+        } else {
+            origRS = 
+                origSt.executeQuery(
+                        "select a, length(a), b  from testClob");
+            trigARS = 
+                trigASt.executeQuery(
+                        "select a, length(a), b from testClobTriggerA");
+            trigBRS = 
+                trigBSt.executeQuery(
+                        "select a, length(a), b from testClobTriggerB");
+        }
 
         int count = 0;
         while (origRS.next()) {
@@ -466,6 +488,31 @@ public class BlobClob4BlobTest extends B
     }
 
     /**
+     * Test triggers on CLOB columns.
+     * <p>
+     * Call with order by in the query, this causes a path through the
+     * sorter.
+     **/
+    public void testTriggersWithClobColumnOrderBy() 
+        throws Exception {
+
+        baseTestTriggersWithClobColumn(true);
+    }
+
+    /**
+     * Test triggers on CLOB columns.
+     * <p>
+     * Call with no order by in the query, thus a code path not through
+     * the sorter.
+     **/
+    public void testTriggersWithClobColumn() 
+        throws Exception {
+
+        baseTestTriggersWithClobColumn(false);
+    }
+
+
+    /**
      * test Clob.getSubString() method
      */
     public void testGetSubString() throws Exception {