1.1 --- a/vmtest/src/main/java/org/apidesign/bck2brwsr/vmtest/impl/Launchers.java Tue Dec 25 13:31:35 2012 +0100
1.2 +++ b/vmtest/src/main/java/org/apidesign/bck2brwsr/vmtest/impl/Launchers.java Tue Dec 25 15:08:39 2012 +0100
1.3 @@ -18,10 +18,8 @@
1.4 package org.apidesign.bck2brwsr.vmtest.impl;
1.5
1.6 import java.io.IOException;
1.7 -import org.apidesign.bck2brwsr.launcher.Bck2BrwsrLauncher;
1.8 -import org.apidesign.bck2brwsr.launcher.JSLauncher;
1.9 +import org.apidesign.bck2brwsr.launcher.Launcher;
1.10 import org.apidesign.bck2brwsr.launcher.MethodInvocation;
1.11 -import org.apidesign.vm4brwsr.Bck2Brwsr;
1.12 import org.testng.annotations.AfterGroups;
1.13 import org.testng.annotations.BeforeGroups;
1.14
1.15 @@ -32,34 +30,32 @@
1.16 public final class Launchers {
1.17 public static final Launchers INSTANCE = new Launchers();
1.18
1.19 - private JSLauncher jsl;
1.20 - private Bck2BrwsrLauncher brwsr;
1.21 + private Launcher jsl;
1.22 + private Launcher brwsr;
1.23
1.24 private Launchers() {
1.25 }
1.26
1.27 @BeforeGroups("run")
1.28 public void initializeLauncher() throws IOException {
1.29 - jsl = new JSLauncher();
1.30 - jsl.addClassLoader(Bck2Brwsr.class.getClassLoader());
1.31 + jsl = Launcher.createJavaScript();
1.32 jsl.initialize();
1.33 - Bck2BrwsrLauncher l = new Bck2BrwsrLauncher();
1.34 - l.addClassLoader(Bck2Brwsr.class.getClassLoader());
1.35 + Launcher l = Launcher.createBrowser("xdg-open");
1.36 l.initialize();
1.37 - l.setTimeout(180000);
1.38 brwsr = l;
1.39 }
1.40
1.41 @AfterGroups("run")
1.42 public void shutDownLauncher() throws IOException, InterruptedException {
1.43 + jsl.shutdown();
1.44 brwsr.shutdown();
1.45 }
1.46
1.47 - public MethodInvocation addMethod(Class<?> clazz, String name, boolean inBrwsr) throws IOException {
1.48 + public MethodInvocation invokeMethod(Class<?> clazz, String name, boolean inBrwsr) throws IOException {
1.49 if (!inBrwsr) {
1.50 - return jsl.addMethod(clazz, name);
1.51 + return jsl.invokeMethod(clazz, name);
1.52 } else {
1.53 - return brwsr.addMethod(clazz, name);
1.54 + return brwsr.invokeMethod(clazz, name);
1.55 }
1.56 }
1.57 }