db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o..@apache.org
Subject svn commit: r822641 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SequenceTest.java
Date Wed, 07 Oct 2009 10:17:40 GMT
Author: ole
Date: Wed Oct  7 10:17:40 2009
New Revision: 822641

URL: http://svn.apache.org/viewvc?rev=822641&view=rev
Log:
DERBY-4393 - lang.SequenceTest fails w/ "Sequence 'ALPHA_SEQ' already exists." on phoneME/cvm.
Do cleanup in testcases to make the testcases independent of running order.

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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SequenceTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SequenceTest.java?rev=822641&r1=822640&r2=822641&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SequenceTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SequenceTest.java
Wed Oct  7 10:17:40 2009
@@ -79,13 +79,16 @@
         s.executeUpdate("DROP SEQUENCE mySeq1");
     }
 
-    public void testDuplicateCreationFailure() {
+    public void testDuplicateCreationFailure() throws SQLException {
+        Statement s = null;
         try {
-            Statement s = createStatement();
+            s = createStatement();
             s.executeUpdate("CREATE SEQUENCE mySeq1");
             s.executeUpdate("CREATE SEQUENCE mySeq1");
         } catch (SQLException sqle) {
             assertSQLState("X0Y68", sqle);
+        }finally{
+            s.executeUpdate("DROP SEQUENCE mySeq1"); // Drop the one created.
         }
     }
 
@@ -154,6 +157,9 @@
         // should implicitly create schema ALPHA
         assertStatementError("42507", stmtBeta, "DROP SEQUENCE alpha.alpha_seq");
 
+        // Cleanup:
+        stmtAlpha.executeUpdate("DROP SEQUENCE alpha_seq");
+        
         stmtAlpha.close();
         stmtBeta.close();
         alphaCon.close();
@@ -170,6 +176,7 @@
 
         Connection alphaCon = openUserConnection(ALPHA);
         Statement stmtAlpha = alphaCon.createStatement();
+        stmtAlpha.executeUpdate("CREATE SEQUENCE alpha_seq");
 
         Connection betaCon = openUserConnection(BETA);
         Statement stmtBeta = betaCon.createStatement();
@@ -177,6 +184,9 @@
         // should implicitly create schema ALPHA
         assertStatementError("42507", stmtBeta, "CREATE SEQUENCE alpha.alpha_seq3");
 
+        // Cleanup:
+        stmtAlpha.executeUpdate("DROP SEQUENCE alpha_seq");
+        
         stmtAlpha.close();
         stmtBeta.close();
         alphaCon.close();



Mime
View raw message