@Override public void onReady(Chunks.Out<String> out) { try { callback.invoke(out); } catch (Throwable e) { logger.error("Exception in StringChunks.onReady", e); } } }
/** * Executes a block of code in a running server, with a test browser. */ public static synchronized void running(TestServer server, Class<? extends WebDriver> webDriver, final Callback<TestBrowser> block) { TestBrowser browser = null; TestServer startedServer = null; try { start(server); startedServer = server; browser = testBrowser(webDriver); block.invoke(browser); } catch(Throwable t) { throw new RuntimeException(t); } finally { if(browser != null) { browser.quit(); } if(startedServer != null) { stop(startedServer); } } }
@Override public void onConnected() { try { callback.invoke(this); } catch (Throwable e) { logger.error("Exception in Comet.onConnected", e); } } }
@Override public void onConnected() { try { callback.invoke(this); } catch (Throwable e) { logger.error("Exception in EventSource.onConnected", e); } } }
@Override public void onReady(Chunks.Out<byte[]> out) { try { callback.invoke(out); } catch (Throwable e) { logger.error("Exception in ByteChunks.onReady", e); } } }
/** * Executes a block of code in a running server, with a test browser. */ public static void running(TestServer server, WebDriver webDriver, final Callback<TestBrowser> block) { synchronized (PlayRunners$.MODULE$.mutex()) { TestBrowser browser = null; TestServer startedServer = null; try { start(server); startedServer = server; browser = testBrowser(webDriver); block.invoke(browser); } catch (Error e) { throw e; } catch (RuntimeException re) { throw re; } catch (Throwable t) { throw new RuntimeException(t); } finally { if (browser != null) { browser.quit(); } if (startedServer != null) { stop(startedServer); } } } }