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

Simplify testing (system property to always defragment)

上级 a824013c
...@@ -39,7 +39,6 @@ import org.h2.test.db.TestMultiConn; ...@@ -39,7 +39,6 @@ import org.h2.test.db.TestMultiConn;
import org.h2.test.db.TestMultiDimension; import org.h2.test.db.TestMultiDimension;
import org.h2.test.db.TestMultiThread; import org.h2.test.db.TestMultiThread;
import org.h2.test.db.TestMultiThreadedKernel; import org.h2.test.db.TestMultiThreadedKernel;
import org.h2.test.db.TestNestedJoins;
import org.h2.test.db.TestOpenClose; import org.h2.test.db.TestOpenClose;
import org.h2.test.db.TestOptimizations; import org.h2.test.db.TestOptimizations;
import org.h2.test.db.TestOutOfMemory; import org.h2.test.db.TestOutOfMemory;
...@@ -104,6 +103,8 @@ import org.h2.test.synth.TestKill; ...@@ -104,6 +103,8 @@ import org.h2.test.synth.TestKill;
import org.h2.test.synth.TestKillRestart; import org.h2.test.synth.TestKillRestart;
import org.h2.test.synth.TestKillRestartMulti; import org.h2.test.synth.TestKillRestartMulti;
import org.h2.test.synth.TestMultiThreaded; import org.h2.test.synth.TestMultiThreaded;
import org.h2.test.synth.TestNestedJoins;
import org.h2.test.synth.TestOuterJoins;
import org.h2.test.synth.TestRandomCompare; import org.h2.test.synth.TestRandomCompare;
import org.h2.test.synth.TestRandomSQL; import org.h2.test.synth.TestRandomSQL;
import org.h2.test.synth.TestTimer; import org.h2.test.synth.TestTimer;
...@@ -280,6 +281,11 @@ java org.h2.test.TestAll timer ...@@ -280,6 +281,11 @@ java org.h2.test.TestAll timer
*/ */
boolean stopOnError; boolean stopOnError;
/**
* If the database should always be defragmented when closing.
*/
boolean defrag;
/** /**
* The cache type. * The cache type.
*/ */
...@@ -439,6 +445,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -439,6 +445,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
smallLog = big = networked = memory = ssl = false; smallLog = big = networked = memory = ssl = false;
diskResult = traceSystemOut = diskUndo = false; diskResult = traceSystemOut = diskUndo = false;
mvcc = traceTest = stopOnError = false; mvcc = traceTest = stopOnError = false;
defrag = false;
traceLevelFile = throttle = 0; traceLevelFile = throttle = 0;
cipher = null; cipher = null;
test(); test();
...@@ -464,6 +471,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -464,6 +471,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
throttle = 0; throttle = 0;
cacheType = null; cacheType = null;
cipher = null; cipher = null;
defrag = true;
test(); test();
traceLevelFile = 2; traceLevelFile = 2;
...@@ -471,6 +479,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -471,6 +479,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
smallLog = true; smallLog = true;
networked = true; networked = true;
ssl = true; ssl = true;
defrag = false;
test(); test();
smallLog = false; smallLog = false;
...@@ -532,7 +541,6 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -532,7 +541,6 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
new TestMultiDimension().runTest(this); new TestMultiDimension().runTest(this);
new TestMultiThread().runTest(this); new TestMultiThread().runTest(this);
new TestMultiThreadedKernel().runTest(this); new TestMultiThreadedKernel().runTest(this);
new TestNestedJoins().runTest(this);
new TestOpenClose().runTest(this); new TestOpenClose().runTest(this);
new TestOptimizations().runTest(this); new TestOptimizations().runTest(this);
new TestOutOfMemory().runTest(this); new TestOutOfMemory().runTest(this);
...@@ -604,6 +612,8 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -604,6 +612,8 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
new TestKillRestart().runTest(this); new TestKillRestart().runTest(this);
new TestKillRestartMulti().runTest(this); new TestKillRestartMulti().runTest(this);
new TestMultiThreaded().runTest(this); new TestMultiThreaded().runTest(this);
new TestOuterJoins().runTest(this);
new TestNestedJoins().runTest(this);
afterTest(); afterTest();
} }
...@@ -737,6 +747,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -737,6 +747,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
appendIf(buff, throttle > 0, "throttle:" + throttle); appendIf(buff, throttle > 0, "throttle:" + throttle);
appendIf(buff, traceTest, "traceTest"); appendIf(buff, traceTest, "traceTest");
appendIf(buff, stopOnError, "stopOnError"); appendIf(buff, stopOnError, "stopOnError");
appendIf(buff, defrag, "defrag");
return buff.toString(); return buff.toString();
} }
......
...@@ -107,6 +107,7 @@ public abstract class TestBase { ...@@ -107,6 +107,7 @@ public abstract class TestBase {
public TestBase init(TestAll conf) throws Exception { public TestBase init(TestAll conf) throws Exception {
baseDir = getTestDir(""); baseDir = getTestDir("");
System.setProperty("java.io.tmpdir", TEMP_DIR); System.setProperty("java.io.tmpdir", TEMP_DIR);
SysProperties.defragAlways = conf.defrag;
this.config = conf; this.config = conf;
return this; return this;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论