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

Ignore this test if the jar file is missing.

上级 f7b26686
...@@ -35,7 +35,13 @@ public class TestOldVersion extends TestBase { ...@@ -35,7 +35,13 @@ public class TestOldVersion extends TestBase {
URL[] urls = { new URL("file:ext/h2-1.2.127.jar") }; URL[] urls = { new URL("file:ext/h2-1.2.127.jar") };
ClassLoader cl = new URLClassLoader(urls, null); ClassLoader cl = new URLClassLoader(urls, null);
// cl = getClass().getClassLoader(); // cl = getClass().getClassLoader();
Class< ? > driverClass = cl.loadClass("org.h2.Driver"); Class< ? > driverClass;
try {
driverClass = cl.loadClass("org.h2.Driver");
} catch (ClassNotFoundException e) {
println("not found: ext/h2-1.2.127.jar - test skipped");
return;
}
Method m = driverClass.getMethod("load"); Method m = driverClass.getMethod("load");
Driver driver = (Driver) m.invoke(null); Driver driver = (Driver) m.invoke(null);
Connection conn = driver.connect("jdbc:h2:mem:", null); Connection conn = driver.connect("jdbc:h2:mem:", null);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论