From derby-commits-return-14042-apmail-db-derby-commits-archive=db.apache.org@db.apache.org Thu Mar 17 08:52:05 2011 Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 63901 invoked from network); 17 Mar 2011 08:52:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Mar 2011 08:52:05 -0000 Received: (qmail 46309 invoked by uid 500); 17 Mar 2011 08:52:05 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 46264 invoked by uid 500); 17 Mar 2011 08:52:04 -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 46254 invoked by uid 99); 17 Mar 2011 08:52:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Mar 2011 08:52:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Thu, 17 Mar 2011 08:52:04 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5B3742388A56; Thu, 17 Mar 2011 08:51:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1082428 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TruncateTableTest.java Date: Thu, 17 Mar 2011 08:51:40 -0000 To: derby-commits@db.apache.org From: kahatlen@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110317085140.5B3742388A56@eris.apache.org> Author: kahatlen Date: Thu Mar 17 08:51:40 2011 New Revision: 1082428 URL: http://svn.apache.org/viewvc?rev=1082428&view=rev Log: DERBY-5101: TruncateTableTest depends on implicit ordering of test cases Added a workaround for DERBY-5139 so that the test doesn't fail when testSelfReferencing runs first. Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TruncateTableTest.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TruncateTableTest.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TruncateTableTest.java?rev=1082428&r1=1082427&r2=1082428&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TruncateTableTest.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TruncateTableTest.java Thu Mar 17 08:51:40 2011 @@ -164,6 +164,20 @@ public class TruncateTableTest extends B public void testSelfReferencing() throws SQLException { Connection aliceConnection = openUserConnection( ALICE ); Statement s = aliceConnection.createStatement(); + + // Workaround for DERBY-5139: If this test case happens to be running + // first, before the schema ALICE has been created, the CREATE TABLE + // statement below will fail. Normally, CREATE TABLE should create the + // ALICE schema automatically, but for some reason that doesn't happen + // when creating a self-referencing table. Create the schema manually + // for now, if it doesn't already exist. + try { + s.execute("CREATE SCHEMA ALICE"); + } catch (SQLException sqle) { + // It's OK to fail if schema already exists. + assertSQLState("X0Y68", sqle); + } + s.execute("create table self_referencing_t1(x int primary key, " + "y int references self_referencing_t1)"); s.execute("insert into self_referencing_t1 values (1, null), (2, 1)");