vmtest/src/main/java/org/apidesign/bck2brwsr/vmtest/impl/Bck2BrwsrCase.java
changeset 393 bedc3b93a040
parent 384 269d99fd6421
child 413 c91483c86597
     1.1 --- a/vmtest/src/main/java/org/apidesign/bck2brwsr/vmtest/impl/Bck2BrwsrCase.java	Tue Dec 25 17:46:21 2012 +0100
     1.2 +++ b/vmtest/src/main/java/org/apidesign/bck2brwsr/vmtest/impl/Bck2BrwsrCase.java	Sat Dec 29 19:42:47 2012 +0100
     1.3 @@ -17,10 +17,12 @@
     1.4   */
     1.5  package org.apidesign.bck2brwsr.vmtest.impl;
     1.6  
     1.7 +import java.io.File;
     1.8 +import java.io.FileWriter;
     1.9 +import java.io.IOException;
    1.10  import java.lang.reflect.Method;
    1.11  import java.util.Map;
    1.12  import java.util.WeakHashMap;
    1.13 -import javax.script.Invocable;
    1.14  import org.apidesign.bck2brwsr.launcher.Launcher;
    1.15  import org.apidesign.bck2brwsr.launcher.MethodInvocation;
    1.16  import org.testng.ITest;
    1.17 @@ -35,8 +37,6 @@
    1.18      private final Launcher l;
    1.19      private final String type;
    1.20      Object value;
    1.21 -    private Invocable code;
    1.22 -    private CharSequence codeSeq;
    1.23      private static final Map<Class, Object[]> compiled = new WeakHashMap<>();
    1.24      private Object inst;
    1.25  
    1.26 @@ -64,4 +64,11 @@
    1.27      final String typeName() {
    1.28          return type;
    1.29      }
    1.30 +    static void dumpJS(StringBuilder sb, Bck2BrwsrCase c) throws IOException {
    1.31 +        File f = File.createTempFile(c.m.getName(), ".js");
    1.32 +        try (final FileWriter w = new FileWriter(f)) {
    1.33 +            w.append(c.l.toString());
    1.34 +        }
    1.35 +        sb.append("Path: ").append(f.getPath());
    1.36 +    }
    1.37  }