Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 14382 invoked from network); 27 Oct 2010 16:58:00 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Oct 2010 16:58:00 -0000 Received: (qmail 32422 invoked by uid 500); 27 Oct 2010 16:58:00 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 32371 invoked by uid 500); 27 Oct 2010 16:57:59 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 32364 invoked by uid 99); 27 Oct 2010 16:57:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Oct 2010 16:57:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Oct 2010 16:57:59 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EBC1423888EC; Wed, 27 Oct 2010 16:57:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1028035 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java Date: Wed, 27 Oct 2010 16:57:02 -0000 To: derby-commits@db.apache.org From: kahatlen@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101027165702.EBC1423888EC@eris.apache.org> 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));