Package org.jacoco.core.analysis

Examples of org.jacoco.core.analysis.CoverageNodeImpl


      return name + children;
    }
  }

  private CoverageNodeImpl createNode(String name) {
    return new CoverageNodeImpl(ElementType.GROUP, name, false);
  }
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

  }

  private CoverageNodeImpl createNode(final GroupElement group,
      final ExecutionDataStore executionData) throws IOException {
    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

        lines.get(1));
  }

  @Test
  public void testStructureWithNestedGroups() throws IOException {
    final ICoverageNode root = new CoverageNodeImpl(ElementType.GROUP,
        "root", false);
    final List<SessionInfo> sessions = Collections.emptyList();
    final Collection<ExecutionData> data = Collections.emptyList();
    final IReportVisitor child = formatter.createReportVisitor(root,
        sessions, data);
View Full Code Here

  public void setup() throws Exception {
    buffer = new StringWriter();
    support = new XMLSupport(XMLFormatter.class);
    root = new XMLDocument("report", "-//JACOCO//DTD Report 1.0//EN",
        "report.dtd", "UTF-8", true, buffer);
    handler = new XMLReportNodeHandler(root, new CoverageNodeImpl(
        ElementType.GROUP, "Sample"));
  }
View Full Code Here

    assertEquals("Sample", support.findStr(doc, "//report/@name"));
  }

  @Test
  public void testGroup() throws Exception {
    handler.visitChild(new CoverageNodeImpl(ElementType.GROUP, "Group1"))
        .visitEnd(null);
    final Document doc = getDocument();
    assertEquals("Group1", support.findStr(doc, "//report/group/@name"));
  }
View Full Code Here

    assertEquals("Group1", support.findStr(doc, "//report/group/@name"));
  }

  @Test
  public void testCounters() throws Exception {
    final CoverageNodeImpl node = new CoverageNodeImpl(ElementType.GROUP,
        "Group1") {
      {
        classCounter = CounterImpl.getInstance(9, 1);
        methodCounter = CounterImpl.getInstance(18, 2);
        branchCounter = CounterImpl.getInstance(27, 3);
View Full Code Here

  }

  @Test
  public void testPackage() throws Exception {
    handler.visitChild(
        new CoverageNodeImpl(ElementType.PACKAGE, "org.jacoco.example"))
        .visitEnd(null);
    final Document doc = getDocument();
    assertEquals("org.jacoco.example",
        support.findStr(doc, "//report/package/@name"));
  }
View Full Code Here

  }

  @Test
  public void testClass() throws Exception {
    final IReportVisitor packageHandler = handler
        .visitChild(new CoverageNodeImpl(ElementType.PACKAGE,
            "org.jacoco.example"));
    packageHandler.visitChild(new SourceNodeImpl(ElementType.CLASS, "Foo"))
        .visitEnd(null);
    packageHandler.visitEnd(null);
    final Document doc = getDocument();
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.