Package com.crawljax.browser

Examples of com.crawljax.browser.EmbeddedBrowser


            .addPlugin(domChange).build(), new MetricRegistry());
  }

  @Test
  public void browserCreatedIsCalled() {
    EmbeddedBrowser newBrowser = mock(EmbeddedBrowser.class);
    plugins.runOnBrowserCreatedPlugins(newBrowser);
    verify(browserCreatedPlugin).onBrowserCreated(newBrowser);

    assertThat(counterFor(OnBrowserCreatedPlugin.class), is(1));
  }
View Full Code Here


     */
    Thread shutdownThread = browserPool.close();

    // TODO Stefan; Now we "re-request" a browser instance for the PostCrawlingPlugins Thread,
    // this is not ideal...
    EmbeddedBrowser b = null;
    try {
      b = this.getBrowserPool().requestBrowser();
    } catch (InterruptedException e1) {
      LOGGER.warn("Re-Request for a browser was interrupted", e1);
    }
View Full Code Here

            .addPlugin(domChange).build(), new MetricRegistry());
  }

  @Test
  public void browserCreatedIsCalled() {
    EmbeddedBrowser newBrowser = mock(EmbeddedBrowser.class);
    plugins.runOnBrowserCreatedPlugins(newBrowser);
    verify(browserCreatedPlugin).onBrowserCreated(newBrowser);

    assertThat(counterFor(OnBrowserCreatedPlugin.class), is(1));
  }
View Full Code Here

   * Test get document from browser function.
   */
  @Test
  public void testGetDocumentFromBrowser() throws SAXException, IOException {
    // TODO Stefan; Refactor out the direct use of FirefoxDriver
    EmbeddedBrowser browser =
            WebDriverBackedEmbeddedBrowser.withDriver(new FirefoxDriver(),  ImmutableSortedSet.<String> of(), 200, 300);
    File index = new File(INDEX);
    String html = "";
    browser.goToUrl(new URL("file://" + index.getAbsolutePath()));
    html = browser.getStrippedDom();
    assertNotNull(html);

    Document doc = DomUtils.asDocument(html);
    assertNotNull(doc);

    browser.close();
    browser = null;

  }
View Full Code Here

     */
    Thread shutdownThread = browserPool.close();

    // TODO Stefan; Now we "re-request" a browser instance for the PostCrawlingPlugins Thread,
    // this is not ideal...
    EmbeddedBrowser b = null;
    try {
      b = this.getBrowserPool().requestBrowser();
    } catch (InterruptedException e1) {
      LOGGER.warn("Re-Request for a browser was interrupted", e1);
    }
View Full Code Here

     */
    Thread shutdownThread = browserPool.close();

    // TODO Stefan; Now we "re-request" a browser instance for the PostCrawlingPlugins Thread,
    // this is not ideal...
    EmbeddedBrowser b = null;
    try {
      b = this.getBrowserPool().requestBrowser();
    } catch (InterruptedException e1) {
      LOGGER.warn("Re-Request for a browser was interrupted", e1);
    }
View Full Code Here

TOP

Related Classes of com.crawljax.browser.EmbeddedBrowser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.