Package org.jacoco.core.analysis

Examples of org.jacoco.core.analysis.ICounter


  public void testSwitch4() throws Exception {
    instrument(Switch.class);
    target.test(0);
    target.test(1);
    target.test(2);
    final ICounter complexity = analyze();
    assertEquals(CounterImpl.getInstance(0, 3), complexity);
  }
View Full Code Here


  public void item(final HTMLElement tr, final ICoverageTableItem item,
      final Resources resources, final ReportOutputFolder base)
      throws IOException {
    final HTMLElement td = tr.td();
    if (max > 0) {
      final ICounter counter = item.getNode().getCounter(entity);
      final int notCovered = counter.getNotCoveredCount();
      bar(td, notCovered, Resources.REDBAR, resources, base);
      final int covered = counter.getCoveredCount();
      bar(td, covered, Resources.GREENBAR, resources, base);
    }
  }
View Full Code Here

  }

  public void footer(final HTMLElement td, final ICoverageNode total,
      final Resources resources, final ReportOutputFolder base)
      throws IOException {
    final ICounter counter = total.getCounter(entity);
    td.text(integerFormat.format(counter.getMissedCount())).text(" of ")
        .text(integerFormat.format(counter.getTotalCount()));
  }
View Full Code Here

  public void item(final HTMLElement td, final ITableItem item,
      final Resources resources, final ReportOutputFolder base)
      throws IOException {
    if (max > 0) {
      final ICounter counter = item.getNode().getCounter(entity);
      final int missed = counter.getMissedCount();
      bar(td, missed, Resources.REDBAR, resources, base);
      final int covered = counter.getCoveredCount();
      bar(td, covered, Resources.GREENBAR, resources, base);
    }
  }
View Full Code Here

    cell(td, item.getNode());
  }

  private void cell(final HTMLElement td, final ICoverageNode node)
      throws IOException {
    final ICounter counter = node.getCounter(entity);
    final int total = counter.getTotalCount();
    if (total == 0) {
      td.text("n/a");
    } else {
      td.text(percentageFormat.format(counter.getCoveredRatio()));
    }
  }
View Full Code Here

    default:
      return pre;
    }

    final String lineId = "L" + Integer.toString(lineNr);
    final ICounter branches = line.getBranchCounter();
    switch (branches.getStatus()) {
    case ICounter.NOT_COVERED:
      return span(pre, lineId, style, Styles.BRANCH_NOT_COVERED,
          "All %2$d branches missed.", branches);
    case ICounter.FULLY_COVERED:
      return span(pre, lineId, style, Styles.BRANCH_FULLY_COVERED,
View Full Code Here

  }

  @Test
  public void testSimple1() throws Exception {
    instrument(Simple.class);
    final ICounter complexity = analyze();
    assertEquals(CounterImpl.getInstance(1, 0), complexity);
  }
View Full Code Here

  @Test
  public void testSimple2() throws Exception {
    instrument(Simple.class);
    target.test(0);
    final ICounter complexity = analyze();
    assertEquals(CounterImpl.getInstance(0, 1), complexity);
  }
View Full Code Here

  }

  @Test
  public void testIf1() throws Exception {
    instrument(If.class);
    final ICounter complexity = analyze();
    assertEquals(CounterImpl.getInstance(2, 0), complexity);
  }
View Full Code Here

  @Test
  public void testIf2() throws Exception {
    instrument(If.class);
    target.test(0);
    final ICounter complexity = analyze();
    assertEquals(CounterImpl.getInstance(1, 1), complexity);
  }
View Full Code Here

TOP

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

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.