Package org.jacoco.core.analysis

Examples of org.jacoco.core.analysis.ILine


    final int firstLine = child.getFirstLine();
    if (firstLine != UNKNOWN_LINE) {
      final int lastLine = child.getLastLine();
      ensureCapacity(firstLine, lastLine);
      for (int i = firstLine; i <= lastLine; i++) {
        final ILine line = child.getLine(i);
        incrementLine(line.getInstructionCounter(),
            line.getBranchCounter(), i);
      }
    }
  }
View Full Code Here


  }

  @Override
  public boolean equals(final Object obj) {
    if (obj instanceof ILine) {
      final ILine that = (ILine) obj;
      return this.instructions.equals(that.getInstructionCounter())
          && this.branches.equals(that.getBranchCounter());
    }
    return false;
  }
View Full Code Here

  private static void writeLines(final ISourceNode source,
      final XMLElement parent) throws IOException {
    final int last = source.getLastLine();
    for (int nr = source.getFirstLine(); nr <= last; nr++) {
      final ILine line = source.getLine(nr);
      if (line.getStatus() != ICounter.EMPTY) {
        final XMLElement element = parent.element("line");
        element.attr("nr", nr);
        writeCounter(element, "mi", "ci", line.getInstructionCounter());
        writeCounter(element, "mb", "cb", line.getBranchCounter());
      }
    }
  }
View Full Code Here

    sourceCoverage = files.iterator().next();
  }

  protected void assertLine(final String tag, final int status) {
    final int nr = source.getLineNumber(tag);
    final ILine line = sourceCoverage.getLine(nr);
    final String msg = String.format("Status in line %s: %s",
        Integer.valueOf(nr), source.getLine(nr));
    final int insnStatus = line.getInstructionCounter().getStatus();
    assertEquals(msg, STATUS_NAME[status], STATUS_NAME[insnStatus]);
  }
View Full Code Here

  }

  protected void assertLine(final String tag, final int missedBranches,
      final int coveredBranches) {
    final int nr = source.getLineNumber(tag);
    final ILine line = sourceCoverage.getLine(nr);
    final String msg = String.format("Branches in line %s: %s",
        Integer.valueOf(nr), source.getLine(nr));
    assertEquals(msg + " branches",
        CounterImpl.getInstance(missedBranches, coveredBranches),
        line.getBranchCounter());
  }
View Full Code Here

    result = analyzer.getCoverage();
  }

  private void assertLine(int nr, int insnMissed, int insnCovered,
      int branchesMissed, int branchesCovered) {
    final ILine line = result.getLine(nr);
    assertEquals("Instructions in line " + nr,
        CounterImpl.getInstance(insnMissed, insnCovered),
        line.getInstructionCounter());
    assertEquals("Branches in line " + nr,
        CounterImpl.getInstance(branchesMissed, branchesCovered),
        line.getBranchCounter());
  }
View Full Code Here

    final int firstline = linecoverage.getFirstLine();
    final int lastline = Math.min(linecoverage.getLastLine(),
        document.getNumberOfLines());
    try {
      for (int l = firstline; l <= lastline; l++) {
        final ILine line = linecoverage.getLine(l);
        if (line.getStatus() != ICounter.EMPTY) {
          final IRegion region = document.getLineInformation(l - 1);
          final CoverageAnnotation ca = new CoverageAnnotation(
              region.getOffset(), region.getLength(), line);
          annotations.add(ca);
          event.annotationAdded(ca);
View Full Code Here

TOP

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

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.