db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrn...@apache.org
Subject svn commit: r555441 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
Date Thu, 12 Jul 2007 00:00:32 GMT
Author: myrnavl
Date: Wed Jul 11 17:00:31 2007
New Revision: 555441

URL: http://svn.apache.org/viewvc?view=rev&rev=555441
Log:
DERBY-2915 - make test NoConnetionAfterHardUpgrade accept XSLAP or XSLAN errors.

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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java?view=diff&rev=555441&r1=555440&r2=555441
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
Wed Jul 11 17:00:31 2007
@@ -25,6 +25,8 @@
 import java.sql.SQLException;
 import java.sql.Statement;
 
+import org.apache.derby.iapi.services.io.DerbyIOException;
+
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
@@ -139,9 +141,12 @@
             try {
                     getConnection();
                 } catch (SQLException e) {
-                    // Other SQL states might be valid,
-                    // once the beta flag is dropped.
-                    assertSQLState("XSLAP", e);
+                    // Check the innermost of the nested exceptions
+                    SQLException sqle = getLastSQLException(e);
+                    String sqlState = sqle.getSQLState();
+                	// while beta, XSLAP is expected, if not beta, XSLAN
+                	if (!(sqlState.equals("XSLAP")) && !(sqlState.equals("XSLAN")))
+                		fail("expected an error indicating no connection");
                 }
             break;
         }



Mime
View raw message