提交 35f13aae authored 作者: Noel Grandin's avatar Noel Grandin

move test scripts to own package

preparatory work to splitting up the big test script
上级 87911380
...@@ -62,8 +62,6 @@ import org.h2.test.db.TestRights; ...@@ -62,8 +62,6 @@ import org.h2.test.db.TestRights;
import org.h2.test.db.TestRowFactory; import org.h2.test.db.TestRowFactory;
import org.h2.test.db.TestRunscript; import org.h2.test.db.TestRunscript;
import org.h2.test.db.TestSQLInjection; import org.h2.test.db.TestSQLInjection;
import org.h2.test.db.TestScript;
import org.h2.test.db.TestScriptSimple;
import org.h2.test.db.TestSelectCountNonNullColumn; import org.h2.test.db.TestSelectCountNonNullColumn;
import org.h2.test.db.TestSequence; import org.h2.test.db.TestSequence;
import org.h2.test.db.TestSessionsLocks; import org.h2.test.db.TestSessionsLocks;
...@@ -124,6 +122,8 @@ import org.h2.test.mvcc.TestMvccMultiThreaded2; ...@@ -124,6 +122,8 @@ import org.h2.test.mvcc.TestMvccMultiThreaded2;
import org.h2.test.poweroff.TestReorderWrites; import org.h2.test.poweroff.TestReorderWrites;
import org.h2.test.recover.RecoverLobTest; import org.h2.test.recover.RecoverLobTest;
import org.h2.test.rowlock.TestRowLocks; import org.h2.test.rowlock.TestRowLocks;
import org.h2.test.scripts.TestScript;
import org.h2.test.scripts.TestScriptSimple;
import org.h2.test.server.TestAutoServer; import org.h2.test.server.TestAutoServer;
import org.h2.test.server.TestInit; import org.h2.test.server.TestInit;
import org.h2.test.server.TestNestedLoop; import org.h2.test.server.TestNestedLoop;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* and the EPL 1.0 (http://h2database.com/html/license.html). * and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group * Initial Developer: H2 Group
*/ */
package org.h2.test.db; package org.h2.test.scripts;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
...@@ -30,7 +30,7 @@ import org.h2.util.StringUtils; ...@@ -30,7 +30,7 @@ import org.h2.util.StringUtils;
*/ */
public class TestScript extends TestBase { public class TestScript extends TestBase {
private static final String FILENAME = "org/h2/test/testScript.sql"; private static final String FILENAME = "org/h2/test/scripts/testScript.sql";
private boolean failFast; private boolean failFast;
...@@ -87,12 +87,11 @@ public class TestScript extends TestBase { ...@@ -87,12 +87,11 @@ public class TestScript extends TestBase {
private void testScript() throws Exception { private void testScript() throws Exception {
deleteDb("script"); deleteDb("script");
String outFile = "test.out.txt"; String outFile = "test.out.txt";
String inFile = FILENAME;
conn = getConnection("script"); conn = getConnection("script");
stat = conn.createStatement(); stat = conn.createStatement();
out = new PrintStream(new FileOutputStream(outFile)); out = new PrintStream(new FileOutputStream(outFile));
errors = new StringBuilder(); errors = new StringBuilder();
testFile(inFile); testFile(FILENAME);
conn.close(); conn.close();
out.close(); out.close();
if (errors.length() > 0) { if (errors.length() > 0) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* and the EPL 1.0 (http://h2database.com/html/license.html). * and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group * Initial Developer: H2 Group
*/ */
package org.h2.test.db; package org.h2.test.scripts;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
...@@ -38,7 +38,7 @@ public class TestScriptSimple extends TestBase { ...@@ -38,7 +38,7 @@ public class TestScriptSimple extends TestBase {
} }
deleteDb("scriptSimple"); deleteDb("scriptSimple");
reconnect(); reconnect();
String inFile = "org/h2/test/testSimple.in.txt"; String inFile = "org/h2/test/scripts/testSimple.in.txt";
InputStream is = getClass().getClassLoader().getResourceAsStream(inFile); InputStream is = getClass().getClassLoader().getResourceAsStream(inFile);
LineNumberReader lineReader = new LineNumberReader( LineNumberReader lineReader = new LineNumberReader(
new InputStreamReader(is, "Cp1252")); new InputStreamReader(is, "Cp1252"));
......
...@@ -37,7 +37,7 @@ import org.h2.store.FileLister; ...@@ -37,7 +37,7 @@ import org.h2.store.FileLister;
import org.h2.store.fs.FileUtils; import org.h2.store.fs.FileUtils;
import org.h2.test.TestAll; import org.h2.test.TestAll;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.test.db.TestScript; import org.h2.test.scripts.TestScript;
import org.h2.test.synth.sql.RandomGen; import org.h2.test.synth.sql.RandomGen;
import org.h2.tools.Backup; import org.h2.tools.Backup;
import org.h2.tools.DeleteDbFiles; import org.h2.tools.DeleteDbFiles;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论