Package com.crawljax.core.configuration

Examples of com.crawljax.core.configuration.CrawljaxConfiguration


   */
  public void setup() throws Exception {
    webServer.start();
    crawlSpec = new CrawlSpecification(getUrl());
    crawlSpec.clickDefaultElements();
    config = new CrawljaxConfiguration();
    config.setCrawlSpecification(crawlSpec);
    hasSetup.set(true);
  }
View Full Code Here


  public void testExtract() throws InterruptedException, CrawljaxException {
    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration.builderFor(DEMO_SITE_SERVER.getSiteUrl().toExternalForm());
    builder.crawlRules().click("a");
    builder.crawlRules().clickOnce(true);
    CrawljaxConfiguration config = builder.build();

    CandidateElementExtractor extractor = newElementExtractor(config);
    browser.goToUrl(DEMO_SITE_SERVER.getSiteUrl());
    List<CandidateElement> candidates = extractor.extract(DUMMY_STATE);
View Full Code Here

    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration.builderFor(DEMO_SITE_SERVER.getSiteUrl().toExternalForm());
    builder.crawlRules().click("a");
    builder.crawlRules().dontClick("div").withAttribute("id", "menubar");
    builder.crawlRules().clickOnce(true);
    CrawljaxConfiguration config = builder.build();

    CandidateElementExtractor extractor = newElementExtractor(config);
    browser.goToUrl(DEMO_SITE_SERVER.getSiteUrl());

    List<CandidateElement> candidates = extractor.extract(DUMMY_STATE);
View Full Code Here

    RunWithWebServer server = new RunWithWebServer("/site");
    server.before();
    CrawljaxConfigurationBuilder builder = CrawljaxConfiguration
            .builderFor(server.getSiteUrl().toExternalForm() + "iframe/");
    builder.crawlRules().click("a");
    CrawljaxConfiguration config = builder.build();

    CandidateElementExtractor extractor = newElementExtractor(config);
    browser.goToUrl(new URL(server.getSiteUrl().toExternalForm() + "iframe/"));
    List<CandidateElement> candidates = extractor.extract(DUMMY_STATE);
View Full Code Here

  @Test
  public void whenNoFollowExternalUrlDoNotFollow() throws IOException {
    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration.builderFor("http://example.com");
    builder.crawlRules().click("a");
    CrawljaxConfiguration config = builder.build();
    CandidateElementExtractor extractor = newElementExtractor(config);

    List<CandidateElement> extract = extractFromTestFile(extractor);

    assertThat(config.getCrawlRules().followExternalLinks(), is(false));
    assertThat(extract, hasSize(2));
  }
View Full Code Here

  public void whenFollowExternalUrlDoFollow() throws IOException {
    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration.builderFor("http://example.com");
    builder.crawlRules().click("a");
    builder.crawlRules().followExternalLinks(true);
    CrawljaxConfiguration config = builder.build();
    CandidateElementExtractor extractor = newElementExtractor(config);

    List<CandidateElement> extract = extractFromTestFile(extractor);

    assertThat(config.getCrawlRules().followExternalLinks(), is(true));
    assertThat(extract, hasSize(3));
  }
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {
    CrawljaxConfiguration config = new CrawljaxConfiguration();
    CrawlSpecification crawler = new CrawlSpecification(URL);
    crawler.setMaximumStates(5);
    crawler.clickDefaultElements();
    config.setCrawlSpecification(crawler);
    config.addPlugin(new CrawlOverview());
    try {
      CrawljaxController crawljax = new CrawljaxController(config);
      crawljax.run();
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

    when(formHandlerFactory.newFormHandler(browser)).thenReturn(formHandler);
    url = new URL("http://example.com");
    when(browser.getCurrentUrl()).thenReturn(url.toExternalForm());
    when(sessionProvider.get()).thenReturn(session);

    CrawljaxConfiguration config = Mockito.spy(CrawljaxConfiguration.builderFor(url).build());
    stateComparator = new StateComparator(config.getCrawlRules());

    when(extractor.extract(target)).thenReturn(ImmutableList.of(action));
    when(graphProvider.get()).thenReturn(graph);

    context =
View Full Code Here

  public void testExtract() throws InterruptedException, CrawljaxException {
    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration.builderFor(DEMO_SITE_SERVER.getSiteUrl());
    builder.crawlRules().click("a");
    builder.crawlRules().clickOnce(true);
    CrawljaxConfiguration config = builder.build();

    CandidateElementExtractor extractor = newElementExtractor(config);
    browser.goToUrl(DEMO_SITE_SERVER.getSiteUrl());
    List<CandidateElement> candidates = extractor.extract(DUMMY_STATE);
View Full Code Here

    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration.builderFor(DEMO_SITE_SERVER.getSiteUrl());
    builder.crawlRules().click("a");
    builder.crawlRules().dontClick("div").withAttribute("id", "menubar");
    builder.crawlRules().clickOnce(true);
    CrawljaxConfiguration config = builder.build();

    CandidateElementExtractor extractor = newElementExtractor(config);
    browser.goToUrl(DEMO_SITE_SERVER.getSiteUrl());

    List<CandidateElement> candidates = extractor.extract(DUMMY_STATE);
View Full Code Here

TOP

Related Classes of com.crawljax.core.configuration.CrawljaxConfiguration

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.