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 my...@apache.org on 2007/07/12 02:00:32 UTC
svn commit: r555441 -
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
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;
}