Search in sources :

Example 6 with StdErrLog

use of org.eclipse.jetty.util.log.StdErrLog in project selenium_java by sergueik.

the class RunScriptTest method beforeSuiteMethod.

@BeforeSuite
public void beforeSuiteMethod() throws Exception {
    ((StdErrLog) Log.getRootLogger()).setLevel(StdErrLog.LEVEL_OFF);
    webServer = new Server(new QueuedThreadPool(5));
    ServerConnector connector = new ServerConnector(webServer, new HttpConnectionFactory());
    connector.setPort(8080);
    webServer.addConnector(connector);
    ResourceHandler resource_handler = new ResourceHandler();
    resource_handler.setDirectoriesListed(true);
    resource_handler.setWelcomeFiles(new String[] { "index.html" });
    resource_handler.setResourceBase("src/test/webapp");
    HandlerList handlers = new HandlerList();
    handlers.setHandlers(new Handler[] { resource_handler, new DefaultHandler() });
    webServer.setHandler(handlers);
    webServer.start();
    driver = new FirefoxDriver();
    driver.manage().timeouts().setScriptTimeout(30, TimeUnit.SECONDS);
    wait = new WebDriverWait(driver, flexibleWait);
    wait.pollingEvery(pollingInterval, TimeUnit.MILLISECONDS);
    hashesFinderScript = getScriptContent("hashesFinder.js");
    resultFinderScript = getScriptContent("resultFinder.js");
}
Also used : ServerConnector(org.eclipse.jetty.server.ServerConnector) HandlerList(org.eclipse.jetty.server.handler.HandlerList) StdErrLog(org.eclipse.jetty.util.log.StdErrLog) Server(org.eclipse.jetty.server.Server) HttpConnectionFactory(org.eclipse.jetty.server.HttpConnectionFactory) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) QueuedThreadPool(org.eclipse.jetty.util.thread.QueuedThreadPool) WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) ResourceHandler(org.eclipse.jetty.server.handler.ResourceHandler) DefaultHandler(org.eclipse.jetty.server.handler.DefaultHandler) BeforeSuite(org.testng.annotations.BeforeSuite)

Example 7 with StdErrLog

use of org.eclipse.jetty.util.log.StdErrLog in project selenium_java by sergueik.

the class AngularAndWebDriverTest method before_suite.

@BeforeSuite
public void before_suite() throws Exception {
    // Launch Protractor's own test app on http://localhost:8080
    ((StdErrLog) Log.getRootLogger()).setLevel(StdErrLog.LEVEL_OFF);
    webServer = new Server(new QueuedThreadPool(6));
    ServerConnector connector = new ServerConnector(webServer, new HttpConnectionFactory());
    connector.setPort(8080);
    webServer.addConnector(connector);
    ResourceHandler resource_handler = new ResourceHandler();
    resource_handler.setDirectoriesListed(true);
    resource_handler.setWelcomeFiles(new String[] { "index.html" });
    resource_handler.setResourceBase("src/test/webapp");
    HandlerList handlers = new HandlerList();
    MovedContextHandler effective_symlink = new MovedContextHandler(webServer, "/lib/angular", "/lib/angular_v1.2.9");
    handlers.setHandlers(new Handler[] { effective_symlink, resource_handler, new DefaultHandler() });
    webServer.setHandler(handlers);
    webServer.start();
    setupBrowser("chrome");
    driver.manage().timeouts().setScriptTimeout(30, TimeUnit.SECONDS);
    ngWebDriver = new NgWebDriver(driver);
}
Also used : ServerConnector(org.eclipse.jetty.server.ServerConnector) HandlerList(org.eclipse.jetty.server.handler.HandlerList) StdErrLog(org.eclipse.jetty.util.log.StdErrLog) Server(org.eclipse.jetty.server.Server) HttpConnectionFactory(org.eclipse.jetty.server.HttpConnectionFactory) MovedContextHandler(org.eclipse.jetty.server.handler.MovedContextHandler) QueuedThreadPool(org.eclipse.jetty.util.thread.QueuedThreadPool) ResourceHandler(org.eclipse.jetty.server.handler.ResourceHandler) DefaultHandler(org.eclipse.jetty.server.handler.DefaultHandler) BeforeSuite(org.testng.annotations.BeforeSuite)

Aggregations

StdErrLog (org.eclipse.jetty.util.log.StdErrLog)7 HttpConnectionFactory (org.eclipse.jetty.server.HttpConnectionFactory)4 Server (org.eclipse.jetty.server.Server)4 ServerConnector (org.eclipse.jetty.server.ServerConnector)4 DefaultHandler (org.eclipse.jetty.server.handler.DefaultHandler)4 QueuedThreadPool (org.eclipse.jetty.util.thread.QueuedThreadPool)4 ResourceHandler (org.eclipse.jetty.server.handler.ResourceHandler)3 MBeanContainer (org.eclipse.jetty.jmx.MBeanContainer)2 ForwardedRequestCustomizer (org.eclipse.jetty.server.ForwardedRequestCustomizer)2 HttpConfiguration (org.eclipse.jetty.server.HttpConfiguration)2 SecureRequestCustomizer (org.eclipse.jetty.server.SecureRequestCustomizer)2 ContextHandlerCollection (org.eclipse.jetty.server.handler.ContextHandlerCollection)2 HandlerCollection (org.eclipse.jetty.server.handler.HandlerCollection)2 HandlerList (org.eclipse.jetty.server.handler.HandlerList)2 WebAppContext (org.eclipse.jetty.webapp.WebAppContext)2 BeforeSuite (org.testng.annotations.BeforeSuite)2 File (java.io.File)1 ALPNServerConnectionFactory (org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory)1 HTTP2Cipher (org.eclipse.jetty.http2.HTTP2Cipher)1 HTTP2ServerConnectionFactory (org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory)1