Package org.jacoco.core.analysis

Examples of org.jacoco.core.analysis.ICoverageNode


    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

    };
    CoverageTools.addJavaCoverageListener(coverageListener);
  }

  public void decorate(Object element, IDecoration decoration) {
    final ICoverageNode coverage = CoverageTools.getCoverageInfo(element);
    if (coverage == null) {
      // no coverage data
      return;
    }
    // TODO obtain counter from preferences
    ICounter counter = coverage.getInstructionCounter();
    ImageDescriptor overlay = EclEmmaUIPlugin.getCoverageOverlay(counter
        .getCoveredRatio());
    decoration.addOverlay(overlay, IDecoration.TOP_LEFT);
    decoration.addSuffix(SUFFIX_FORMAT.format(Double.valueOf(counter
        .getCoveredRatio())));
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

    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

    assertTrue(column.getComparator().compare(i2, i1) > 0);
    doc.close();
  }

  private ITableItem createItem(final String name, final String link) {
    final ICoverageNode node = new CoverageNodeImpl(ElementType.GROUP,
        name, false);
    return new ITableItem() {
      public String getLinkLabel() {
        return name;
      }

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

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

      public ICoverageNode getNode() {
        return node;
      }
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(column.getComparator().compare(i2, i1) > 0);
    doc.close();
  }

  private ITableItem createItem(final String name, final String link) {
    final ICoverageNode node = new CoverageNodeImpl(ElementType.GROUP, name);
    return new ITableItem() {
      public String getLinkLabel() {
        return name;
      }

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

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

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

  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");
    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");
    assertPathMatches("67890", "/report/sessioninfo[1]/@dump");
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.