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


Java ICoverageNode类代码示例

本文整理汇总了Java中org.jacoco.core.analysis.ICoverageNode的典型用法代码示例。如果您正苦于以下问题:Java ICoverageNode类的具体用法?Java ICoverageNode怎么用?Java ICoverageNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getLines

import org.jacoco.core.analysis.ICoverageNode; //导入依赖的package包/类
private Line[] getLines() {
  ICoverageNode c = CoverageTools.getCoverageInfo(getElement());
  if (c == null) {
    return new Line[0];
  } else {
    return new Line[] {
        new Line(UIMessages.CoveragePropertyPageInstructions_label,
            c.getInstructionCounter()),
        new Line(UIMessages.CoveragePropertyPageBranches_label,
            c.getBranchCounter()),
        new Line(UIMessages.CoveragePropertyPageLines_label,
            c.getLineCounter()),
        new Line(UIMessages.CoveragePropertyPageMethods_label,
            c.getMethodCounter()),
        new Line(UIMessages.CoveragePropertyPageTypes_label,
            c.getClassCounter()),
        new Line(UIMessages.CoveragePropertyPageComplexity_label,
            c.getComplexityCounter()) };
  }
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:21,代码来源:CoveragePropertyPage.java

示例2: getAdapter

import org.jacoco.core.analysis.ICoverageNode; //导入依赖的package包/类
public Object getAdapter(Object object,
    @SuppressWarnings("rawtypes") Class adapterType) {
  // if the object is a IResource find the corresponding IJavaElement
  if (object instanceof IResource) {
    object = ((IResource) object).getAdapter(IJavaElement.class);
    if (object == null) {
      return null;
    }
  }
  // then find the coverage information from the current session
  IJavaModelCoverage mc = CoverageTools.getJavaModelCoverage();
  if (mc == null) {
    return null;
  } else {
    ICoverageNode coverage = mc.getCoverageFor((IJavaElement) object);
    if (adapterType.isInstance(coverage)) {
      return coverage;
    } else {
      return null;
    }
  }
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:23,代码来源:JavaElementCoverageAdapterFactory.java

示例3: print_counters

import org.jacoco.core.analysis.ICoverageNode; //导入依赖的package包/类
public static void print_counters(ICoverageNode node)
{
	String name = node.getName();

	ICounter lineCounter = node.getLineCounter();
	ICounter instructionCounter = node.getInstructionCounter();
	ICounter classCounter = node.getClassCounter();
	ICounter methodCounter = node.getMethodCounter();
	ICounter branchCounter = node.getBranchCounter();
	ICounter complexityCounter = node.getComplexityCounter();

	System.out.printf("%18s: %s\n", "ICoverageNode name", name);
	System.out.printf("%18s: %s\n", "lineCounter", lineCounter.getCoveredCount() + "/" + lineCounter.getTotalCount());
	System.out.printf("%18s: %s\n", "instructionCounter", instructionCounter.getCoveredCount() + "/" + instructionCounter.getTotalCount());
	System.out.printf("%18s: %s\n", "classCounter", classCounter.getCoveredCount() + "/" + classCounter.getTotalCount());
	System.out.printf("%18s: %s\n", "methodCounter", methodCounter.getCoveredCount() + "/" + methodCounter.getTotalCount());
	System.out.printf("%18s: %s\n", "branchCounter", branchCounter.getCoveredCount() + "/" + branchCounter.getTotalCount());
	System.out.printf("%18s: %s\n", "complexityCounter", complexityCounter.getCoveredCount() + "/" + complexityCounter.getTotalCount());

}
 
开发者ID:spideruci,项目名称:tacoco,代码行数:21,代码来源:ExecAnalyze.java

示例4: decorate

import org.jacoco.core.analysis.ICoverageNode; //导入依赖的package包/类
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())));
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:15,代码来源:CoverageDecorator.java

示例5: findSourceCoverageForElement

