db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1471268 - in /db/derby/code/branches/10.9: ./ java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java
Date Wed, 24 Apr 2013 07:23:59 GMT
Author: kahatlen
Date: Wed Apr 24 07:23:59 2013
New Revision: 1471268

URL: http://svn.apache.org/r1471268
Log:
DERBY-6193: AutomaticIndexStatisticsTest doesn't delete its single-use database

Merged revision 1471264 from trunk.

Modified:
    db/derby/code/branches/10.9/   (props changed)
    db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java

Propchange: db/derby/code/branches/10.9/
------------------------------------------------------------------------------
  Merged /db/derby/code/trunk:r1471264

Modified: db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java?rev=1471268&r1=1471267&r2=1471268&view=diff
==============================================================================
--- db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java
(original)
+++ db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java
Wed Apr 24 07:23:59 2013
@@ -39,6 +39,7 @@ import junit.framework.TestSuite;
 
 import org.apache.derbyTesting.functionTests.util.PrivilegedFileOpsForTests;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.CleanDatabaseTestSetup;
 import org.apache.derbyTesting.junit.IndexStatsUtil;
 import org.apache.derbyTesting.junit.IndexStatsUtil.IdxStats;
 import org.apache.derbyTesting.junit.JDBC;
@@ -75,15 +76,16 @@ public class AutomaticIndexStatisticsTes
     }
 
     public static Test suite() {
-        TestSuite suite = new TestSuite(AutomaticIndexStatisticsTest.class);
+        Test test = new TestSuite(AutomaticIndexStatisticsTest.class);
+        test = new CleanDatabaseTestSetup(test);
+        test = TestConfiguration.additionalDatabaseDecorator(test, MASTERDB);
+
         // DERBY-5964: The test needs to check the timestamp stored in
         // SYSSTATISTICS, which is in the local timezone. Since those
         // timestamps may be ambiguous around the transition to or from DST,
         // run this test in a timezone that doesn't observe DST. The
         // TimeZoneTestSetup can probably be removed once DERBY-5974 is fixed.
-        return new TimeZoneTestSetup(
-                TestConfiguration.additionalDatabaseDecorator(suite, MASTERDB),
-                "GMT");
+        return new TimeZoneTestSetup(test, "GMT");
     }
 
     /** Initialize the default statistics helper object. */
@@ -240,7 +242,7 @@ public class AutomaticIndexStatisticsTes
 
     /**
      * Tests that compressing the table while scanned makes the daemon fail
-     * gracefully, and that the daemon can do other work afterwords.
+     * gracefully, and that the daemon can do other work afterwards.
      */
     public void testCompressWhileScanning()
             throws IOException, SQLException {
@@ -277,6 +279,10 @@ public class AutomaticIndexStatisticsTes
         con.prepareStatement("select * from " + TAB2 + " where id = ?");
         myStats.assertTableStats(TAB2, 1);
         myStats.release();
+
+        // Shutdown database and try to delete it.
+        JDBCDataSource.shutdownDatabase(ds);
+        assertDirectoryDeleted(constructDbPath(db));
     }
 
     /**



Mime
View raw message