Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 34614 invoked from network); 27 Oct 2006 00:31:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Oct 2006 00:31:48 -0000 Received: (qmail 53405 invoked by uid 500); 27 Oct 2006 00:32:00 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 53345 invoked by uid 500); 27 Oct 2006 00:31: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 53331 invoked by uid 99); 27 Oct 2006 00:31:59 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Oct 2006 17:31:59 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Oct 2006 17:31:47 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 6AF671A9846; Thu, 26 Oct 2006 17:31:26 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r468209 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/tests/jdbcapi/BlobClob4BlobTest.java junit/DatabasePropertyTestSetup.java Date: Fri, 27 Oct 2006 00:31:26 -0000 To: derby-commits@db.apache.org From: djd@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061027003126.6AF671A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: djd Date: Thu Oct 26 17:31:25 2006 New Revision: 468209 URL: http://svn.apache.org/viewvc?view=rev&rev=468209 Log: DERBY-2003 Add a utility method to allow setting the lock timeouts as a decorator building off DatabasePropertyTestSetup. Use this decorator in BlobClob4Blob to reduce the wait time. Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/DatabasePropertyTestSetup.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java?view=diff&rev=468209&r1=468208&r2=468209 ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java Thu Oct 26 17:31:25 2006 @@ -32,6 +32,8 @@ import org.apache.derbyTesting.functionTests.util.streams.LoopingAlphabetReader; import org.apache.derbyTesting.functionTests.util.streams.LoopingAlphabetStream; import org.apache.derbyTesting.junit.BaseJDBCTestCase; +import org.apache.derbyTesting.junit.CleanDatabaseTestSetup; +import org.apache.derbyTesting.junit.DatabasePropertyTestSetup; import junit.framework.*; import java.sql.*; @@ -2758,7 +2760,8 @@ suite.addTest(TestConfiguration.clientServerDecorator( derbynetExclude("BlobClob4BlobTest:client"))); - return suite; + return new CleanDatabaseTestSetup( + DatabasePropertyTestSetup.setLockTimeouts(suite, 2, 4)); } private static Test derbynetExclude(String name) { Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/DatabasePropertyTestSetup.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/DatabasePropertyTestSetup.java?view=diff&rev=468209&r1=468208&r2=468209 ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/DatabasePropertyTestSetup.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/DatabasePropertyTestSetup.java Thu Oct 26 17:31:25 2006 @@ -40,6 +40,38 @@ private Properties newValues; private Properties oldValues; + + /** + * Decorator to change the lock time outs. + * If either time is less than zero then that property is + * not modified by this decorator. + * The change is implemented by an instanceof DatabasePropertyTestSetup + * and thus is reset by the tearDown method. + * + * @param test Test to decorate + * @param deadlockTime Time in seconds for derby.locks.deadlockTimeout. + * @param waitTime Time in seconds for derby.locks.waitTimeout + * @return + */ + public static Test setLockTimeouts(Test test, int deadlockTime, int waitTime) + { + final Properties properties = new Properties(); + if (deadlockTime >= 0) + { + properties.setProperty("derby.locks.deadlockTimeout", + Integer.toString(deadlockTime)); + } + if (waitTime >= 0) { + properties.setProperty("derby.locks.waitTimeout", + Integer.toString(waitTime)); + } + + // No change, no point to the decorator. + if (properties.isEmpty()) + return test; + + return new DatabasePropertyTestSetup(test, properties); + } /** * Create a test decorator that sets and restores the passed