diff -r aeb9fe11cd60 -r 8e546d108658 vm/src/test/java/org/apidesign/vm4brwsr/NumberTest.java --- a/vm/src/test/java/org/apidesign/vm4brwsr/NumberTest.java Thu Dec 06 22:02:10 2012 +0100 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/NumberTest.java Fri Jan 25 11:00:52 2013 +0100 @@ -157,22 +157,10 @@ } private static void assertExec( - String msg, Class clazz, String method, Object expRes, Object... args) throws Exception { - - Object ret = null; - try { - ret = code.invokeFunction("bck2brwsr"); - ret = code.invokeMethod(ret, "loadClass", clazz.getName()); - ret = code.invokeMethod(ret, method, args); - } catch (ScriptException ex) { - fail("Execution failed in\n" + StaticMethodTest.dumpJS(codeSeq), ex); - } catch (NoSuchMethodException ex) { - fail("Cannot find method in\n" + StaticMethodTest.dumpJS(codeSeq), ex); - } - if (ret == null && expRes == null) { - return; - } - if (expRes.equals(ret)) { + String msg, Class clazz, String method, Object expRes, Object... args) throws Exception + { + Object ret = TestUtils.execCode(code, codeSeq, msg, clazz, method, expRes, args); + if (ret == null) { return; } if (expRes instanceof Double && ret instanceof Double) {