1.1 --- a/src/test/java/org/apidesign/java4browser/StaticMethodTest.java Sun Sep 16 07:28:57 2012 +0200
1.2 +++ b/src/test/java/org/apidesign/java4browser/StaticMethodTest.java Wed Sep 19 19:57:45 2012 +0200
1.3 @@ -131,7 +131,7 @@
1.4
1.5 private static void assertExec(String msg, String methodName, Object expRes, Object... args) throws Exception {
1.6 StringBuilder sb = new StringBuilder();
1.7 - Invocable i = compileClass("StaticMethod.class", sb);
1.8 + Invocable i = compileClass(sb, "StaticMethod.class");
1.9
1.10 Object ret = null;
1.11 try {
1.12 @@ -151,13 +151,15 @@
1.13
1.14 }
1.15
1.16 - static Invocable compileClass(String name, StringBuilder sb) throws ScriptException, IOException {
1.17 - InputStream is = StaticMethodTest.class.getResourceAsStream(name);
1.18 - assertNotNull(is, "Class file found");
1.19 - if (sb == null) {
1.20 - sb = new StringBuilder();
1.21 + static Invocable compileClass(StringBuilder sb, String... names) throws ScriptException, IOException {
1.22 + for (String name : names) {
1.23 + InputStream is = StaticMethodTest.class.getResourceAsStream(name);
1.24 + assertNotNull(is, "Class file found");
1.25 + if (sb == null) {
1.26 + sb = new StringBuilder();
1.27 + }
1.28 + ByteCodeToJavaScript.compile(name, is, sb);
1.29 }
1.30 - ByteCodeToJavaScript.compile(name, is, sb);
1.31 ScriptEngineManager sem = new ScriptEngineManager();
1.32 ScriptEngine js = sem.getEngineByExtension("js");
1.33 try {