Package com.crawljax.core.state

Examples of com.crawljax.core.state.StateFlowGraph


      LOG.debug("Domain espace was {}", e.getMessage());
    }
  }

  private ImmutableList<Eventable> shortestPathTo(StateVertex crawlTask) {
    StateFlowGraph graph = context.getSession().getStateFlowGraph();
    return graph.getShortestPath(graph.getInitialState(), crawlTask);
  }
View Full Code Here


      LOG.debug("Domain espace was {}", e.getMessage());
    }
  }

  private ImmutableList<Eventable> shortestPathTo(StateVertex crawlTask) {
    StateFlowGraph graph = context.getSession().getStateFlowGraph();
    return graph.getShortestPath(graph.getInitialState(), crawlTask);
  }
View Full Code Here

      visitedStates.add(currentState.getName());
    }
  }

  private void generateOverviewReport() {
    StateFlowGraph sfg = session.getStateFlowGraph();
    try {
      createNeededJavaScriptFiles();
      writeIndexFile();
    } catch (IOException e) {
      LOGGER.error(e.getMessage(), e);
    } catch (Exception e) {
      LOGGER.error(e.getMessage(), e);
    }

    for (StateVertix state : sfg.getAllStates()) {
      List<RenderedCandidateElement> rendered = stateCandidatesMap.get(state.getName());
      try {
        writeHtmlForState(state, rendered);
      } catch (Exception e) {
        LOGGER.error(e.getMessage(), e);
View Full Code Here

    LOGGER.info("Overview report generated: " + indexFile.getAbsolutePath());
  }

  private Eventable getEventableByCandidateElementInState(StateVertix state,
          RenderedCandidateElement element) {
    StateFlowGraph sfg = session.getStateFlowGraph();
    for (Eventable eventable : sfg.getOutgoingClickables(state)) {
      // TODO Check if element.getIdentification().getValue() is correct replacement for
      // element.getXpath()
      if (eventable.getIdentification().getValue()
              .equals(element.getIdentification().getValue())) {
        return eventable;
View Full Code Here

  }

  private void writeIndexFile() throws Exception {
    String fileName = getIndexFileName();
    Helper.checkFolderForFile(fileName);
    StateFlowGraph sfg = session.getStateFlowGraph();
    String template = Helper.getTemplateAsString(RESOURCES_FOLDER + TEMPLATE_INDEX);
    VelocityContext context = new VelocityContext();
    context.put("headerheight", HEADER_SIZE);

    context.put("eventables", getEventables(sfg));
View Full Code Here

  private void writeHtmlForState(StateVertix state, List<RenderedCandidateElement> rendered)
          throws Exception {
    String fileName = getStateFileName(state);
    Helper.checkFolderForFile(fileName);
    StateFlowGraph sfg = session.getStateFlowGraph();

    String template = Helper.getTemplateAsString(RESOURCES_FOLDER + TEMPLATE_STATE);
    VelocityContext context = new VelocityContext();
    context.put("name", state.getName());
    context.put("screenshot", "../" + SCREENSHOTS_FOLDER + state.getName() + ".png");
View Full Code Here

public class SampleCrawlersTest {

  @Test
  public void testSimpleCrawler() throws Exception {
    CrawlSession crawl = new SimpleSiteCrawl().crawl();
    StateFlowGraph stateFlowGraph = crawl.getStateFlowGraph();
    assertThat(stateFlowGraph, hasStates(SimpleSiteCrawl.NUMBER_OF_STATES));
    assertThat(stateFlowGraph, hasEdges(SimpleSiteCrawl.NUMBER_OF_EDGES));
  }
View Full Code Here

  }

  @Test
  public void testJSCrawler() throws Exception {
    CrawlSession crawl = new SimpleJsSiteCrawl().crawl();
    StateFlowGraph stateFlowGraph = crawl.getStateFlowGraph();
    assertThat(stateFlowGraph, hasStates(SimpleJsSiteCrawl.NUMBER_OF_STATES));
    assertThat(stateFlowGraph, hasEdges(SimpleJsSiteCrawl.NUMBER_OF_EDGES));
  }
View Full Code Here

  @Test
  public void testInputCrawler() throws Exception {
    // new SimpleInputSiteCrawl().showWebSite();
    CrawlSession crawl = new SimpleInputSiteCrawl().crawl();
    StateFlowGraph stateFlowGraph = crawl.getStateFlowGraph();
    assertThat(stateFlowGraph, hasStates(SimpleInputSiteCrawl.NUMBER_OF_STATES));
    assertThat(stateFlowGraph, hasEdges(SimpleInputSiteCrawl.NUMBER_OF_EDGES));
  }
View Full Code Here

        builder.crawlRules().crawlHiddenAnchors(true);
        return builder;
      }
    }.crawl();

    StateFlowGraph stateFlowGraph = crawl.getStateFlowGraph();
    /*
     * TODO Fix issue #97 https://github.com/crawljax/crawljax/issues/97 It is now party hacked
     * by following HREF links.
     */
    int withIssue97 = 3 - 1;
View Full Code Here

TOP

Related Classes of com.crawljax.core.state.StateFlowGraph

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.