db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrn...@apache.org
Subject svn commit: r573418 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ReleaseCompileLocksTest.java
Date Fri, 07 Sep 2007 00:15:09 GMT
Author: myrnavl
Date: Thu Sep  6 17:15:06 2007
New Revision: 573418

URL: http://svn.apache.org/viewvc?rev=573418&view=rev
Log:
DERBY-3056; making test run with JSR169, although not exactly testing what test was designed
to test.


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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ReleaseCompileLocksTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ReleaseCompileLocksTest.java?rev=573418&r1=573417&r2=573418&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ReleaseCompileLocksTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ReleaseCompileLocksTest.java
Thu Sep  6 17:15:06 2007
@@ -103,9 +103,19 @@
             
             Statement stmt = createStatement();
 
-        	JDBC.assertFullResultSet(stmt.executeQuery(
-        		"select (dmlstatic()) from sys.systables where " +
-        		"CAST(tablename AS VARCHAR(128))= 'SYSCONGLOMERATES'"), new String[][] {{"1"}});
+    		// Calling the method dmlstatic with jsr169 will not work because
+    		// the procedures use DriverManager to get the default connection.
+    		// Of course, this makes this test not fully useful with jsr169,
+    		// but at least performing the call to locktable is performed.
+            if (JDBC.vmSupportsJDBC3()) 
+            	JDBC.assertFullResultSet(stmt.executeQuery(
+            		"select (dmlstatic()) from sys.systables where " +
+        			"CAST(tablename AS VARCHAR(128))= 'SYSCONGLOMERATES'"), new String[][] {{"1"}});
+    		else
+    			JDBC.assertFullResultSet(stmt.executeQuery(
+            		"select count(*) from sys.systables where " +
+            		"CAST(tablename AS VARCHAR(128)) = 'SYSCONGLOMERATES'"), new String[][] {{"1"}});
+    			
 
                 JDBC.assertEmpty(stmt.executeQuery("select TYPE, MODE, TABLENAME, LOCKNAME,
STATE from syscs_diag.lock_table order by 1"));
 		commit();
@@ -114,10 +124,19 @@
 		stmt.execute("create table t1 (s int)");
 		commit();
 
-		JDBC.assertFullResultSet(stmt.executeQuery(
+		// Calling the method insertstatic with jsr169 will not work because
+		// the procedures use DriverManager to get the default connection.
+		// Of course, this makes this test not fully useful with jsr169,
+		// but at least performing the call to locktable is performed.
+		if (JDBC.vmSupportsJDBC3())
+			JDBC.assertFullResultSet(stmt.executeQuery(
         		"select (insertstatic()) from sys.systables where " +
         		"CAST(tablename AS VARCHAR(128)) = 'SYSCONGLOMERATES'"), new String[][] {{"1"}});
-
+		else
+			JDBC.assertFullResultSet(stmt.executeQuery(
+        		"select count(*) from sys.systables where " +
+        		"CAST(tablename AS VARCHAR(128)) = 'SYSCONGLOMERATES'"), new String[][] {{"1"}});
+			
                 JDBC.assertEmpty(stmt.executeQuery("select TYPE, MODE, TABLENAME, LOCKNAME,
STATE from syscs_diag.lock_table order by 1"));
 
 		JDBC.assertEmpty(stmt.executeQuery("select * from t1"));



Mime
View raw message