提交 803d227b authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 be7d675f
...@@ -162,6 +162,8 @@ java org.h2.test.TestAll timer ...@@ -162,6 +162,8 @@ java org.h2.test.TestAll timer
improve javadocs improve javadocs
write complete page right after checkpoint
upload jazoon upload jazoon
test case for out of memory (try to corrupt the database using out of memory) test case for out of memory (try to corrupt the database using out of memory)
......
...@@ -32,16 +32,24 @@ public class Build extends BuildBase { ...@@ -32,16 +32,24 @@ public class Build extends BuildBase {
download("ext/derby-10.4.1.3.jar", download("ext/derby-10.4.1.3.jar",
"http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.1.3/derby-10.4.1.3.jar", "http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.1.3/derby-10.4.1.3.jar",
"01c19aaea2e971203f410c5263214a890f340342"); "01c19aaea2e971203f410c5263214a890f340342");
download("ext/postgresql-8.3-603.jdbc4.jar", download("ext/derbyclient-10.4.1.3.jar",
"http://repo1.maven.org/maven2/postgresql/postgresql/8.3-603.jdbc4/postgresql-8.3-603.jdbc4.jar", "http://repo1.maven.org/maven2/org/apache/derby/derbyclient/10.4.1.3/derbyclient-10.4.1.3.jar",
"c1545d956cc2013e8623f7cbc4de320be80ac646"); "14e97efccae4d622dfcc65bf1f042588c7bd4cb3");
download("ext/derbynet-10.4.1.3.jar",
"http://repo1.maven.org/maven2/org/apache/derby/derbynet/10.4.1.3/derbynet-10.4.1.3.jar",
"cdf87901e6dfa25c7bc7fa509731bbca04b46191");
download("ext/postgresql-8.3-603.jdbc3.jar",
"http://repo1.maven.org/maven2/postgresql/postgresql/8.3-603.jdbc3/postgresql-8.3-603.jdbc3.jar",
"33d531c3c53055ddcbea3d88bfa093466ffef924");
download("ext/mysql-connector-java-5.1.6.jar", download("ext/mysql-connector-java-5.1.6.jar",
"http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.6/mysql-connector-java-5.1.6.jar", "http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.6/mysql-connector-java-5.1.6.jar",
"380ef5226de2c85ff3b38cbfefeea881c5fce09d"); "380ef5226de2c85ff3b38cbfefeea881c5fce09d");
String cp = "bin" + File.pathSeparator + "bin/h2.jar" + File.pathSeparator + String cp = "bin" + File.pathSeparator + "bin/h2.jar" + File.pathSeparator +
"ext/hsqldb-1.8.0.7.jar" + File.pathSeparator + "ext/hsqldb-1.8.0.7.jar" + File.pathSeparator +
"ext/derby-10.4.1.3.jar" + File.pathSeparator + "ext/derby-10.4.1.3.jar" + File.pathSeparator +
"ext/postgresql-8.3-603.jdbc4.jar" + File.pathSeparator + "ext/derbyclient-10.4.1.3.jar" + File.pathSeparator +
"ext/derbynet-10.4.1.3.jar" + File.pathSeparator +
"ext/postgresql-8.3-603.jdbc3.jar" + File.pathSeparator +
"ext/mysql-connector-java-5.1.6.jar"; "ext/mysql-connector-java-5.1.6.jar";
exec("java", new String[]{"-Xmx128m", "-cp", cp, "org.h2.test.bench.TestPerformance", "-init", "-db", "1"}); exec("java", new String[]{"-Xmx128m", "-cp", cp, "org.h2.test.bench.TestPerformance", "-init", "-db", "1"});
exec("java", new String[]{"-Xmx128m", "-cp", cp, "org.h2.test.bench.TestPerformance", "-db", "2"}); exec("java", new String[]{"-Xmx128m", "-cp", cp, "org.h2.test.bench.TestPerformance", "-db", "2"});
......
...@@ -175,15 +175,14 @@ public class BuildBase { ...@@ -175,15 +175,14 @@ public class BuildBase {
out.print(" " + args[i]); out.print(" " + args[i]);
} }
out.println(); out.println();
Process p;
String[] cmdArray = new String[1 + (args == null ? 0 : args.length)]; String[] cmdArray = new String[1 + (args == null ? 0 : args.length)];
cmdArray[0] = command; cmdArray[0] = command;
if (args != null) { if (args != null) {
System.arraycopy(args, 0, cmdArray, 1, args.length); System.arraycopy(args, 0, cmdArray, 1, args.length);
} }
p = Runtime.getRuntime().exec(cmdArray); Process p = Runtime.getRuntime().exec(cmdArray);
copy(p.getInputStream(), out); copyInThread(p.getInputStream(), out);
copy(p.getErrorStream(), out); copyInThread(p.getErrorStream(), out);
p.waitFor(); p.waitFor();
return p.exitValue(); return p.exitValue();
} catch (Exception e) { } catch (Exception e) {
...@@ -191,14 +190,22 @@ public class BuildBase { ...@@ -191,14 +190,22 @@ public class BuildBase {
} }
} }
private void copy(InputStream in, OutputStream out) throws IOException { private void copyInThread(final InputStream in, final OutputStream out) {
while (true) { new Thread() {
int x = in.read(); public void run() {
if (x < 0) { try {
return; while (true) {
int x = in.read();
if (x < 0) {
return;
}
out.write(x);
}
} catch (Exception e) {
throw new Error("Error: " + e, e);
}
} }
out.write(x); } .start();
}
} }
/** /**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论