1.1 --- a/vm/src/test/java/org/apidesign/vm4brwsr/SystemTest.java Fri Feb 08 11:12:02 2013 +0100
1.2 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/SystemTest.java Fri Mar 22 16:59:47 2013 +0100
1.3 @@ -17,10 +17,8 @@
1.4 */
1.5 package org.apidesign.vm4brwsr;
1.6
1.7 -import javax.script.Invocable;
1.8 import org.testng.annotations.BeforeClass;
1.9 import static org.testng.Assert.*;
1.10 -import org.testng.annotations.BeforeMethod;
1.11 import org.testng.annotations.Test;
1.12
1.13 /**
1.14 @@ -28,10 +26,12 @@
1.15 * @author Jaroslav Tulach <jtulach@netbeans.org>
1.16 */
1.17 public class SystemTest {
1.18 + private static TestVM code;
1.19 +
1.20 @Test public void verifyJSTime() throws Exception {
1.21 long now = System.currentTimeMillis();
1.22
1.23 - Object js = TestUtils.execCode(code, codeSeq, "Get js time",
1.24 + Object js = code.execCode("Get js time",
1.25 org.apidesign.bck2brwsr.emul.lang.System.class, "currentTimeMillis__J",
1.26 null
1.27 );
1.28 @@ -45,14 +45,11 @@
1.29 assertTrue(time <= later, "Upper bound is OK: " + time + " <= " + later);
1.30 }
1.31
1.32 - private static CharSequence codeSeq;
1.33 - private static Invocable code;
1.34
1.35 @BeforeClass
1.36 - public void compileTheCode() throws Exception {
1.37 - StringBuilder sb = new StringBuilder();
1.38 - code = StaticMethodTest.compileClass(sb, "org/apidesign/bck2brwsr/emul/lang/System");
1.39 - codeSeq = sb;
1.40 + public static void compileTheCode() throws Exception {
1.41 + code = TestVM.compileClass(
1.42 + "org/apidesign/bck2brwsr/emul/lang/System");
1.43 }
1.44
1.45 }