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 ka...@apache.org on 2014/03/10 08:52:04 UTC

svn commit: r1575862 - in /db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang: GeneratedColumnsTest.java build.xml

Author: kahatlen
Date: Mon Mar 10 07:52:03 2014
New Revision: 1575862

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

Modified:
    db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java
    db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml

Modified: db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java?rev=1575862&r1=1575861&r2=1575862&view=diff
==============================================================================
--- db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java (original)
+++ db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java Mon Mar 10 07:52:03 2014
@@ -5637,7 +5637,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();
 
@@ -5656,12 +5656,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.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml?rev=1575862&r1=1575861&r2=1575862&view=diff
==============================================================================
--- db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml (original)
+++ db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml Mon Mar 10 07:52:03 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"