Package org.jacoco.core.analysis

Examples of org.jacoco.core.analysis.CoverageNodeImpl


  }

  @Test
  public void testMethod() throws Exception {
    final IReportVisitor packageHandler = handler
        .visitChild(new CoverageNodeImpl(ElementType.PACKAGE,
            "org.jacoco.example"));
    final IReportVisitor classHandler = packageHandler
        .visitChild(new SourceNodeImpl(ElementType.CLASS, "Foo"));
    MethodCoverageImpl node = new MethodCoverageImpl("doit", "()V", null);
    node.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 15);
View Full Code Here


  }

  @Test
  public void testSourcefile() throws Exception {
    final IReportVisitor packageHandler = handler
        .visitChild(new CoverageNodeImpl(ElementType.PACKAGE,
            "org.jacoco.example"));
    final SourceNodeImpl node = new SourceNodeImpl(ElementType.SOURCEFILE,
        "Foo.java");
    node.increment(CounterImpl.getInstance(1, 2),
        CounterImpl.getInstance(3, 4), 12);
View Full Code Here

        lines.get(1));
  }

  @Test
  public void testStructureWithNestedGroups() throws IOException {
    final ICoverageNode root = new CoverageNodeImpl(ElementType.GROUP,
        "root", false);
    final IReportVisitor child = formatter.createReportVisitor(root);
    driver.sendGroup(child);
    driver.sendGroup(child);
    child.visitEnd(driver.sourceFileLocator);
View Full Code Here

      public String getOutputEncoding() {
        return "UTF-8";
      }
    };
    ReportPage parent = new TestReportPage(new CoverageNodeImpl(
        ElementType.SESSION, "Session", false), null);
    node = new CoverageNodeImpl(ElementType.GROUP, "Test", false);
    page = new TestReportPage(node, parent);
  }
View Full Code Here

  }

  private void createReport(final GroupElement group,
      final IReportFormatter formatter,
      final ExecutionDataStore executionData) throws IOException {
    final CoverageNodeImpl node = createNode(group, executionData);
    final IReportVisitor visitor = formatter.createReportVisitor(node);
    final SourceFileCollection sourceFileLocator = new SourceFileCollection(
        group.sourcefiles);
    if (node instanceof BundleCoverage) {
      visitBundle(visitor, (BundleCoverage) node, sourceFileLocator);
View Full Code Here

  private void createReport(final GroupElement group,
      final IReportVisitor parentVisitor,
      final CoverageNodeImpl parentNode,
      final ExecutionDataStore executionData) throws IOException {
    final CoverageNodeImpl node = createNode(group, executionData);
    final IReportVisitor visitor = parentVisitor.visitChild(node);
    final SourceFileCollection sourceFileLocator = new SourceFileCollection(
        group.sourcefiles);
    if (node instanceof BundleCoverage) {
      visitBundle(visitor, (BundleCoverage) node, sourceFileLocator);
View Full Code Here

      final ExecutionDataStore executionData) throws IOException {
    if (group.name == null) {
      throw new BuildException("Group name must be supplied");
    }
    if (group.children.size() > 0) {
      return new CoverageNodeImpl(ElementType.GROUP, group.name, false);
    } else {
      final CoverageBuilder builder = new CoverageBuilder(executionData);
      final Analyzer analyzer = new Analyzer(builder);
      for (final Iterator<?> i = group.classfiles.iterator(); i.hasNext();) {
        final Resource resource = (Resource) i.next();
View Full Code Here

      }
    };
  }

  private CoverageNodeImpl createNode(final int missed, final int covered) {
    return new CoverageNodeImpl(ElementType.GROUP, "Foo") {
      {
        this.lineCounter = CounterImpl.getInstance(missed, covered);
      }
    };
  }
View Full Code Here

    assertEquals("C", support.findStr(doc,
        "/html/body/table/tbody/tr[3]/td/text()"));
  }

  private ICoverageTableItem createItem(final String name, final int count) {
    final ICoverageNode node = new CoverageNodeImpl(ElementType.GROUP,
        name, false) {
      {
        this.classCounter = CounterImpl.getInstance(count, false);
      }
    };
View Full Code Here

      }
    };
  }

  private ICoverageNode createTotal(final String name, final int count) {
    return new CoverageNodeImpl(ElementType.GROUP, name, false) {
      {
        this.classCounter = CounterImpl.getInstance(count, false);
      }
    };
  }
View Full Code Here

TOP

Related Classes of org.jacoco.core.analysis.CoverageNodeImpl

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.