当前位置: 首页>>代码示例>>Java>>正文


Java ICounter.EMPTY属性代码示例

本文整理汇总了Java中org.jacoco.core.analysis.ICounter.EMPTY属性的典型用法代码示例。如果您正苦于以下问题:Java ICounter.EMPTY属性的具体用法?Java ICounter.EMPTY怎么用?Java ICounter.EMPTY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.jacoco.core.analysis.ICounter的用法示例。


在下文中一共展示了ICounter.EMPTY属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createAnnotations

private void createAnnotations(final ISourceNode linecoverage) {
  AnnotationModelEvent event = new AnnotationModelEvent(this);
  clear(event);
  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);
      }
    }
  } catch (BadLocationException ex) {
    EclEmmaUIPlugin.log(ex);
  }
  fireModelChanged(event);
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:22,代码来源:CoverageAnnotationModel.java

示例2: getCoverableStmts

public boolean[] getCoverableStmts() {
	int testsNum = this.getTestCount();
	if(testsNum == 0) return new boolean[0];

	int[] test = this.testStmtMatrix.get(0);

	int[] decodedCoverge = null;
	if(format == LineCoverageFormat.DENSE) {
		decodedCoverge = decodeDense(test); 
	} else {
		decodedCoverge = decodeCompact(test);
	}

	boolean[] stmts = new boolean[decodedCoverge.length];
	for(int i = 0; i < decodedCoverge.length; i += 1) {
		int coverageStatus = decodedCoverge[i];
		if(coverageStatus == ICounter.EMPTY) {
			stmts[i] = false;
		} else {
			stmts[i] = true;
		}
	}

	return stmts;
}
 
开发者ID:spideruci,项目名称:tacoco,代码行数:25,代码来源:CoverageMatrix.java

示例3: findCoverableStmts

boolean[] findCoverableStmts(
		int[] coverage, LineCoverageFormat format, int length) {
	int[] decodedCoverge = null;
	if(format == LineCoverageFormat.DENSE) {
		decodedCoverge = decodeDense(coverage); 
	} else {
		decodedCoverge = decodeCompact(coverage);
	}

	boolean[] stmts = new boolean[length];
	for(int i = 0; i < length; i += 1) {
		int coverageStatus = decodedCoverge[i];
		if(coverageStatus == ICounter.EMPTY) {
			stmts[i] = false;
		} else {
			stmts[i] = true;
		}
	}
	return stmts;
}
 
开发者ID:spideruci,项目名称:tacoco,代码行数:20,代码来源:SourceSpecificCoverageMatrix.java

示例4: print_source_counter_verbose

public static void print_source_counter_verbose(ISourceNode source)
{
	int firstLine = source.getFirstLine();
	int lastLine = source.getLastLine();
	System.out.printf("%18s: %s\n", "First Line", firstLine);
	System.out.printf("%18s: %s\n", "Last Line", lastLine);
	for(int i = firstLine; i <= lastLine; i++)
	{
		ILine line = source.getLine(i);
		ICounter instructionCounter = line.getInstructionCounter();
		int status = instructionCounter.getStatus();
		if(status != ICounter.EMPTY)
		{
			String status_string = "";
			switch(status)
			{
				case ICounter.NOT_COVERED:
					status_string = "NOT_COVERED";
					break;
				case ICounter.FULLY_COVERED:
					status_string = "FULLY_COVERED";
					break;
				case ICounter.PARTLY_COVERED:
					status_string = "PARTLY_COVERED";
					break;
				default:
			}
			System.out.printf("%18s: %6s (%s)\n", "Line "+i, instructionCounter.getCoveredCount() + "/" + instructionCounter.getTotalCount(), status_string);
		}
	}
}
 
开发者ID:spideruci,项目名称:tacoco,代码行数:31,代码来源:ExecAnalyze.java

示例5: lineStatusString

private String lineStatusString(int lineStatus) {
	switch(lineStatus) {
	case ICounter.EMPTY: return "EMPTY";
	case ICounter.NOT_COVERED: return "NOT COVERED";
	case ICounter.PARTLY_COVERED: return "PARTLY COVERED";
	case ICounter.FULLY_COVERED: return "FULLY COVERED";
	default: return "UNKNOWN STATUS";
	}
}
 
开发者ID:spideruci,项目名称:tacoco,代码行数:9,代码来源:CoveragePrettyPrinter.java

示例6: printCoverage

@SuppressWarnings("rawtypes")
@Override
public void printCoverage() {

	ArrayList<ISourceFileCoverage> sourcefilesCovergae = 
			amassSourcefilesCoverage();
	SourceFileCoverage[] sourcefiles = coverage(sourcefilesCovergae);


	for(SourceFileCoverage<Integer> sourcefile: sourcefiles){
		String sourceFQN = sourcefile.getPackageName()+"."+sourcefile.getFileName();
		Integer[] encodedLinesStatuses = sourcefile.getLinesCoverage();

		int[] encodedStatuses = new int[encodedLinesStatuses.length];
		for(int i = 0; i < encodedLinesStatuses.length; i += 1) {
			encodedStatuses[i] = encodedLinesStatuses[i];
		}
		LinesStatusCoder coder = new LinesStatusCoder();
		int[] decodedStatuses = coder.decode(encodedStatuses);
		int fl = sourcefile.getFirstLine();
		int ll = sourcefile.getLastLine();
		int emptyLineCnt=0;

		String testFQN = sourcefile.getSessionName();
		if(testFQN.endsWith("_F")) testFQN = testFQN.replaceAll("_F", "");
		int sourceID = db.getSourceID(sourceFQN);
		int testID = db.getTestID(testFQN);

		for(int i=0; i<ll-fl+1; ++i){
			int lineNumber = i+fl;
			switch(decodedStatuses[i]){
			case ICounter.EMPTY:
				++emptyLineCnt;break;
			case ICounter.FULLY_COVERED:
			case ICounter.PARTLY_COVERED:
				db.insertLineCoverage(testID, sourceID, lineNumber, projectID);
				break;
			case ICounter.NOT_COVERED:
				break;
			}
		}
		if(updateSourceInfo){
			db.insertSource(sourceFQN, (ll-fl-emptyLineCnt+1), projectID);
		}
	}
}
 
开发者ID:spideruci,项目名称:tacoco,代码行数:46,代码来源:SQLitePrinter.java


注:本文中的org.jacoco.core.analysis.ICounter.EMPTY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。