db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1575933 - in /db/derby/code/branches/10.9: ./ java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml
Date Mon, 10 Mar 2014 13:03:58 GMT
Author: kahatlen
Date: Mon Mar 10 13:03:57 2014
New Revision: 1575933

URL: http://svn.apache.org/r1575933
Log:
DERBY-6361: Fix UnsupportedClassVersionError when running tests on Java 5

Merged revision 1575862 from 10.10.

Modified:
    db/derby/code/branches/10.9/   (props changed)
    db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java
    db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml

Propchange: db/derby/code/branches/10.9/
------------------------------------------------------------------------------
  Merged /db/derby/code/branches/10.10:r1575862

Modified: db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java?rev=1575933&r1=1575932&r2=1575933&view=diff
==============================================================================
--- db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java
(original)
+++ db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java
Mon Mar 10 13:03:57 2014
@@ -5585,7 +5585,7 @@ public class GeneratedColumnsTest extend
         conn.setAutoCommit(false);
 
         // Verify that the user does not have a schema.
-        JDBC.assertEmpty(conn.getMetaData().getSchemas(null, user));
+        assertFalse(schemaExists(conn, user));
 
         Statement s = conn.createStatement();
 
@@ -5604,12 +5604,28 @@ public class GeneratedColumnsTest extend
                 new String[][] {{"1", "-1", "2"}, {"2", "-2", "3"}});
 
         // Verify that the user still does not have a schema.
-        JDBC.assertEmpty(conn.getMetaData().getSchemas(null, user));
+        assertFalse(schemaExists(conn, user));
 
         s.close();
         JDBC.cleanup(conn);
     }
 
+    private static boolean schemaExists(Connection conn, String name) throws SQLException
{
+        ResultSet rs = conn.getMetaData().getSchemas();
+
+        try {
+            while (rs.next()) {
+                if (name.equals(rs.getString("TABLE_SCHEM"))) {
+                    return true;
+                }
+            }
+        } finally {
+            rs.close();
+        }
+
+        return false;
+    }
+
     /**
      * Verify that generated columns work even if the compilation schema at
      * the time of adding the generated columns is dropped. Regression test

Modified: db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml?rev=1575933&r1=1575932&r2=1575933&view=diff
==============================================================================
--- db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml
(original)
+++ db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml
Mon Mar 10 13:03:57 2014
@@ -59,35 +59,13 @@
 <!--             ============ Begin Targets ==============                -->
  
   <target name="FTOtestsubdir" depends="compilett4,copyfiles"/>
-  <target name="compilet0">
-    <javac
-      source="${compilerLevel16}"
-      target="${compilerLevel16}"
-      bootclasspath="${empty}"
-      nowarn="on"
-      debug="true"
-      depend="${depend}"
-      deprecation="${deprecation}"
-      optimize="${optimize}"
-      proceed="${proceed}"
-      verbose="${verbose}"
-      srcdir="${derby.testing.src.dir}"
-      destdir="${out.dir}">
-      <classpath>
-        <pathelement path="${java16compile.classpath}"/>
-      	<pathelement path="${junit}"/>
-      </classpath>
-      <include name="${this.dir}/GeneratedColumnsTest.java"/>
-    </javac>
-  </target> 
 
   <!-- mkdir / init target may not be necessary, just here for reference... -->
   <target name="init">
     <mkdir dir="${out.dir}/${derby.testing.functest.dir}/tests/lang"/>
   </target>
 
-
-  <target name="compilet1" depends="compilet0">
+  <target name="compilet1">
     <javac
       source="1.4"
       target="1.4"



Mime
View raw message