Package org.jacoco.report

Examples of org.jacoco.report.IReportVisitor.visitInfo()


  }

  @Test
  public void testStructureWithNestedGroups() throws Exception {
    final IReportVisitor visitor = formatter.createVisitor(output);
    visitor.visitInfo(infos, data);
    driver.sendNestedGroups(visitor);
    assertPathMatches("report", "/report/@name");
    assertPathMatches("group1", "/report/group[1]/@name");
    assertPathMatches("group", "/report/group[1]/group[1]/@name");
    assertPathMatches("bundle", "/report/group[1]/group[1]/group[1]/@name");
View Full Code Here


  }

  @Test
  public void testStructureWithGroup() throws Exception {
    final IReportVisitor visitor = formatter.createVisitor(output);
    visitor.visitInfo(infos, data);
    driver.sendGroup(visitor);
    assertPathMatches("group", "/report/@name");
    assertPathMatches("bundle", "/report/group/@name");
    assertPathMatches("org/jacoco/example", "/report/group/package/@name");
    assertPathMatches("org/jacoco/example/FooClass",
View Full Code Here

  }

  @Test
  public void testStructureWithBundleOnly() throws Exception {
    final IReportVisitor visitor = formatter.createVisitor(output);
    visitor.visitInfo(infos, data);
    driver.sendBundle(visitor);
    assertPathMatches("bundle", "/report/@name");
    assertPathMatches("org/jacoco/example", "/report/package/@name");
    assertPathMatches("org/jacoco/example/FooClass",
        "/report/package/class/@name");
View Full Code Here

  }

  @Test
  public void testDefaultEncoding() throws Exception {
    final IReportVisitor visitor = formatter.createVisitor(output);
    visitor.visitInfo(infos, data);
    driver.sendBundle(visitor);
    final BufferedReader reader = new BufferedReader(new InputStreamReader(
        output.getContentsAsStream(), "UTF-8"));
    final String line = reader.readLine();
    assertTrue(line,
View Full Code Here

  @Test
  public void testSetEncoding() throws Exception {
    formatter.setOutputEncoding("UTF-16");
    final IReportVisitor visitor = formatter.createVisitor(output);
    visitor.visitInfo(infos, data);
    driver.sendBundle(visitor);
    final BufferedReader reader = new BufferedReader(new InputStreamReader(
        output.getContentsAsStream(), "UTF-16"));
    final String line = reader.readLine();
    assertTrue(line,
View Full Code Here

        work * 2);
    final SessionAnalyzer analyzer = new SessionAnalyzer();
    final IJavaModelCoverage modelCoverage = analyzer.processSession(session,
        new SubProgressMonitor(monitor, work));
    final IReportVisitor formatter = createFormatter();
    formatter
        .visitInfo(analyzer.getSessionInfos(), analyzer.getExecutionData());
    final IReportGroupVisitor modelgroup = formatter.visitGroup(session
        .getDescription());
    for (IJavaProject project : modelCoverage.getProjects()) {
      final IReportGroupVisitor projectgroup = modelgroup.visitGroup(project
View Full Code Here

        work * 2);
    final SessionAnalyzer analyzer = new SessionAnalyzer();
    final IJavaModelCoverage modelCoverage = analyzer.processSession(session,
        new SubProgressMonitor(monitor, work));
    final IReportVisitor formatter = createFormatter();
    formatter
        .visitInfo(analyzer.getSessionInfos(), analyzer.getExecutionData());
    final IReportGroupVisitor modelgroup = formatter.visitGroup(session
        .getDescription());
    for (IJavaProject project : modelCoverage.getProjects()) {
      final IReportGroupVisitor projectgroup = modelgroup.visitGroup(project
View Full Code Here

        .createVisitor(new FileMultiReportOutput(reportDirectory));

    // Initialize the report with all of the execution and session
    // information. At this point the report doesn't know about the
    // structure of the report being created
    visitor.visitInfo(sessionInfoStore.getInfos(),
        executionDataStore.getContents());

    // Populate the report structure with the bundle coverage information.
    // Call visitGroup if you need groups in your report.
    visitor.visitBundle(bundleCoverage, new DirectorySourceFileLocator(
View Full Code Here

              + e.getMessage(), e);
      return;
    }
    try {
      final IReportVisitor visitor = createVisitor();
      visitor.visitInfo(sessionInfoStore.getInfos(),
          executionDataStore.getContents());
      createReport(visitor);
      visitor.visitEnd();
    } catch (final Exception e) {
      getLog().error("Error while creating report: " + e.getMessage(), e);
View Full Code Here

  @Override
  public void execute() throws BuildException {
    loadExecutionData();
    try {
      final IReportVisitor visitor = createVisitor();
      visitor.visitInfo(sessionInfoStore.getInfos(),
          executionDataStore.getContents());
      createReport(visitor, structure);
      visitor.visitEnd();
    } catch (final IOException e) {
      throw new BuildException("Error while creating report.", e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.