# HG changeset patch # User Jaroslav Tulach # Date 1360583203 -3600 # Node ID 59d5596a9c6ca48d2a0cbc8987ea20de35f8890c # Parent a9187d4aaa6bd3e778e91fc396b8e5a3417d7813 Encapsulation. Moving shared code into TestVM instance. diff -r a9187d4aaa6b -r 59d5596a9c6c vm/src/test/java/org/apidesign/vm4brwsr/ArrayTest.java --- a/vm/src/test/java/org/apidesign/vm4brwsr/ArrayTest.java Sun Feb 10 19:33:35 2013 +0100 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/ArrayTest.java Mon Feb 11 12:46:43 2013 +0100 @@ -17,7 +17,6 @@ */ package org.apidesign.vm4brwsr; -import javax.script.Invocable; import static org.testng.Assert.*; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -76,18 +75,13 @@ assertExec("Returns 'false'", Array.class, "instanceOfArray__ZLjava_lang_Object_2", Double.valueOf(0), "non-array"); } - private static CharSequence codeSeq; - private static Invocable code; + private static TestVM code; @BeforeClass public void compileTheCode() throws Exception { - StringBuilder sb = new StringBuilder(); - code = StaticMethodTest.compileClass(sb, - "org/apidesign/vm4brwsr/Array" - ); - codeSeq = sb; + code = TestVM.compileClass("org/apidesign/vm4brwsr/Array"); } private static void assertExec(String msg, Class clazz, String method, Object expRes, Object... args) throws Exception { - StaticMethodTest.assertExec(code, codeSeq, msg, clazz, method, expRes, args); + code.assertExec(msg, clazz, method, expRes, args); } } diff -r a9187d4aaa6b -r 59d5596a9c6c vm/src/test/java/org/apidesign/vm4brwsr/ClassTest.java --- a/vm/src/test/java/org/apidesign/vm4brwsr/ClassTest.java Sun Feb 10 19:33:35 2013 +0100 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/ClassTest.java Mon Feb 11 12:46:43 2013 +0100 @@ -17,7 +17,6 @@ */ package org.apidesign.vm4brwsr; -import javax.script.Invocable; import org.testng.annotations.Test; import static org.testng.Assert.*; import org.testng.annotations.BeforeClass; @@ -185,22 +184,17 @@ ); } - private static CharSequence codeSeq; - private static Invocable code; + private static TestVM code; @BeforeClass public void compileTheCode() throws Exception { - if (codeSeq == null) { - StringBuilder sb = new StringBuilder(); - code = StaticMethodTest.compileClass(sb, "org/apidesign/vm4brwsr/Classes"); - codeSeq = sb; - } + code = TestVM.compileClass("org/apidesign/vm4brwsr/Classes"); } private void assertExec( String msg, Class clazz, String method, Object expRes, Object... args ) throws Exception { - StaticMethodTest.assertExec(code, codeSeq, msg, clazz, method, expRes, args); + code.assertExec(msg, clazz, method, expRes, args); } } diff -r a9187d4aaa6b -r 59d5596a9c6c vm/src/test/java/org/apidesign/vm4brwsr/ExceptionsTest.java --- a/vm/src/test/java/org/apidesign/vm4brwsr/ExceptionsTest.java Sun Feb 10 19:33:35 2013 +0100 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/ExceptionsTest.java Mon Feb 11 12:46:43 2013 +0100 @@ -17,7 +17,6 @@ */ package org.apidesign.vm4brwsr; -import javax.script.Invocable; import javax.script.ScriptException; import static org.testng.Assert.*; import org.testng.annotations.BeforeClass; @@ -81,8 +80,7 @@ } @Test public void testThreeCalls() throws Exception { - Object vm = code.invokeFunction("bck2brwsr"); - Object clazz = code.invokeMethod(vm, "loadClass", Exceptions.class.getName()); + Object clazz = code.loadClass("loadClass", Exceptions.class.getName()); String method = "readCounter__ILjava_lang_String_2"; @@ -104,18 +102,13 @@ } } - private static CharSequence codeSeq; - private static Invocable code; + private static TestVM code; @BeforeClass public void compileTheCode() throws Exception { - StringBuilder sb = new StringBuilder(); - code = StaticMethodTest.compileClass(sb, - "org/apidesign/vm4brwsr/Exceptions" - ); - codeSeq = sb; + code = TestVM.compileClass("org/apidesign/vm4brwsr/Exceptions"); } private static void assertExec(String msg, Class clazz, String method, Object expRes, Object... args) throws Exception { - StaticMethodTest.assertExec(code, codeSeq, msg, clazz, method, expRes, args); + code.assertExec(msg, clazz, method, expRes, args); } } diff -r a9187d4aaa6b -r 59d5596a9c6c vm/src/test/java/org/apidesign/vm4brwsr/InstanceTest.java --- a/vm/src/test/java/org/apidesign/vm4brwsr/InstanceTest.java Sun Feb 10 19:33:35 2013 +0100 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/InstanceTest.java Mon Feb 11 12:46:43 2013 +0100 @@ -17,7 +17,6 @@ */ package org.apidesign.vm4brwsr; -import javax.script.Invocable; import org.testng.annotations.Test; import org.testng.annotations.BeforeClass; @@ -151,22 +150,17 @@ return "org/apidesign/vm4brwsr/Instance"; } - private static CharSequence codeSeq; - private static Invocable code; + private static TestVM code; @BeforeClass public void compileTheCode() throws Exception { - if (codeSeq == null) { - StringBuilder sb = new StringBuilder(); - code = StaticMethodTest.compileClass(sb, startCompilationWith()); - codeSeq = sb; - } + code = TestVM.compileClass(startCompilationWith()); } private void assertExec( String msg, Class clazz, String method, Object expRes, Object... args ) throws Exception { - StaticMethodTest.assertExec(code, codeSeq, msg, clazz, method, expRes, args); + code.assertExec(msg, clazz, method, expRes, args); } } diff -r a9187d4aaa6b -r 59d5596a9c6c vm/src/test/java/org/apidesign/vm4brwsr/NumberTest.java --- a/vm/src/test/java/org/apidesign/vm4brwsr/NumberTest.java Sun Feb 10 19:33:35 2013 +0100 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/NumberTest.java Mon Feb 11 12:46:43 2013 +0100 @@ -17,8 +17,6 @@ */ package org.apidesign.vm4brwsr; -import javax.script.Invocable; -import javax.script.ScriptException; import static org.testng.Assert.*; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -690,22 +688,17 @@ ); } - private static CharSequence codeSeq; - private static Invocable code; + private static TestVM code; @BeforeClass public void compileTheCode() throws Exception { - if (codeSeq == null) { - StringBuilder sb = new StringBuilder(); - code = StaticMethodTest.compileClass(sb, "org/apidesign/vm4brwsr/Numbers"); - codeSeq = sb; - } + code = TestVM.compileClass("org/apidesign/vm4brwsr/Numbers"); } private static void assertExec( String msg, Class clazz, String method, Object expRes, Object... args) throws Exception { - Object ret = TestUtils.execCode(code, codeSeq, msg, clazz, method, expRes, args); + Object ret = code.execCode(msg, clazz, method, expRes, args); if (ret == null) { return; } @@ -713,10 +706,10 @@ double expD = ((Double)expRes).doubleValue(); double retD = ((Double)ret).doubleValue(); assertEquals(retD, expD, 0.000004, msg + " " - + StaticMethodTest.dumpJS(codeSeq)); + + code.toString()); return; } - assertEquals(ret, expRes, msg + " " + StaticMethodTest.dumpJS(codeSeq)); + assertEquals(ret, expRes, msg + " " + code.toString()); } } diff -r a9187d4aaa6b -r 59d5596a9c6c vm/src/test/java/org/apidesign/vm4brwsr/StaticMethodTest.java --- a/vm/src/test/java/org/apidesign/vm4brwsr/StaticMethodTest.java Sun Feb 10 19:33:35 2013 +0100 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/StaticMethodTest.java Mon Feb 11 12:46:43 2013 +0100 @@ -17,16 +17,6 @@ */ package org.apidesign.vm4brwsr; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.Enumeration; -import javax.script.Invocable; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; import static org.testng.Assert.*; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -331,88 +321,18 @@ ); } - private static CharSequence codeSeq; - private static Invocable code; + private static TestVM code; @BeforeClass public void compileTheCode() throws Exception { StringBuilder sb = new StringBuilder(); - code = compileClass(sb, "org/apidesign/vm4brwsr/StaticMethod"); - codeSeq = sb; - } - - - private static void assertExec( - String msg, Class clazz, String method, - Object expRes, Object... args - ) throws Exception { - assertExec(code, codeSeq, msg, clazz, method, expRes, args); - } - static void assertExec( - Invocable toRun, CharSequence theCode, - String msg, Class clazz, String method, - Object expRes, Object... args - ) throws Exception { - Object ret = TestUtils.execCode(toRun, theCode, msg, clazz, method, expRes, args); - if (ret == null) { - return; - } - if (expRes != null && expRes.equals(ret)) { - return; - } - assertEquals(ret, expRes, msg + "was: " + ret + "\n" + dumpJS(theCode)); - + code = TestVM.compileClass(sb, "org/apidesign/vm4brwsr/StaticMethod"); } - static Invocable compileClass(StringBuilder sb, String... names) throws ScriptException, IOException { - return compileClass(sb, null, names); - } - static Invocable compileClass( - StringBuilder sb, ScriptEngine[] eng, String... names - ) throws ScriptException, IOException { - if (sb == null) { - sb = new StringBuilder(); - } - Bck2Brwsr.generate(sb, new EmulationResources(), names); - ScriptEngineManager sem = new ScriptEngineManager(); - ScriptEngine js = sem.getEngineByExtension("js"); - if (eng != null) { - eng[0] = js; - } - try { - Object res = js.eval(sb.toString()); - assertTrue(js instanceof Invocable, "It is invocable object: " + res); - return (Invocable)js; - } catch (Exception ex) { - if (sb.length() > 2000) { - sb = dumpJS(sb); - } - fail("Could not evaluate:\n" + sb, ex); - return null; - } - } - static StringBuilder dumpJS(CharSequence sb) throws IOException { - File f = File.createTempFile("execution", ".js"); - FileWriter w = new FileWriter(f); - w.append(sb); - w.close(); - return new StringBuilder(f.getPath()); - } - private static class EmulationResources implements Bck2Brwsr.Resources { - @Override - public InputStream get(String name) throws IOException { - Enumeration en = StaticMethodTest.class.getClassLoader().getResources(name); - URL u = null; - while (en.hasMoreElements()) { - u = en.nextElement(); - } - if (u == null) { - throw new IOException("Can't find " + name); - } - if (u.toExternalForm().contains("rt.jar!")) { - throw new IOException("No emulation for " + u); - } - return u.openStream(); - } + private void assertExec( + String msg, Class clazz, String method, + Object ret, Object... args + ) throws Exception { + code.assertExec(msg, clazz, method, ret, args); } } diff -r a9187d4aaa6b -r 59d5596a9c6c vm/src/test/java/org/apidesign/vm4brwsr/StringTest.java --- a/vm/src/test/java/org/apidesign/vm4brwsr/StringTest.java Sun Feb 10 19:33:35 2013 +0100 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/StringTest.java Mon Feb 11 12:46:43 2013 +0100 @@ -17,7 +17,6 @@ */ package org.apidesign.vm4brwsr; -import javax.script.Invocable; import org.testng.annotations.Test; import static org.testng.Assert.*; import org.testng.annotations.BeforeClass; @@ -194,23 +193,20 @@ } - private static CharSequence codeSeq; - private static Invocable code; + private static TestVM code; @BeforeClass public void compileTheCode() throws Exception { - StringBuilder sb = new StringBuilder(); - code = StaticMethodTest.compileClass(sb, + code = TestVM.compileClass( "org/apidesign/vm4brwsr/StringSample", "java/lang/String" ); - codeSeq = sb; } private static void assertExec(String msg, Class clazz, String method, Object expRes, Object... args ) throws Exception { - StaticMethodTest.assertExec(code, codeSeq, msg, clazz, method, expRes, args); + code.assertExec(msg, clazz, method, expRes, args); } } diff -r a9187d4aaa6b -r 59d5596a9c6c vm/src/test/java/org/apidesign/vm4brwsr/TestUtils.java --- a/vm/src/test/java/org/apidesign/vm4brwsr/TestUtils.java Sun Feb 10 19:33:35 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/** - * Back 2 Browser Bytecode Translator - * Copyright (C) 2012 Jaroslav Tulach - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. Look for COPYING file in the top folder. - * If not, see http://opensource.org/licenses/GPL-2.0. - */ -package org.apidesign.vm4brwsr; - -import javax.script.Invocable; -import javax.script.ScriptException; -import static org.testng.Assert.*; - -class TestUtils { - - static Object execCode(Invocable code, CharSequence codeSeq, - 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 " + StaticMethodTest.dumpJS(codeSeq), ex); - } catch (NoSuchMethodException ex) { - fail("Cannot find method in " + StaticMethodTest.dumpJS(codeSeq), ex); - } - if (ret == null && expRes == null) { - return null; - } - if (expRes.equals(ret)) { - return null; - } - if (expRes instanceof Number) { - // in case of Long it is necessary convert it to number - // since the Long is represented by two numbers in JavaScript - try { - ret = code.invokeMethod(ret, "toFP"); - ret = code.invokeFunction("Number", ret); - } catch (ScriptException ex) { - fail("Conversion to number failed in " + StaticMethodTest.dumpJS(codeSeq), ex); - } catch (NoSuchMethodException ex) { - fail("Cannot find global Number(x) function in " + StaticMethodTest.dumpJS(codeSeq), ex); - } - } - return ret; - } -} diff -r a9187d4aaa6b -r 59d5596a9c6c vm/src/test/java/org/apidesign/vm4brwsr/TestVM.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/TestVM.java Mon Feb 11 12:46:43 2013 +0100 @@ -0,0 +1,170 @@ +/** + * Back 2 Browser Bytecode Translator + * Copyright (C) 2012 Jaroslav Tulach + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. Look for COPYING file in the top folder. + * If not, see http://opensource.org/licenses/GPL-2.0. + */ +package org.apidesign.vm4brwsr; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.Enumeration; +import javax.script.Invocable; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; +import static org.testng.Assert.*; + +final class TestVM { + private final Invocable code; + private final CharSequence codeSeq; + private final Object bck2brwsr; + + + private TestVM(Invocable code, CharSequence codeSeq) throws ScriptException, NoSuchMethodException { + this.code = code; + this.codeSeq = codeSeq; + this.bck2brwsr = code.invokeFunction("bck2brwsr"); + } + + + public Object execCode( + String msg, Class clazz, String method, + Object expRes, Object... args + ) throws Exception { + Object ret = null; + try { + ret = code.invokeMethod(bck2brwsr, "loadClass", clazz.getName()); + ret = code.invokeMethod(ret, method, args); + } catch (ScriptException ex) { + fail("Execution failed in " + dumpJS(codeSeq), ex); + } catch (NoSuchMethodException ex) { + fail("Cannot find method in " + dumpJS(codeSeq), ex); + } + if (ret == null && expRes == null) { + return null; + } + if (expRes.equals(ret)) { + return null; + } + if (expRes instanceof Number) { + // in case of Long it is necessary convert it to number + // since the Long is represented by two numbers in JavaScript + try { + ret = code.invokeMethod(ret, "toFP"); + ret = code.invokeFunction("Number", ret); + } catch (ScriptException ex) { + fail("Conversion to number failed in " + dumpJS(codeSeq), ex); + } catch (NoSuchMethodException ex) { + fail("Cannot find global Number(x) function in " + dumpJS(codeSeq), ex); + } + } + return ret; + } + + void assertExec( + String msg, Class clazz, String method, Object expRes, Object... args + ) throws Exception { + Object ret = execCode(msg, clazz, method, expRes, args); + if (ret == null) { + return; + } + if (expRes != null && expRes.equals(ret)) { + return; + } + assertEquals(ret, expRes, msg + "was: " + ret + "\n" + dumpJS(codeSeq)); + } + + static TestVM compileClass(String... names) throws ScriptException, IOException { + return compileClass(null, names); + } + + static TestVM compileClass(StringBuilder sb, String... names) throws ScriptException, IOException { + return compileClass(sb, null, names); + } + + static TestVM compileClass(StringBuilder sb, ScriptEngine[] eng, String... names) throws ScriptException, IOException { + if (sb == null) { + sb = new StringBuilder(); + } + Bck2Brwsr.generate(sb, new EmulationResources(), names); + ScriptEngineManager sem = new ScriptEngineManager(); + ScriptEngine js = sem.getEngineByExtension("js"); + if (eng != null) { + eng[0] = js; + } + try { + Object res = js.eval(sb.toString()); + assertTrue(js instanceof Invocable, "It is invocable object: " + res); + return new TestVM((Invocable) js, sb); + } catch (Exception ex) { + if (sb.length() > 2000) { + sb = dumpJS(sb); + } + fail("Could not evaluate:\n" + sb, ex); + return null; + } + } + + Object loadClass(String loadClass, String name) throws ScriptException, NoSuchMethodException { + return code.invokeMethod(bck2brwsr, "loadClass", Exceptions.class.getName()); + } + + Object invokeMethod(Object obj, String method, Object... params) throws ScriptException, NoSuchMethodException { + return code.invokeMethod(obj, method, params); + } + + Object invokeFunction(String methodName, Object... args) throws ScriptException, NoSuchMethodException { + return code.invokeFunction(methodName, args); + } + + static StringBuilder dumpJS(CharSequence sb) throws IOException { + File f = File.createTempFile("execution", ".js"); + FileWriter w = new FileWriter(f); + w.append(sb); + w.close(); + return new StringBuilder(f.getPath()); + } + + @Override + public String toString() { + try { + return dumpJS(codeSeq).toString(); + } catch (IOException ex) { + return ex.toString(); + } + } + + + private static class EmulationResources implements Bck2Brwsr.Resources { + @Override + public InputStream get(String name) throws IOException { + Enumeration en = StaticMethodTest.class.getClassLoader().getResources(name); + URL u = null; + while (en.hasMoreElements()) { + u = en.nextElement(); + } + if (u == null) { + throw new IOException("Can't find " + name); + } + if (u.toExternalForm().contains("rt.jar!")) { + throw new IOException("No emulation for " + u); + } + return u.openStream(); + } + } +} diff -r a9187d4aaa6b -r 59d5596a9c6c vm/src/test/java/org/apidesign/vm4brwsr/VMLazyTest.java --- a/vm/src/test/java/org/apidesign/vm4brwsr/VMLazyTest.java Sun Feb 10 19:33:35 2013 +0100 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/VMLazyTest.java Mon Feb 11 12:46:43 2013 +0100 @@ -17,7 +17,6 @@ */ package org.apidesign.vm4brwsr; -import javax.script.Invocable; import javax.script.ScriptContext; import javax.script.ScriptEngine; import javax.script.ScriptException; @@ -30,10 +29,7 @@ * @author Jaroslav Tulach */ public class VMLazyTest { - - - private static CharSequence codeSeq; - private static Invocable code; + private static TestVM code; @BeforeClass public void compileTheCode() throws Exception { @@ -50,11 +46,10 @@ sb.append("\n}"); ScriptEngine[] arr = { null }; - code = StaticMethodTest.compileClass(sb, arr, + code = TestVM.compileClass(sb, arr, new String[]{"org/apidesign/vm4brwsr/VM", "org/apidesign/vm4brwsr/StaticMethod"} ); arr[0].getContext().setAttribute("loader", new BytesLoader(), ScriptContext.ENGINE_SCOPE); - codeSeq = sb; } @Test public void invokeStaticMethod() throws Exception { @@ -83,9 +78,9 @@ try { ret = code.invokeFunction(methodName, args); } catch (ScriptException ex) { - fail("Execution failed in\n" + StaticMethodTest.dumpJS(codeSeq), ex); + fail("Execution failed in\n" + code.toString(), ex); } catch (NoSuchMethodException ex) { - fail("Cannot find method in\n" + StaticMethodTest.dumpJS(codeSeq), ex); + fail("Cannot find method in\n" + code.toString(), ex); } if (ret == null && expRes == null) { return; @@ -93,6 +88,6 @@ if (expRes.equals(ret)) { return; } - assertEquals(ret, expRes, msg + "was: " + ret + "\n" + StaticMethodTest.dumpJS(codeSeq)); + assertEquals(ret, expRes, msg + "was: " + ret + "\n" + code.toString()); } } diff -r a9187d4aaa6b -r 59d5596a9c6c vm/src/test/java/org/apidesign/vm4brwsr/VMinVMTest.java --- a/vm/src/test/java/org/apidesign/vm4brwsr/VMinVMTest.java Sun Feb 10 19:33:35 2013 +0100 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/VMinVMTest.java Mon Feb 11 12:46:43 2013 +0100 @@ -21,7 +21,6 @@ import java.io.FileWriter; import java.io.IOException; import static org.testng.Assert.*; -import javax.script.Invocable; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -30,9 +29,7 @@ * @author Jaroslav Tulach */ public class VMinVMTest { - - private static CharSequence codeSeq; - private static Invocable code; + private static TestVM code; @Test public void compareGeneratedCodeForArrayClass() throws Exception { compareCode("org/apidesign/vm4brwsr/Array.class"); @@ -44,11 +41,7 @@ @BeforeClass public void compileTheCode() throws Exception { - StringBuilder sb = new StringBuilder(); - code = StaticMethodTest.compileClass(sb, - "org/apidesign/vm4brwsr/VMinVM" - ); - codeSeq = sb; + code = TestVM.compileClass("org/apidesign/vm4brwsr/VMinVM"); } private void compareCode(final String nm) throws Exception, IOException { @@ -73,7 +66,7 @@ } } w.append("\n];\n"); - w.append(codeSeq); + w.append(code.toString()); w.close(); throw new Exception(ex.getMessage() + " file: " + f, ex); } @@ -83,11 +76,11 @@ if (!ret1.toString().equals(ret)) { StringBuilder msg = new StringBuilder("Difference found between "); - msg.append(StaticMethodTest.dumpJS(ret1)); + msg.append(TestVM.dumpJS(ret1)); msg.append(" "); - msg.append(StaticMethodTest.dumpJS((CharSequence) ret)); + msg.append(TestVM.dumpJS((CharSequence) ret)); msg.append(" compiled by "); - msg.append(StaticMethodTest.dumpJS(codeSeq)); + msg.append(code.toString()); fail(msg.toString()); } }