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 2010/10/27 18:57:02 UTC
svn commit: r1028035 -
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java
Author: kahatlen
Date: Wed Oct 27 16:57:02 2010
New Revision: 1028035
URL: http://svn.apache.org/viewvc?rev=1028035&view=rev
Log:
DERBY-4836: many failures with IBM 1.5 and 1.6 on windows after test InternationalConnectTest
Ensure that the databases are shut down before attempting to delete them.
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java?rev=1028035&r1=1028034&r2=1028035&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java Wed Oct 27 16:57:02 2010
@@ -83,8 +83,9 @@ public class InternationalConnectTest ex
if (isSunJVM() && getSystemProperty("java.version").startsWith("1.4.2")) return;
}
- /* Maximum length in bytes is 255. We subtract 12 for ;create=true */
- int maxNameLength = 255 - 12;
+ // Maximum length in bytes is 255. We subtract 14 to account for
+ // ;create=true and ;shutdown=true
+ int maxNameLength = 255 - 14;
/**
* \u0041 is the letter 'A' (1 byte)
@@ -113,8 +114,10 @@ public class InternationalConnectTest ex
/* Add the database name for cleanup on tearDown() */
databasesForCleanup.add(dbName.toString());
- /* Append one more character to make it fail */
- dbName.append(testCharacters[ch]);
+ /* Append three more characters to make it fail */
+ for (int i = 0; i < 3; i++) {
+ dbName.append(testCharacters[ch]);
+ }
url = TestConfiguration
.getCurrent().getJDBCUrl(dbName.toString()+ ";create=true");
@@ -255,9 +258,6 @@ public class InternationalConnectTest ex
String expected = usingEmbedded() ? "XJ004" : "08004";
assertSQLState(expected, sqle);
}
-
- /* Add the created database for cleanup by tearDown() */
- databasesForCleanup.add("\u4e10");
}
public void tearDown() throws SQLException {
@@ -267,8 +267,10 @@ public class InternationalConnectTest ex
.getJDBCUrl(databasesForCleanup.get(i) + ";shutdown=true");
try {
DriverManager.getConnection(shutdownUrl);
+ fail("Database didn't shut down");
} catch (SQLException se) {
// ignore shutdown exception
+ assertSQLState("08006", se);
}
removeDirectory(getSystemProperty("derby.system.home") + File.separator +
databasesForCleanup.get(i));