import org.jacoco.core.analysis.ICoverageNode; //导入依赖的package包/类
private ISourceNode findSourceCoverageForElement(Object element) {
  // Do we have a coverage info for the editor input?
  ICoverageNode coverage = CoverageTools.getCoverageInfo(element);
  if (coverage instanceof ISourceNode) {
    return (ISourceNode) coverage;
  }
  return null;
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:9,代码来源:CoverageAnnotationModel.java

示例6: calculateMaxTotal

import org.jacoco.core.analysis.ICoverageNode; //导入依赖的package包/类
private int calculateMaxTotal(IJavaElement parent) {
  int max = 0;
  for (Object sibling : contentProvider.getChildren(parent)) {
    final ICoverageNode coverage = CoverageTools.getCoverageInfo(sibling);
    if (coverage != null) {
      max = Math.max(max, coverage.getCounter(settings.getCounters())
          .getTotalCount());
    }
  }
  return max;
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:12,代码来源:MaxTotalCache.java

示例7: getCoverageFor

import org.jacoco.core.analysis.ICoverageNode; //导入依赖的package包/类
public ICoverageNode getCoverageFor(IJavaElement element) {
  final ICoverageNode coverage = coveragemap.get(element);
  if (coverage != null) {
    return coverage;
  }
  if (IJavaElement.METHOD == element.getElementType()) {
    resolveMethods((IType) element.getParent());
    return coveragemap.get(element);
  }
  return null;
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:12,代码来源:JavaModelCoverage.java

示例8: getCoverageInfo

import org.jacoco.core.analysis.ICoverageNode; //导入依赖的package包/类
/**
 * Convenience method that tries to adapt the given object to ICoverageNode,
 * i.e. find coverage information from the active session.
 *
 * @param object
 *          Object to adapt
 * @return adapter or <code>null</code>
 */
public static ICoverageNode getCoverageInfo(Object object) {
  if (object instanceof IAdaptable) {
    return (ICoverageNode) ((IAdaptable) object)
        .getAdapter(ICoverageNode.class);
  } else {
    return null;
  }
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:17,代码来源:CoverageTools.java

示例9: putFragment

import org.jacoco.core.analysis.ICoverageNode; //导入依赖的package包/类
public void putFragment(IPackageFragment element, ICoverageNode coverage) {
  coveragemap.put(element, coverage);
  fragments.add(element);
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:5,代码来源:JavaModelCoverage.java

示例10: putType

import org.jacoco.core.analysis.ICoverageNode; //导入依赖的package包/类
public void putType(IType element, ICoverageNode coverage) {
  coveragemap.put(element, coverage);
  types.add(element);
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:5,代码来源:JavaModelCoverage.java

示例11: putClassFile

import org.jacoco.core.analysis.ICoverageNode; //导入依赖的package包/类
public void putClassFile(IClassFile element, ICoverageNode coverage) {
  coveragemap.put(element, coverage);
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:4,代码来源:JavaModelCoverage.java

示例12: putCompilationUnit

import org.jacoco.core.analysis.ICoverageNode; //导入依赖的package包/类
public void putCompilationUnit(ICompilationUnit element,
    ICoverageNode coverage) {
  coveragemap.put(element, coverage);
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:5,代码来源:JavaModelCoverage.java

示例13: getAdapterList

import org.jacoco.core.analysis.ICoverageNode; //导入依赖的package包/类
public Class<?>[] getAdapterList() {
  return new Class[] { ICoverageNode.class, ISourceNode.class };
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:4,代码来源:JavaElementCoverageAdapterFactory.java

示例14: getPlainCopy

import org.jacoco.core.analysis.ICoverageNode; //导入依赖的package包/类
public ICoverageNode getPlainCopy() {
  return this;
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:4,代码来源:IJavaModelCoverage.java

示例15: getCoverageFor

import org.jacoco.core.analysis.ICoverageNode; //导入依赖的package包/类
public ICoverageNode getCoverageFor(IJavaElement element) {
  return null;
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:4,代码来源:IJavaModelCoverage.java


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