提交 5beb4e52 authored 作者: Noel Grandin's avatar Noel Grandin

use 1 code exit code, which seems more normal, and fix unit tests

上级 696536b6
......@@ -68,7 +68,7 @@ public class ChangeFileEncryption extends Tool {
new ChangeFileEncryption().runTool(args);
} catch (SQLException ex) {
ex.printStackTrace(System.err);
System.exit(-1);
System.exit(1);
}
}
......
......@@ -13,7 +13,6 @@ import java.io.PrintStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets;
import org.h2.store.fs.FileUtils;
import org.h2.test.TestBase;
import org.h2.tools.DeleteDbFiles;
......@@ -106,8 +105,6 @@ public class TestSampleApps extends TestBase {
// tools
testApp("Allows changing the database file encryption password or algorithm*",
org.h2.tools.ChangeFileEncryption.class, "-help");
testApp("Allows changing the database file encryption password or algorithm*",
org.h2.tools.ChangeFileEncryption.class);
testApp("Deletes all files belonging to a database.*",
org.h2.tools.DeleteDbFiles.class, "-help");
FileUtils.delete(getBaseDir() + "/optimizations.sql");
......
......@@ -1054,14 +1054,8 @@ public class TestTools extends TestBase {
}
private void testChangeFileEncryptionWithWrongPassword() throws SQLException {
if (config.mvStore) {
// the file system encryption abstraction used by the MVStore
// doesn't detect wrong passwords
return;
}
org.h2.Driver.load();
final String dir = getBaseDir();
// TODO: this doesn't seem to work in MVSTORE mode yet
String url = "jdbc:h2:" + dir + "/testChangeFileEncryption;CIPHER=AES";
DeleteDbFiles.execute(dir, "testChangeFileEncryption", true);
Connection conn = getConnection(url, "sa", "abc 123");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论