1.1 --- a/vm/src/test/java/org/apidesign/vm4brwsr/VMinVMTest.java Sun Dec 16 20:48:21 2012 +0100
1.2 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/VMinVMTest.java Mon Feb 11 12:46:43 2013 +0100
1.3 @@ -21,7 +21,6 @@
1.4 import java.io.FileWriter;
1.5 import java.io.IOException;
1.6 import static org.testng.Assert.*;
1.7 -import javax.script.Invocable;
1.8 import org.testng.annotations.BeforeClass;
1.9 import org.testng.annotations.Test;
1.10
1.11 @@ -30,9 +29,7 @@
1.12 * @author Jaroslav Tulach <jtulach@netbeans.org>
1.13 */
1.14 public class VMinVMTest {
1.15 -
1.16 - private static CharSequence codeSeq;
1.17 - private static Invocable code;
1.18 + private static TestVM code;
1.19
1.20 @Test public void compareGeneratedCodeForArrayClass() throws Exception {
1.21 compareCode("org/apidesign/vm4brwsr/Array.class");
1.22 @@ -44,11 +41,7 @@
1.23
1.24 @BeforeClass
1.25 public void compileTheCode() throws Exception {
1.26 - StringBuilder sb = new StringBuilder();
1.27 - code = StaticMethodTest.compileClass(sb,
1.28 - "org/apidesign/vm4brwsr/VMinVM"
1.29 - );
1.30 - codeSeq = sb;
1.31 + code = TestVM.compileClass("org/apidesign/vm4brwsr/VMinVM");
1.32 }
1.33
1.34 private void compareCode(final String nm) throws Exception, IOException {
1.35 @@ -73,7 +66,7 @@
1.36 }
1.37 }
1.38 w.append("\n];\n");
1.39 - w.append(codeSeq);
1.40 + w.append(code.toString());
1.41 w.close();
1.42 throw new Exception(ex.getMessage() + " file: " + f, ex);
1.43 }
1.44 @@ -83,11 +76,11 @@
1.45
1.46 if (!ret1.toString().equals(ret)) {
1.47 StringBuilder msg = new StringBuilder("Difference found between ");
1.48 - msg.append(StaticMethodTest.dumpJS(ret1));
1.49 + msg.append(TestVM.dumpJS(ret1));
1.50 msg.append(" ");
1.51 - msg.append(StaticMethodTest.dumpJS((CharSequence) ret));
1.52 + msg.append(TestVM.dumpJS((CharSequence) ret));
1.53 msg.append(" compiled by ");
1.54 - msg.append(StaticMethodTest.dumpJS(codeSeq));
1.55 + msg.append(code.toString());
1.56 fail(msg.toString());
1.57 }
1.58 }