db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r641615 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_4.java
Date Wed, 26 Mar 2008 22:40:51 GMT
Author: kmarsden
Date: Wed Mar 26 15:40:49 2008
New Revision: 641615

URL: http://svn.apache.org/viewvc?rev=641615&view=rev
Log:
Back out upgrade test change for DERBY-3523. It was causing failures in the 
tinderbox run.



Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_4.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_4.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_4.java?rev=641615&r1=641614&r2=641615&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_4.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_4.java
Wed Mar 26 15:40:49 2008
@@ -627,94 +627,4 @@
         }
         s.close();
     }
-    
-    /**
-     * Verifies error messages priviously generated.
-     */
-    private void verifyError() throws SQLException {
-        Statement stmt = createStatement();
-        PreparedStatement ps = prepareStatement("select text " +
-                                    "from errormessage where state = ?");
-        try {
-            stmt.execute("alter table t1 alter column i null");
-            fail ("expected error while setting primary key " +
-                    "column to nullable");
-        } catch (SQLException e) {
-            assertSQLState("expected state 42Z20", "42Z20", e);
-            ps.setString(1, e.getSQLState());
-            ResultSet rs = ps.executeQuery();
-            rs.next();
-            assertEquals("error message mismatch", rs.getString(1),
-                                    e.getMessage());
-            rs.close();
-        }
-        try {
-            stmt.execute("alter table t1 add constraint  uidx " +
-                    "unique(j)");
-            fail ("expected error while creating unique constraint " +
-                    "over nullable column");
-
-        } catch (SQLException e) {
-            assertSQLState("expected state 42831", "42831", e);
-            ps.setString(1, e.getSQLState());
-            ResultSet rs = ps.executeQuery();
-            rs.next();
-            assertEquals("error message mismatch", rs.getString(1),
-                                    e.getMessage());
-            rs.close();
-        }
-        stmt.close();
-        ps.close();
-    }
-    
-    /**
-     * Generates error messages and stores in a table.
-     */
-    private void prepareTable() throws SQLException {
-        Statement stmt = createStatement();
-        stmt.executeUpdate("create table errormessage (state varchar (6), " +
-                                            "text varchar (200))");
-        PreparedStatement ps = prepareStatement("insert into errormessage " +
-                    "(state, text) values (?, ?)");
-        stmt.executeUpdate("create table t1 (i integer primary key, " +
-                                                            "j integer)");
-        try {
-            stmt.execute("alter table t1 alter column i null");
-            fail ("expected error while setting primary key " +
-                    "column to nullable");
-        } catch (SQLException e) {
-            assertSQLState("expected state 42Z20", "42Z20", e);
-            ps.setString(1, e.getSQLState());
-            ps.setString(2, e.getMessage());
-            ps.executeUpdate();
-        }
-        try {
-            stmt.execute("alter table t1 add constraint  uidx " +
-                    "unique(j)");
-            fail ("expected error while creating unique constraint " +
-                    "over nullable column");
-        } catch (SQLException e) {
-            assertSQLState("expected state 42831", "42831", e);
-            ps.setString(1, e.getSQLState());
-            ps.setString(2, e.getMessage());
-            ps.executeUpdate();
-        }
-        stmt.close();
-        ps.close();
-    }
-    
-    /**
-     * check if error message generated during soft upgrade is 
-     * same as privious version.
-     */
-    public void testErrorMessage () throws Exception {
-        switch (getPhase()) {
-            case PH_CREATE:
-                prepareTable();
-                break;
-            case PH_SOFT_UPGRADE:
-                verifyError();
-                break;
-        }
-    }
 }



Mime
View raw message