Package org.jacoco.core.analysis

Examples of org.jacoco.core.analysis.ICounter


        node.getSignature(), node.getSuperName(),
        node.getInterfaceNames());
    writer.write(className);

    for (final CounterEntity entity : COUNTERS) {
      final ICounter counter = node.getCounter(entity);
      writer.write(counter.getMissedCount());
      writer.write(counter.getCoveredCount());
    }

    writer.nextLine();
  }
View Full Code Here


    // Report result:
    coverage.ensureCapacity(firstLine, lastLine);
    for (final Instruction i : instructions) {
      final int total = i.getBranches();
      final int covered = i.getCoveredBranches();
      final ICounter instructions = covered == 0 ? CounterImpl.COUNTER_1_0
          : CounterImpl.COUNTER_0_1;
      final ICounter branches = total > 1 ? CounterImpl.getInstance(total
          - covered, covered) : CounterImpl.COUNTER_0_0;
      coverage.increment(instructions, branches, i.getLine());
    }
    coverage.incrementMethodCounter();
  }
View Full Code Here

    // Report result:
    coverage.ensureCapacity(firstLine, lastLine);
    for (final Instruction i : instructions) {
      final int total = i.getBranches();
      final int covered = i.getCoveredBranches();
      final ICounter instrCounter = covered == 0 ? CounterImpl.COUNTER_1_0
          : CounterImpl.COUNTER_0_1;
      final ICounter branchCounter = total > 1 ? CounterImpl.getInstance(
          total - covered, covered) : CounterImpl.COUNTER_0_0;
      coverage.increment(instrCounter, branchCounter, i.getLine());
    }
    coverage.incrementMethodCounter();
  }
View Full Code Here

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

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

    // Report result:
    coverage.ensureCapacity(firstLine, lastLine);
    for (final Instruction i : instructions) {
      final int total = i.getBranches();
      final int covered = i.getCoveredBranches();
      final ICounter instrCounter = covered == 0 ? CounterImpl.COUNTER_1_0
          : CounterImpl.COUNTER_0_1;
      final ICounter branchCounter = total > 1 ? CounterImpl.getInstance(
          total - covered, covered) : CounterImpl.COUNTER_0_0;
      coverage.increment(instrCounter, branchCounter, i.getLine());
    }
    coverage.incrementMethodCounter();
  }
View Full Code Here

    final String className = languageNames.getClassName(node.getName());
    writer.write(className);

    for (final CounterEntity entity : CsvReportFile.COUNTERS) {

      final ICounter counter = node.getCounter(entity);
      writer.write(counter.getCoveredCount());
      writer.write(counter.getNotCoveredCount());
    }

    writer.nextLine();
  }
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

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

  }

  @Test
  public void testTwoIf1() throws Exception {
    instrument(TwoIf.class);
    final ICounter complexity = analyze();
    assertEquals(CounterImpl.getInstance(3, 0), 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.