Package org.jacoco.core.analysis

Examples of org.jacoco.core.analysis.ICoverageNode


    // then find the coverage information from the current session
    IJavaModelCoverage mc = CoverageTools.getJavaModelCoverage();
    if (mc == null) {
      return null;
    } else {
      ICoverageNode coverage = mc.getCoverageFor((IJavaElement) object);
      if (adapterType.isInstance(coverage)) {
        return coverage;
      } else {
        return null;
      }
View Full Code Here


    assertEquals(0, c.compare(i1, i1));
    doc.close();
  }

  private ITableItem createItem(final int missed, final int covered) {
    final ICoverageNode node = createNode(missed, covered);
    return new ITableItem() {
      public String getLinkLabel() {
        return "Foo";
      }

      public String getLink(ReportOutputFolder base) {
        return null;
      }

      public String getLinkStyle() {
        return Resources.getElementStyle(node.getElementType());
      }

      public ICoverageNode getNode() {
        return node;
      }
View Full Code Here

    assertEquals("org/jacoco/examples", data.getPackageName());
  }

  @Test
  public void testEmptyClass() {
    ICoverageNode data = new ClassCoverageImpl("Sample", 0, null,
        "java/lang/Object", new String[0]);
    assertEquals(CounterImpl.COUNTER_0_0, data.getInstructionCounter());
    assertEquals(CounterImpl.COUNTER_0_0, data.getBranchCounter());
    assertEquals(CounterImpl.COUNTER_0_0, data.getMethodCounter());
    assertEquals(CounterImpl.COUNTER_1_0, data.getClassCounter());
  }
View Full Code Here

        node.getSignature());
  }

  @Test
  public void testEmptyMethod() {
    ICoverageNode node = new MethodCoverageImpl("sample", "()V", null);

    assertEquals(CounterImpl.COUNTER_0_0, node.getInstructionCounter());
    assertEquals(CounterImpl.COUNTER_0_0, node.getBranchCounter());
    assertEquals(CounterImpl.COUNTER_0_0, node.getLineCounter());
    assertEquals(CounterImpl.COUNTER_0_0, node.getComplexityCounter());
    assertEquals(CounterImpl.COUNTER_0_0, node.getMethodCounter());
    assertEquals(CounterImpl.COUNTER_0_0, node.getClassCounter());
  }
View Full Code Here

  public IReportVisitor visitChild(final ICoverageNode node)
      throws IOException {

    if (node.getElementType() != ElementType.GROUP) {
      final ICoverageNode emptyCoverage = new CoverageNodeImpl(
          ElementType.GROUP, "", false);
      final GroupColumn dummy = new GroupColumn(this, emptyCoverage);
      return new BundleColumn(this, dummy, node);
    }
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

        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

    assertEquals(0, c.compare(i1, i1));
    doc.close();
  }

  private ITableItem createItem(final int missed, final int covered) {
    final ICoverageNode node = createNode(missed, covered);
    return new ITableItem() {
      public String getLinkLabel() {
        return "Foo";
      }

      public String getLink(ReportOutputFolder base) {
        return null;
      }

      public String getLinkStyle() {
        return Resources.getElementStyle(node.getElementType());
      }

      public ICoverageNode getNode() {
        return node;
      }
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

    assertTrue(c.compare(i2, i1) < 0);
    doc.close();
  }

  private ITableItem createItem(final int missed, final int covered) {
    final ICoverageNode node = createNode(missed, covered);
    return new ITableItem() {
      public String getLinkLabel() {
        return "Foo";
      }

      public String getLink(ReportOutputFolder base) {
        return null;
      }

      public String getLinkStyle() {
        return Resources.getElementStyle(node.getElementType());
      }

      public ICoverageNode getNode() {
        return node;
      }
View Full Code Here

TOP

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

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.