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/15 23:12:08 UTC

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

Author: mikem
Date: Mon Apr 15 21:12:08 2013
New Revision: 1468229

URL: http://svn.apache.org/r1468229
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.  


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=1468229&r1=1468228&r2=1468229&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 Mon Apr 15 21:12:08 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,23 @@ 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 = (useOrderBy ? 
+            origSt.executeQuery(
+                "select a, length(a), b  from testClob order by b") :
+            origSt.executeQuery(
+                    "select a, length(a), b  from testClob"));
+
+        ResultSet trigARS = (useOrderBy ? 
+            trigASt.executeQuery(
+                "select a, length(a), b from testClobTriggerA order by b") :
+            trigASt.executeQuery(
+                "select a, length(a), b from testClobTriggerA"));
+
+        ResultSet trigBRS =  (useOrderBy ?
+            trigBSt.executeQuery(
+                "select a, length(a), b from testClobTriggerB order by b") :
+            trigBSt.executeQuery(
+                "select a, length(a), b from testClobTriggerB order by b"));
 
         int count = 0;
         while (origRS.next()) {
@@ -466,6 +479,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 {