1.1 --- a/vm/src/test/java/org/apidesign/vm4brwsr/ExceptionsTest.java Thu Jan 10 13:09:19 2013 +0100
1.2 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/ExceptionsTest.java Mon Feb 11 12:46:43 2013 +0100
1.3 @@ -17,7 +17,6 @@
1.4 */
1.5 package org.apidesign.vm4brwsr;
1.6
1.7 -import javax.script.Invocable;
1.8 import javax.script.ScriptException;
1.9 import static org.testng.Assert.*;
1.10 import org.testng.annotations.BeforeClass;
1.11 @@ -81,8 +80,7 @@
1.12 }
1.13
1.14 @Test public void testThreeCalls() throws Exception {
1.15 - Object vm = code.invokeFunction("bck2brwsr");
1.16 - Object clazz = code.invokeMethod(vm, "loadClass", Exceptions.class.getName());
1.17 + Object clazz = code.loadClass("loadClass", Exceptions.class.getName());
1.18
1.19 String method = "readCounter__ILjava_lang_String_2";
1.20
1.21 @@ -104,18 +102,13 @@
1.22 }
1.23 }
1.24
1.25 - private static CharSequence codeSeq;
1.26 - private static Invocable code;
1.27 + private static TestVM code;
1.28
1.29 @BeforeClass
1.30 public void compileTheCode() throws Exception {
1.31 - StringBuilder sb = new StringBuilder();
1.32 - code = StaticMethodTest.compileClass(sb,
1.33 - "org/apidesign/vm4brwsr/Exceptions"
1.34 - );
1.35 - codeSeq = sb;
1.36 + code = TestVM.compileClass("org/apidesign/vm4brwsr/Exceptions");
1.37 }
1.38 private static void assertExec(String msg, Class clazz, String method, Object expRes, Object... args) throws Exception {
1.39 - StaticMethodTest.assertExec(code, codeSeq, msg, clazz, method, expRes, args);
1.40 + code.assertExec(msg, clazz, method, expRes, args);
1.41 }
1.42 }