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

Java 8 compatibility for tests

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