Package org.jacoco.core.analysis

Examples of org.jacoco.core.analysis.ICoverageNode


        lines.get(1));
  }

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


    column.setText(caption);
    column.setWidth(convertWidthInCharsToPixels(width));
  }

  private Line[] getLines() {
    ICoverageNode c = CoverageTools.getCoverageInfo(getElement());
    if (c == null) {
      return new Line[0];
    } else {
      return new Line[] {
          new Line(UIMessages.CoveragePropertyPageInstructions_label,
              c.getInstructionCounter()),
          new Line(UIMessages.CoveragePropertyPageBranches_label,
              c.getBranchCounter()),
          new Line(UIMessages.CoveragePropertyPageLines_label,
              c.getLineCounter()),
          new Line(UIMessages.CoveragePropertyPageMethods_label,
              c.getMethodCounter()),
          new Line(UIMessages.CoveragePropertyPageTypes_label,
              c.getClassCounter()),
          new Line(UIMessages.CoveragePropertyPageComplexity_label,
              c.getComplexityCounter()) };
    }
  }
View Full Code Here

    assertEquals("120", support.findStr(doc,
        "/html/body/table/tr[1]/td/img[1]/@width"));
  }

  private ICoverageTableItem createItem(final int total, final int covered) {
    final ICoverageNode node = createNode(total, covered);
    return new ICoverageTableItem() {
      public String getLabel() {
        return "Foo";
      }
View Full Code Here

    final Document doc = support.parse(output.getFile("Test.html"));
    assertEquals("", support.findStr(doc, "/html/body/table/tr"));
  }

  private ICoverageTableItem createItem(final int total, final int covered) {
    final ICoverageNode node = createNode(total, covered);
    return new ICoverageTableItem() {
      public String getLabel() {
        return "Foo";
      }
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

    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

        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

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

  @Test
  public void testEmptyClass() {
    ICoverageNode data = new ClassCoverageImpl("Sample", 0, false, 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

    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

    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.