[Nice-commit] Nice/testsuite helpers.nice,1.1,1.2
Brought to you by:
bonniot
|
From: Daniel B. <bo...@us...> - 2005-04-12 13:57:41
|
Update of /cvsroot/nice/Nice/testsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10113/testsuite Modified Files: helpers.nice Log Message: Run generated jars in a self-contained classloader, so that missing classes in the jar lead to errors, instead of being loaded from the parent. Use "classes" instead of nice.jar so that recent changes immediately affect testcases. Rethrow the cause exception when a testcase fails. Index: helpers.nice =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/helpers.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** helpers.nice 11 Apr 2005 12:45:35 -0000 1.1 --- helpers.nice 12 Apr 2005 13:57:32 -0000 1.2 *************** *** 34,38 **** void compile (String pkg, ! ?String toplevel, ?String imp = null, ?String main = null, --- 34,38 ---- void compile (String pkg, ! ?String toplevel = null, ?String imp = null, ?String main = null, *************** *** 51,55 **** if (imp != null) compilation.packagePath = new File(tmp, imp + ".jar").toString(); ! compilation.runtimeFile = "share/java/nice.jar"; compilation.output = new File(tmp, pkg + ".jar").toString(); --- 51,55 ---- if (imp != null) compilation.packagePath = new File(tmp, imp + ".jar").toString(); ! compilation.runtimeFile = "classes"; compilation.output = new File(tmp, pkg + ".jar").toString(); *************** *** 93,101 **** let mainClassName = jarFile.getManifest().getMainAttributes().getValue("Main-Class"); ! let loader = new java.net.URLClassLoader ! ([jar.toURL(), new java.io.File("share/java/nice.jar").toURL()]); nice.tools.util.JDK.setDefaultAssertionStatus(loader, true); let mainClass = loader.loadClass(mainClassName); let main = mainClass.getMethod("main", [String[].class]); ! main.invoke(null, [cast(null)]); } --- 93,104 ---- let mainClassName = jarFile.getManifest().getMainAttributes().getValue("Main-Class"); ! let loader = new nice.tools.util.SelfContainedClassLoader([jar.toURL()]); nice.tools.util.JDK.setDefaultAssertionStatus(loader, true); let mainClass = loader.loadClass(mainClassName); let main = mainClass.getMethod("main", [String[].class]); ! try { ! main.invoke(null, [cast(null)]); ! } catch (java.lang.reflect.InvocationTargetException e) { ! throw e.getTargetException(); ! } } |