提交 c80aac29 authored 作者: Thomas Mueller's avatar Thomas Mueller

delete files after each test

上级 635c9e13
......@@ -284,6 +284,8 @@ java org.h2.test.TestAll timer
split files (1 GB max size)
allocating space gets slower and slower the larger the database.
test trace_level_file=3 performance (when throwing exceptions)
study SQLite file format
multithreaded kernel
......
......@@ -18,6 +18,15 @@ import org.h2.test.TestBase;
*/
public class TestAutoRecompile extends TestBase {
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws SQLException {
deleteDb("autoRecompile");
Connection conn = getConnection("autoRecompile");
......@@ -47,6 +56,7 @@ public class TestAutoRecompile extends TestBase {
assertKnownException(e);
}
conn.close();
deleteDb("autoRecompile");
}
}
......@@ -12,17 +12,28 @@ import java.sql.Statement;
import org.h2.test.TestBase;
import org.h2.tools.Restore;
import org.h2.util.FileUtils;
/**
* Test for the BACKUP SQL statement.
*/
public class TestBackup extends TestBase {
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws SQLException {
if (config.memory || config.logMode == 0) {
return;
}
testBackup();
deleteDb("backup");
}
private void testBackup() throws SQLException {
......@@ -54,6 +65,8 @@ public class TestBackup extends TestBase {
conn1.close();
conn2.close();
conn3.close();
deleteDb("restored");
FileUtils.delete(baseDir + "/backup.zip");
}
}
......@@ -20,6 +20,15 @@ import org.h2.util.MemoryUtils;
*/
public class TestBigDb extends TestBase {
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws SQLException {
if (config.memory) {
return;
......@@ -30,6 +39,7 @@ public class TestBigDb extends TestBase {
testLargeTable();
testInsert();
testLeftSummary();
deleteDb("bigDb");
}
private void testLargeTable() throws SQLException {
......
......@@ -21,6 +21,15 @@ import org.h2.test.TestBase;
*/
public class TestBigResult extends TestBase {
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws SQLException {
if (config.memory) {
return;
......@@ -30,6 +39,7 @@ public class TestBigResult extends TestBase {
testCloseConnectionDelete();
testOrderGroup();
testLimitBufferedResult();
deleteDb("bigResult");
}
private void testLargeSubquery() throws SQLException {
......
......@@ -26,6 +26,15 @@ import org.h2.test.TestBase;
*/
public class TestCases extends TestBase {
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws Exception {
testInvalidDatabaseName();
testReuseSpace();
......@@ -55,6 +64,7 @@ public class TestCases extends TestBase {
testDoubleRecovery();
testConstraintReconnect();
testCollation();
deleteDb("cases");
}
private void testInvalidDatabaseName() throws SQLException {
......
......@@ -17,6 +17,15 @@ import org.h2.test.TestBase;
*/
public class TestCheckpoint extends TestBase {
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws SQLException {
// TODO test checkpoint with rollback, not only just run the command
deleteDb("checkpoint");
......@@ -42,6 +51,7 @@ public class TestCheckpoint extends TestBase {
c0.close();
c1.close();
deleteDb("checkpoint");
}
}
......@@ -23,13 +23,20 @@ import org.h2.tools.Server;
*/
public class TestCluster extends TestBase {
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws SQLException {
if (config.memory || config.networked) {
return;
}
DeleteDbFiles.main(new String[] { "-dir", baseDir + "/node1", "-quiet" });
DeleteDbFiles.main(new String[] { "-dir", baseDir + "/node2", "-quiet" });
deleteFiles();
// create the master database
Connection conn;
......@@ -122,6 +129,12 @@ public class TestCluster extends TestBase {
conn.createStatement().execute("SELECT * FROM A");
conn.close();
n2.stop();
deleteFiles();
}
private void deleteFiles() throws SQLException {
DeleteDbFiles.main(new String[] { "-dir", baseDir + "/node1", "-quiet" });
DeleteDbFiles.main(new String[] { "-dir", baseDir + "/node2", "-quiet" });
}
private void check(Connection conn, int len) throws SQLException {
......
......@@ -43,7 +43,7 @@ public class TestCompatibility extends TestBase {
testMySQL();
conn.close();
deleteDb("compatibility");
}
private void testColumnAlias() throws SQLException {
......
......@@ -33,6 +33,15 @@ import org.h2.util.StringUtils;
*/
public class TestCsv extends TestBase {
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws Exception {
testSpaceSeparated();
testNull();
......@@ -43,6 +52,7 @@ public class TestCsv extends TestBase {
testWriteRead();
testRead();
testPipe();
deleteDb("csv");
}
private void testSpaceSeparated() throws SQLException {
......@@ -138,6 +148,7 @@ public class TestCsv extends TestBase {
}
assertFalse(rs.next());
conn.close();
FileUtils.delete(baseDir + "/test.csv");
}
private String randomData(Random random) {
......@@ -173,6 +184,7 @@ public class TestCsv extends TestBase {
assertEquals(rs.getString(2), "Hello");
assertFalse(rs.next());
conn.close();
FileUtils.delete(baseDir + "/test.csv");
}
private void testFieldDelimiter() throws Exception {
......@@ -203,6 +215,8 @@ public class TestCsv extends TestBase {
assertEquals(rs.getString(2), "\nHello*\n");
assertFalse(rs.next());
conn.close();
FileUtils.delete(baseDir + "/test.csv");
FileUtils.delete(baseDir + "/test2.csv");
}
private void testPipe() throws SQLException {
......@@ -225,6 +239,7 @@ public class TestCsv extends TestBase {
// rs = prep.executeQuery();
conn.close();
FileUtils.delete(baseDir + "/test.csv");
}
private void testAsTable() throws SQLException {
......@@ -287,6 +302,7 @@ public class TestCsv extends TestBase {
// 201,2,0,18
// 201,2,0,18
// 201,2,0,18
FileUtils.delete(baseDir + "/test.csv");
}
private void testWriteRead() throws SQLException {
......@@ -313,7 +329,7 @@ public class TestCsv extends TestBase {
assertFalse(rs.next());
rs.close();
conn.close();
FileUtils.delete(baseDir + "/testRW.csv");
}
}
......@@ -33,13 +33,22 @@ public class TestDeadlock extends TestBase {
Connection c3;
private volatile SQLException lastException;
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws Exception {
deleteDb("deadlock");
testDiningPhilosophers();
testLockUpgrade();
testThreePhilosophers();
testNoDeadlock();
deleteDb("deadlock");
}
private void initTest() throws SQLException {
......
......@@ -18,6 +18,15 @@ import org.h2.test.TestBase;
*/
public class TestEncryptedDb extends TestBase {
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws SQLException {
if (config.memory || config.cipher != null) {
return;
......@@ -51,6 +60,7 @@ public class TestEncryptedDb extends TestBase {
assertFalse(rs.next());
conn.close();
deleteDb("exclusive");
}
}
......@@ -17,6 +17,15 @@ import org.h2.test.TestBase;
*/
public class TestExclusive extends TestBase {
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws Exception {
deleteDb("exclusive");
Connection conn = getConnection("exclusive");
......@@ -64,7 +73,7 @@ public class TestExclusive extends TestBase {
// check that exclusive mode is off when disconnected
stat2.execute("select * from dual");
conn2.close();
deleteDb("exclusive");
}
}
......@@ -54,7 +54,8 @@ public class TestFullText extends TestBase {
println("Class not found, not tested: " + luceneFullTextClassName);
// ok
}
deleteDb("fullText");
deleteDb("fullTextReopen");
}
private void testCreateDrop() throws SQLException {
......
......@@ -25,8 +25,17 @@ public class TestFunctionOverload extends TestBase {
private Connection conn;
private DatabaseMetaData meta;
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws SQLException {
this.deleteDb("functionOverload");
deleteDb("functionOverload");
conn = getConnection("functionOverload");
meta = conn.getMetaData();
testControl();
......@@ -35,6 +44,7 @@ public class TestFunctionOverload extends TestBase {
testOverloadWithConnection();
testOverloadError();
conn.close();
deleteDb("functionOverload");
}
private void testOverloadError() throws SQLException {
......
......@@ -32,11 +32,21 @@ import org.h2.util.IOUtils;
*/
public class TestFunctions extends TestBase {
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws Exception {
testVarArgs();
testAggregate();
testFunctions();
testFileRead();
deleteDb("functions");
}
private void testVarArgs() throws SQLException {
......
......@@ -69,6 +69,7 @@ public class TestIndex extends TestBase {
testMultiColumnHashIndex();
conn.close();
deleteDb("index");
}
private void testHashIndex() throws SQLException {
......
......@@ -43,6 +43,7 @@ public class TestLinkedTable extends TestBase {
testLinkEmitUpdates();
testLinkTable();
testLinkTwoTables();
deleteDb("linkedTable");
}
// this is not a bug, it is the documented behavior
......
......@@ -48,7 +48,7 @@ public class TestListener extends TestBase implements DatabaseEventListener {
conn = getConnection("listener;database_event_listener='" + getClass().getName() + "'");
conn.close();
deleteDb("listener");
}
public void diskSpaceIsLow(long stillAvailable) {
......
......@@ -71,6 +71,7 @@ public class TestLob extends TestBase {
testLob(false);
testLob(true);
testJavaObject();
deleteDb("lob");
}
private void testLobDeleteTemp() throws SQLException {
......
......@@ -25,6 +25,15 @@ public class TestLogFile extends TestBase {
private static final int MAX_LOG_SIZE = 1;
private Connection conn;
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
private long reconnect(int maxFiles) throws SQLException {
if (conn != null) {
conn.close();
......@@ -64,6 +73,7 @@ public class TestLogFile extends TestBase {
} finally {
System.setProperty(SysProperties.H2_LOG_DELETE_DELAY, "" + old);
}
deleteDb("logfile");
}
private void checkLogSize() throws SQLException {
......
......@@ -45,6 +45,7 @@ public class TestMemoryUsage extends TestBase {
reconnect();
insertUpdateSelectDelete();
conn.close();
deleteDb("memoryUsage");
}
private void testCreateDropLoop() throws SQLException {
......
......@@ -21,11 +21,21 @@ public class TestMultiConn extends TestBase implements DatabaseEventListener {
private static int wait;
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws Exception {
testConcurrentShutdownQuery();
testCommitRollback();
testConcurrentOpen();
testThreeThreads();
deleteDb("multiConn");
}
private void testConcurrentShutdownQuery() throws Exception {
......@@ -53,6 +63,11 @@ public class TestMultiConn extends TestBase implements DatabaseEventListener {
Thread.sleep(50);
stat1.execute("SHUTDOWN");
conn1.close();
try {
conn2.close();
} catch (SQLException e) {
// ignore
}
}
private void testThreeThreads() throws Exception {
......
......@@ -130,6 +130,7 @@ public class TestMultiDimension extends TestBase {
// trace("t1="+time1+" t2="+time2+" size="+size);
}
conn.close();
deleteDb("multiDimension");
}
/**
......
......@@ -16,6 +16,7 @@ import java.sql.Statement;
import org.h2.api.DatabaseEventListener;
import org.h2.test.TestBase;
import org.h2.tools.Restore;
import org.h2.util.FileUtils;
/**
* Tests opening and closing a database.
......@@ -30,6 +31,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
testBackup(true);
testCase();
testReconnectFast();
deleteDb("openClose");
}
private void testCloseDelay() throws Exception {
......@@ -72,6 +74,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
assertEquals(rs.getString(1).length(), 10000);
assertFalse(rs.next());
conn.close();
FileUtils.delete(baseDir + "/test.zip");
}
private void testReconnectFast() throws SQLException {
......
......@@ -53,6 +53,7 @@ public class TestOptimizations extends TestBase {
testIn();
testMinMaxCountOptimization(true);
testMinMaxCountOptimization(false);
deleteDb("optimizations");
}
private void testInSelectJoin() throws SQLException {
......
......@@ -63,6 +63,7 @@ public class TestOutOfMemory extends TestBase {
} finally {
conn.close();
}
deleteDb("outOfMemory");
}
private void eatMemory(int remainingKB) {
......
......@@ -33,6 +33,15 @@ public class TestPowerOff extends TestBase {
private int maxPowerOffCount;
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws SQLException {
if (config.memory || config.logMode == 0) {
return;
......@@ -49,6 +58,7 @@ public class TestPowerOff extends TestBase {
testNoIndexFile();
testMemoryTables();
testPersistentTables();
deleteDb(dir, dbName);
}
private void testSummaryCrash() throws SQLException {
......
......@@ -32,6 +32,7 @@ public class TestReadOnly extends TestBase {
if (!config.deleteIndex) {
testReadOnlyFiles(false);
}
deleteDb("readonly");
}
private void testReadOnlyDbCreate() throws SQLException {
......
......@@ -13,6 +13,7 @@ import java.sql.SQLException;
import java.sql.Statement;
import org.h2.test.TestBase;
import org.h2.util.FileUtils;
/**
* Access rights tests.
......@@ -26,6 +27,7 @@ public class TestRights extends TestBase {
// testLowerCaseUser();
testSchemaRenameUser();
testAccessRights();
deleteDb("rights");
}
// public void testLowerCaseUser() throws SQLException {
......@@ -234,6 +236,7 @@ public class TestRights extends TestBase {
conn.close();
conn = getConnection("rights");
conn.close();
FileUtils.delete(baseDir + "/rights.sql");
}
private void testTableType(Connection conn, String type) throws SQLException {
......
......@@ -12,6 +12,7 @@ import java.sql.Statement;
import org.h2.api.Trigger;
import org.h2.test.TestBase;
import org.h2.util.FileUtils;
/**
* Tests the RUNSCRIPT SQL statement.
......@@ -21,6 +22,7 @@ public class TestRunscript extends TestBase implements Trigger {
public void test() throws SQLException {
test(false);
test(true);
deleteDb("runscript");
}
/**
......@@ -89,6 +91,10 @@ public class TestRunscript extends TestBase implements Trigger {
conn1.close();
conn2.close();
deleteDb("runscriptRestore");
FileUtils.delete(baseDir + "/backup.2.sql");
FileUtils.delete(baseDir + "/backup.3.sql");
}
public void init(Connection conn, String schemaName, String triggerName, String tableName, boolean before, int type) {
......
......@@ -81,6 +81,7 @@ public class TestSQLInjection extends TestBase {
assertTrue(checkPasswordSecure("123456"));
assertFalse(checkPasswordSecure("' OR ''='"));
conn.close();
deleteDb("sqlInjection");
}
private boolean checkPasswordInsecure(String pwd) throws SQLException {
......
......@@ -81,6 +81,7 @@ public class TestScript extends TestBase {
testScript();
}
}
deleteDb("script");
}
private void testScript() throws Exception {
......
......@@ -24,6 +24,15 @@ public class TestScriptSimple extends TestBase {
private Connection conn;
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws Exception {
if (config.memory || config.big || config.networked) {
return;
......@@ -62,6 +71,7 @@ public class TestScriptSimple extends TestBase {
}
is.close();
conn.close();
deleteDb("scriptSimple");
}
private void reconnect() throws SQLException {
......
......@@ -23,6 +23,7 @@ public class TestSequence extends TestBase {
testAlterSequence();
testCache();
testTwo();
deleteDb("sequence");
}
private void testAlterSequenceColumn() throws SQLException {
......
......@@ -24,6 +24,7 @@ public class TestSessionsLocks extends TestBase {
}
testCancelStatement();
testLocks();
deleteDb("sessionsLocks");
}
private void testLocks() throws SQLException {
......
......@@ -41,6 +41,7 @@ public class TestSpaceReuse extends TestBase {
if (now > first) {
fail("first: " + first + " now: " + now);
}
deleteDb("spaceReuse");
}
}
......@@ -156,6 +156,7 @@ public class TestSpeed extends TestBase {
conn.close();
time = System.currentTimeMillis() - time;
trace(time + " close");
deleteDb("speed");
}
// private void testOuterJoin() throws SQLException {
......
......@@ -35,6 +35,7 @@ public class TestTempTables extends TestBase {
testIndexes(c1, c2);
c1.close();
c2.close();
deleteDb("tempTables");
}
private void testIndexes(Connection conn1, Connection conn2) throws SQLException {
......
......@@ -28,6 +28,7 @@ public class TestTransaction extends TestBase {
testReferential();
testSavepoint();
testIsolation();
deleteDb("transaction");
}
private void testSetTransaction() throws SQLException {
......
......@@ -30,6 +30,7 @@ public class TestTriggersConstraints extends TestBase implements Trigger {
testTriggerAlterTable();
testTriggers();
testConstraints();
deleteDb("trigger");
}
/**
......
......@@ -32,6 +32,7 @@ public class TestTwoPhaseCommit extends TestBase {
prepare();
openWith(false);
test(false);
deleteDb("twoPhaseCommit");
}
private void test(boolean rolledBack) throws SQLException {
......
......@@ -21,6 +21,7 @@ public class TestView extends TestBase {
public void test() throws SQLException {
testUnionReconnect();
testManyViews();
deleteDb("view");
}
private void testUnionReconnect() throws SQLException {
......
......@@ -47,6 +47,7 @@ public class TestBatchUpdates extends TestBase {
testExecuteCall();
testException();
testCoffee();
deleteDb("batchUpdates");
}
private void testExecuteCall() throws SQLException {
......
......@@ -24,6 +24,7 @@ public class TestCallableStatement extends TestBase {
Connection conn = getConnection("preparedStatement");
testPrepare(conn);
conn.close();
deleteDb("callableStatement");
}
private void testPrepare(Connection conn) throws SQLException {
......
......@@ -24,6 +24,15 @@ public class TestCancel extends TestBase {
private static int lastVisited;
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
/**
* This thread cancels a statement after some time.
*/
......@@ -66,6 +75,7 @@ public class TestCancel extends TestBase {
testQueryTimeout();
testJdbcQueryTimeout();
testCancelStatement();
deleteDb("cancel");
}
private void testReset() throws SQLException {
......
......@@ -26,6 +26,7 @@ public class TestDatabaseEventListener extends TestBase implements DatabaseEvent
testCalled();
testCloseLog0(false);
testCloseLog0(true);
deleteDb("databaseEventListener");
}
private void testCloseLog0(boolean shutdown) throws SQLException {
......
......@@ -21,10 +21,20 @@ import org.h2.test.TestBase;
*/
public class TestManyJdbcObjects extends TestBase {
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() throws SQLException {
testNestedResultSets();
testManyConnections();
testOneConnectionPrepare();
deleteDb("manyObjects");
}
private void testNestedResultSets() throws SQLException {
......
......@@ -207,6 +207,7 @@ public class TestMetaData extends TestBase {
conn.close();
testTempTable();
deleteDb("metaData");
}
......
......@@ -64,6 +64,7 @@ public class TestNativeSQL extends TestBase {
testQuotes();
conn.close();
assertTrue(conn.isClosed());
deleteDb("nativeSql");
}
private void testQuotes() throws SQLException {
......
......@@ -60,6 +60,7 @@ public class TestPreparedStatement extends TestBase {
testClob(conn);
testParameterMetaData(conn);
conn.close();
deleteDb("preparedStatement");
}
private void testLobTempFiles(Connection conn) throws SQLException {
......
......@@ -78,6 +78,7 @@ public class TestResultSet extends TestBase {
testAutoIncrement();
conn.close();
deleteDb("resultSet");
}
......
......@@ -46,6 +46,7 @@ public class TestStatement extends TestBase {
testIdentity();
}
conn.close();
deleteDb("statement");
}
private void testTraceError() throws SQLException {
......
......@@ -92,6 +92,7 @@ public class TestTransactionIsolation extends TestBase {
conn1.close();
conn2.close();
deleteDb("transactionIsolation");
}
}
......@@ -33,6 +33,7 @@ public class TestUpdatableResultSet extends TestBase {
testUpdateDeleteInsert();
testUpdateDataType();
testUpdateResetRead();
deleteDb("updatableResultSet");
}
private void testUpdateLob() throws SQLException {
......
......@@ -23,6 +23,7 @@ public class TestZloty extends TestBase {
public void test() throws SQLException {
testZloty();
testModifyBytes();
deleteDb("zloty");
}
/**
......
......@@ -23,6 +23,7 @@ public class TestConnectionPool extends TestBase {
deleteDb("connectionPool");
testConnect();
testThreads();
deleteDb("connectionPool");
}
private void testThreads() throws Exception {
......
......@@ -51,6 +51,7 @@ public class TestDataSource extends TestBase {
public void test() throws Exception {
testDataSource();
testXAConnection();
deleteDb(baseDir, "dataSource");
}
private void testXAConnection() throws Exception {
......
......@@ -34,6 +34,9 @@ public class TestXA extends TestBase {
deleteDb(baseDir, DB_NAME1);
deleteDb(baseDir, DB_NAME2);
testXA(false);
deleteDb(baseDir, "xa");
deleteDb(baseDir, DB_NAME1);
deleteDb(baseDir, DB_NAME2);
}
/**
......
......@@ -26,6 +26,7 @@ public class TestMvcc1 extends TestBase {
public void test() throws SQLException {
testSetMode();
testCases();
deleteDb("mvcc1");
}
private void testSetMode() throws SQLException {
......
......@@ -29,6 +29,7 @@ public class TestMvcc2 extends TestBase {
deleteDb("mvcc2");
testInsertUpdateRollback();
testInsertRollback();
deleteDb("mvcc2");
}
private Connection getConnection() throws SQLException {
......
......@@ -23,6 +23,7 @@ public class TestMvcc3 extends TestBase {
testSequence();
testDisableAutoCommit();
testRollback();
deleteDb("mvcc3");
}
private void testCreateTableAsSelect() throws SQLException {
......
......@@ -64,6 +64,7 @@ public class TestMvccMultiThreaded extends TestBase {
for (int i = 0; i < len; i++) {
connList[i].close();
}
deleteDb("mvccMultiThreaded");
}
}
......@@ -37,6 +37,7 @@ public class TestRowLocks extends TestBase {
public void test() throws Exception {
testSetMode();
testCases();
deleteDb("rowLocks");
}
private void testSetMode() throws SQLException {
......
......@@ -56,6 +56,7 @@ public class TestAutoReconnect extends TestBase implements DatabaseEventListener
public void test() throws Exception {
testReconnect(true);
testReconnect(false);
deleteDb("autoReconnect");
}
private void testReconnect(boolean autoServer) throws Exception {
......
......@@ -71,6 +71,7 @@ public class TestAutoServer extends TestBase {
}
conn.close();
connServer.close();
deleteDb("autoServer");
}
/**
......
......@@ -61,7 +61,7 @@ public class TestNestedLoop extends TestBase {
}
}
conn.close();
deleteDb("nestedLoop");
}
}
......@@ -44,6 +44,7 @@ public class TestPgServer extends TestBase {
} finally {
server.stop();
}
deleteDb("test");
}
private void testPgClient() throws SQLException {
......
......@@ -39,6 +39,7 @@ public class TestFuzzOptimizations extends TestBase {
testGroupSorted();
testInSelect();
conn.close();
deleteDb("optimizations");
}
private void testInSelect() throws SQLException {
......
......@@ -64,6 +64,7 @@ public class TestKillRestart extends TestBase {
}
}
}
deleteDb("killRestart");
}
/**
......
......@@ -114,6 +114,7 @@ public class TestKillRestartMulti extends TestBase {
throw e;
}
}
deleteDb("killRestartMulti");
}
/**
......
......@@ -169,6 +169,7 @@ public class TestMultiThreaded extends TestBase {
for (int i = 0; i < size; i++) {
connList[i].close();
}
deleteDb("multiThreaded");
}
}
......@@ -176,6 +176,11 @@ public class TestRandomSQL extends TestBase {
}
testWithSeed(bnf);
SysProperties.scriptDirectory = old;
try {
deleteDb();
} catch (SQLException e) {
processException("deleteDb", e);
}
}
public void test() throws SQLException {
......
......@@ -53,6 +53,7 @@ public class TestCache extends TestBase {
}
}
conn.close();
deleteDb("cache");
}
}
......@@ -72,6 +72,8 @@ public class TestDate extends TestBase {
TimeZone.setDefault(defaultTimeZone);
DateTimeUtils.resetCalendar();
}
conn.close();
deleteDb("date");
}
private void test(PreparedStatement prep, int d) throws SQLException {
......
......@@ -63,6 +63,7 @@ public class TestExit extends TestBase implements DatabaseEventListener {
if (getClosedFile().exists()) {
fail("closed database");
}
deleteDb("exit");
}
/**
......
......@@ -47,6 +47,7 @@ public class TestMultiThreadedKernel extends TestBase implements Runnable {
for (int i = 0; i < count; i++) {
list[i].join();
}
deleteDb("multiThreadedKernel");
}
public void run() {
......
......@@ -39,6 +39,7 @@ public class TestRecovery extends TestBase {
// Recover.execute("data", null);
Connection conn = DriverManager.getConnection(url, "sa", "sa");
conn.close();
DeleteDbFiles.execute(baseDir, "recovery", true);
}
}
......@@ -25,6 +25,7 @@ public class TestSampleApps extends TestBase {
String url = "jdbc:h2:" + baseDir + "/optimizations";
testApp(org.h2.tools.RunScript.class, new String[] { "-url", url, "-user", "sa", "-password", "sa", "-script",
"src/test/org/h2/samples/optimizations.sql", "-checkResults" }, "");
deleteDb("optimizations");
testApp(org.h2.samples.Compact.class, null, "Compacting...\nDone.");
testApp(org.h2.samples.CsvSample.class, null, "NAME: Bob Meier\n" + "EMAIL: bob.meier@abcde.abc\n"
......
......@@ -67,6 +67,7 @@ public class TestTools extends TestBase {
testScriptRunscript();
testBackupRestore();
testRecover();
deleteDb("utils");
}
private void testServerMain() throws SQLException {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论