Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 76987 invoked from network); 17 Feb 2011 21:00:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Feb 2011 21:00:31 -0000 Received: (qmail 52946 invoked by uid 500); 17 Feb 2011 21:00:31 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 52882 invoked by uid 500); 17 Feb 2011 21:00:30 -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 52875 invoked by uid 99); 17 Feb 2011 21:00:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Feb 2011 21:00:30 +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 Feb 2011 21:00:28 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 80FFA2388A40; Thu, 17 Feb 2011 21:00:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1071783 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java Date: Thu, 17 Feb 2011 21:00:07 -0000 To: derby-commits@db.apache.org From: kristwaa@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110217210007.80FFA2388A40@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kristwaa Date: Thu Feb 17 21:00:07 2011 New Revision: 1071783 URL: http://svn.apache.org/viewvc?rev=1071783&view=rev Log: DERBY-5040: On Windows, cascade of errors after failed test AutomaticIndexStatisticsTest Rewrote failing test (deleting the database directory fails) to use a separate database instead of the default db wombat. This should eliminate the cascade of errors. Patch file: derby-5040-1a-use_separate_db.diff Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java?rev=1071783&r1=1071782&r2=1071783&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java Thu Feb 17 21:00:07 2011 @@ -104,21 +104,28 @@ public class AutomaticIndexStatisticsTes */ public void testStatsCreatedOnGrowthThenDeleteDb() throws SQLException { + String db = "singleUse/newCleanDb"; + DataSource ds = JDBCDataSource.getDataSource(); + JDBCDataSource.setBeanProperty(ds, "databaseName", db); + JDBCDataSource.setBeanProperty(ds, "createDatabase", "create"); + Connection con = ds.getConnection(); String TAB = "TEST_GROWTH_EMPTY"; - createAndInsertSimple(TAB, 300); + createAndInsertSimple(con, TAB, 300); // This should trigger creation of statistics. - prepareStatement("select * from " + TAB + " where id = ?"); + PreparedStatement ps = con.prepareStatement( + "select * from " + TAB + " where id = ?"); + ps.close(); // Get statistics - IdxStats[] myStats = stats.getStatsTable(TAB, 1); + IdxStats[] myStats = new IndexStatsUtil( + ds.getConnection(), DEFAULT_TIMEOUT).getStatsTable(TAB, 1); assertEquals(1, myStats.length); assertTrue(myStats[0].rows == 300); assertTrue(myStats[0].card == 300); // Shutdown database and try to delete it. - TestConfiguration.getCurrent().shutdownDatabase(); - assertDirectoryDeleted(constructDbPath( - getTestConfiguration().getDefaultDatabaseName())); + JDBCDataSource.shutdownDatabase(ds); + assertDirectoryDeleted(constructDbPath(db)); } /** Make sure stats are updated when the table grows. */