提交 8c29fb53 authored 作者: Thomas Mueller's avatar Thomas Mueller

Java 8 compatibility for tests

上级 e0b3be30
.classpath
.project
bin
data
docs
ext
error.*
......
......@@ -372,6 +372,8 @@ java org.h2.test.TestAll timer
private Server server;
private boolean fast;
/**
* Run all tests.
*
......@@ -436,7 +438,10 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
*/
TestAll test = new TestAll();
if (args.length > 0) {
if ("reopen".equals(args[0])) {
if ("fast".equals(args[0])) {
test.fast = true;
test.testAll();
} else if ("reopen".equals(args[0])) {
System.setProperty("h2.delayWrongPasswordMin", "0");
System.setProperty("h2.check2", "false");
System.setProperty("h2.analyzeAuto", "100");
......@@ -476,20 +481,24 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
new TestTimer().runTest(test);
}
} else {
test.runTests();
Profiler prof = new Profiler();
prof.depth = 16;
prof.interval = 1;
prof.startCollecting();
TestPerformance.main("-init", "-db", "1", "-size", "1000");
prof.stopCollecting();
System.out.println(prof.getTop(5));
TestPerformance.main("-init", "-db", "1", "-size", "1000");
test.testAll();
}
System.out.println(TestBase.formatTime(
System.currentTimeMillis() - time) + " total");
}
private void testAll() throws Exception {
runTests();
Profiler prof = new Profiler();
prof.depth = 16;
prof.interval = 1;
prof.startCollecting();
TestPerformance.main("-init", "-db", "1", "-size", "1000");
prof.stopCollecting();
System.out.println(prof.getTop(5));
TestPerformance.main("-init", "-db", "1", "-size", "1000");
}
/**
* Run all tests in all possible combinations.
*/
......@@ -564,17 +573,21 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
traceLevelFile = 0;
smallLog = true;
networked = true;
ssl = true;
if (!fast) {
ssl = true;
}
defrag = false;
test();
big = true;
smallLog = false;
networked = false;
ssl = false;
traceLevelFile = 0;
test();
testUnit();
if (!fast) {
big = true;
smallLog = false;
networked = false;
ssl = false;
traceLevelFile = 0;
test();
testUnit();
}
big = false;
cipher = "AES";
......@@ -892,6 +905,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
@Override
public String toString() {
StringBuilder buff = new StringBuilder();
appendIf(buff, fast, "fast");
appendIf(buff, mvStore, "mvStore");
appendIf(buff, big, "big");
appendIf(buff, networked, "net");
......
......@@ -307,7 +307,7 @@ public class TestPageStore extends TestBase {
stat.execute("select nextval('SEQ') from system_range(1, 100000)");
long after = System.currentTimeMillis();
// it's hard to test - basically it shouldn't checkpoint too often
if (after - before > 10000) {
if (after - before > 20000) {
if (!config.reopen) {
fail("Checkpoint took " + (after - before) + " ms");
}
......
......@@ -354,6 +354,12 @@ public class TestTools extends TestBase {
continue;
}
int len = m.getParameterTypes().length;
if (m.getName().equals("updateObject") && m.getParameterTypes().length > 2) {
Class<?> p3 = m.getParameterTypes()[2];
if (p3.toString().indexOf("SQLType") >= 0) {
continue;
}
}
Object[] params = new Object[len];
int i = 0;
String expectedValue = null;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论