Package org.jacoco.core.analysis

Examples of org.jacoco.core.analysis.ICoverageNode


    assertEquals("el_group", support.findStr(doc,
        "/html/body/table/tr/td/a/@class"));
  }

  private ICoverageTableItem createItem(final String name, final String link) {
    final ICoverageNode node = new CoverageNodeImpl(ElementType.GROUP,
        name, false);
    return new ICoverageTableItem() {
      public String getLabel() {
        return name;
      }
View Full Code Here


    assertEquals("E",
        support.findStr(doc, "/html/body/table/tbody/tr[5]/td[1]"));
  }

  private ITableItem createItem(final String name, final int count) {
    final ICoverageNode node = new CoverageNodeImpl(ElementType.GROUP, name) {
      {
        this.classCounter = CounterImpl.getInstance(count, 0);
      }
    };
    return new ITableItem() {
      public String getLinkLabel() {
        return name;
      }

      public String getLink(ReportOutputFolder base) {
        return name + ".html";
      }

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

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

    final Document doc = support.parse(output.getFile("Test.html"));
    assertEquals("n/a", 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

  public void testSessionInfo() throws Exception {
    final List<SessionInfo> infos = new ArrayList<SessionInfo>();
    infos.add(new SessionInfo("session-1", 12345, 67890));
    infos.add(new SessionInfo("session-2", 1, 2));
    infos.add(new SessionInfo("session-3", 1, 2));
    ICoverageNode node = new CoverageNodeImpl(ElementType.GROUP, "Sample",
        false);
    final Collection<ExecutionData> data = Collections.emptyList();
    formatter.createReportVisitor(node, infos, data).visitEnd(null);
    assertPathMatches("session-1", "/report/sessioninfo[1]/@id");
    assertPathMatches("12345", "/report/sessioninfo[1]/@start");
View Full Code Here

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

  private ITableItem createItem(final int total, final int covered) {
    final ICoverageNode node = createNode(total, 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 total, final int covered) {
    final ICoverageNode node = createNode(total, 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("E",
        support.findStr(doc, "/html/body/table/tbody/tr[5]/td[1]"));
  }

  private ITableItem createItem(final String name, final int count) {
    final ICoverageNode node = new CoverageNodeImpl(ElementType.GROUP,
        name, false) {
      {
        this.classCounter = CounterImpl.getInstance(count, false);
      }
    };
    return new ITableItem() {
      public String getLinkLabel() {
        return name;
      }

      public String getLink(ReportOutputFolder base) {
        return name + ".html";
      }

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

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

    final Document doc = support.parse(output.getFile("Test.html"));
    assertEquals("n/a", 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

    viewer.addFilter(new ViewerFilter() {
      public boolean select(Viewer viewer, Object parentElement, Object element) {
        if (element == LOADING_ELEMENT) {
          return true;
        } else {
          final ICoverageNode c = CoverageTools.getCoverageInfo(element);
          if (c == null) {
            return false;
          }
          final ICounter instructions = c.getInstructionCounter();
          if (instructions.getTotalCount() == 0) {
            return false;
          }
          if (settings.getHideUnusedElements()
              && instructions.getCoveredCount() == 0) {
View Full Code Here

    return false;
  }

  private ISourceNode findSourceCoverageForElement(Object element) {
    // Do we have a coverage info for the editor input?
    ICoverageNode coverage = CoverageTools.getCoverageInfo(element);
    if (coverage == null) {
      return null;
    }

    // TODO check resource timestamp
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.