use of net.java.html.boot.BrowserBuilder in project dukescript-presenters by dukescript.
the class GtkKnockoutTest method compatibilityTests.
@Factory
public static Object[] compatibilityTests() throws Exception {
Class[] arr = testClasses();
for (int i = 0; i < arr.length; i++) {
assertEquals(arr[i].getClassLoader(), GtkKnockoutTest.class.getClassLoader(), "All classes loaded by the same classloader");
}
URI uri = DynamicHTTP.initServer();
final BrowserBuilder bb = BrowserBuilder.newBrowser(new WebKitPresenter(true)).loadClass(GtkKnockoutTest.class).loadPage(uri.toString()).invoke("initialized");
Executors.newSingleThreadExecutor().submit(new Runnable() {
@Override
public void run() {
bb.showAndWait();
}
});
ClassLoader l = getClassLoader();
List<Object> res = new ArrayList<>();
for (Class oldC : arr) {
Class<?> c = Class.forName(oldC.getName(), true, l);
seekKOTests(c, res);
}
return res.toArray();
}
use of net.java.html.boot.BrowserBuilder in project dukescript-presenters by dukescript.
the class KoBrowserTest method compatibilityTests.
@Factory
public static Object[] compatibilityTests() throws Exception {
Browser.LOG.setLevel(Level.FINE);
Browser.LOG.addHandler(new ConsoleHandler());
final BrowserBuilder bb = BrowserBuilder.newBrowser(new Browser("KoBrowserTest")).loadClass(KoBrowserTest.class).loadPage("empty.html").invoke("initialized");
Executors.newSingleThreadExecutor().submit(new Runnable() {
@Override
public void run() {
bb.showAndWait();
}
});
List<Object> res = new ArrayList<Object>();
Class<? extends Annotation> test = loadClass().getClassLoader().loadClass(KOTest.class.getName()).asSubclass(Annotation.class);
Class[] arr = (Class[]) loadClass().getDeclaredMethod("tests").invoke(null);
final HttpServer s = Browser.findServer(browserPresenter);
ServerConfiguration conf = s.getServerConfiguration();
conf.addHttpHandler(new DynamicHTTP(s), "/dynamic");
for (Class c : arr) {
for (Method m : c.getMethods()) {
if (m.getAnnotation(test) != null) {
res.add(new KOScript(browserPresenter, m));
}
}
}
return res.toArray();
}
use of net.java.html.boot.BrowserBuilder in project dukescript-presenters by dukescript.
the class BrowserTest method compatibilityTests.
@Factory
public static Object[] compatibilityTests() throws Exception {
final BrowserBuilder bb = BrowserBuilder.newBrowser(new Browser("BrowserTest")).loadClass(BrowserTest.class).loadPage("empty.html").invoke("initialized");
Executors.newSingleThreadExecutor().submit(new Runnable() {
@Override
public void run() {
bb.showAndWait();
}
});
List<Object> res = new ArrayList<Object>();
Class<? extends Annotation> test = loadClass().getClassLoader().loadClass(KOTest.class.getName()).asSubclass(Annotation.class);
Class[] arr = (Class[]) loadClass().getDeclaredMethod("tests").invoke(null);
for (Class c : arr) {
for (Method m : c.getMethods()) {
if (m.getAnnotation(test) != null) {
res.add(new KOScript(browserPresenter, m));
}
}
}
return res.toArray();
}
use of net.java.html.boot.BrowserBuilder in project dukescript-presenters by dukescript.
the class GtkJavaScriptTest method compatibilityTests.
@Factory
public static Object[] compatibilityTests() throws Exception {
final BrowserBuilder bb = BrowserBuilder.newBrowser(new WebKitPresenter(true)).loadClass(GtkJavaScriptTest.class).loadPage("empty.html").invoke("initialized");
Executors.newSingleThreadExecutor().submit(new Runnable() {
@Override
public void run() {
bb.showAndWait();
}
});
List<Object> res = new ArrayList<>();
Class<? extends Annotation> test = loadClass().getClassLoader().loadClass(KOTest.class.getName()).asSubclass(Annotation.class);
Class[] arr = (Class[]) loadClass().getDeclaredMethod("tests").invoke(null);
for (Class c : arr) {
for (Method m : c.getMethods()) {
if (m.getAnnotation(test) != null) {
res.add(new Case(browserPresenter, m));
}
}
}
return res.toArray();
}
use of net.java.html.boot.BrowserBuilder in project dukescript-presenters by dukescript.
the class GenericTest method createTests.
static Object[] createTests(Testing p) throws Exception {
final BrowserBuilder bb = BrowserBuilder.newBrowser(p).loadClass(GenericTest.class).loadPage("empty.html").invoke("initialized");
Executors.newSingleThreadExecutor().submit(new Runnable() {
@Override
public void run() {
bb.showAndWait();
}
});
List<Object> res = new ArrayList<Object>();
Class<? extends Annotation> test = loadClass().getClassLoader().loadClass(KOTest.class.getName()).asSubclass(Annotation.class);
Class[] arr = (Class[]) loadClass().getDeclaredMethod("tests").invoke(null);
for (Class c : arr) {
for (Method m : c.getMethods()) {
if (m.getAnnotation(test) != null) {
res.add(new Case(p, m));
}
}
}
return res.toArray();
}
Aggregations