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


Java CoverageBuilder.getSourceFiles方法代码示例

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


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

示例1: analyzeExternal

import org.jacoco.core.analysis.CoverageBuilder; //导入方法依赖的package包/类
private AnalyzedNodes analyzeExternal(final IPackageFragmentRoot root)
    throws CoreException {
  IPath location = null;
  try {
    location = root.getPath();

    AnalyzedNodes nodes = cache.get(location);
    if (nodes != null) {
      return nodes;
    }

    final CoverageBuilder builder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executiondata, builder);
    new ResourceTreeWalker(analyzer).walk(location);
    nodes = new AnalyzedNodes(builder.getClasses(), builder.getSourceFiles());
    cache.put(location, nodes);
    return nodes;
  } catch (Exception e) {
    throw new CoreException(EclEmmaStatus.BUNDLE_ANALYSIS_ERROR.getStatus(
        root.getElementName(), location, e));
  }
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:23,代码来源:PackageFragementRootAnalyzer.java

示例2: analyzeInternal

import org.jacoco.core.analysis.CoverageBuilder; //导入方法依赖的package包/类
private AnalyzedNodes analyzeInternal(final IPackageFragmentRoot root)
    throws CoreException {
  IResource location = null;
  try {
    location = getClassfilesLocation(root);

    if (location == null) {
      TRACER.trace("No class files found for package fragment root {0}", //$NON-NLS-1$
          root.getPath());
      return AnalyzedNodes.EMPTY;
    }

    AnalyzedNodes nodes = cache.get(location);
    if (nodes != null) {
      return nodes;
    }

    final CoverageBuilder builder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executiondata, builder);
    new ResourceTreeWalker(analyzer).walk(location);
    nodes = new AnalyzedNodes(builder.getClasses(), builder.getSourceFiles());
    cache.put(location, nodes);
    return nodes;
  } catch (Exception e) {
    throw new CoreException(EclEmmaStatus.BUNDLE_ANALYSIS_ERROR.getStatus(
        root.getElementName(), location, e));
  }
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:29,代码来源:PackageFragementRootAnalyzer.java

示例3: analyzeCurrentDataStore

import org.jacoco.core.analysis.CoverageBuilder; //导入方法依赖的package包/类
private void analyzeCurrentDataStore()
{
	final CoverageBuilder coverageBuilder = new CoverageBuilder();
	final Analyzer analyzer = new Analyzer(executionDataStore, coverageBuilder);

	try
	{
		analyzer.analyzeAll(classesToAnalyze, classesDirectory);
	}
	catch(IOException e)
	{

	}

	/*
	System.out.printf("Session \"%s\": %s - %s%n", currentInfo.getId(),
			new Date(currentInfo.getStartTimeStamp()),
			new Date(currentInfo.getDumpTimeStamp()));
			*/

	Collection<ISourceFileCoverage> sourceFiles = coverageBuilder.getSourceFiles();	

	results.put(currentInfo, sourceFiles);
	
	for(ISourceFileCoverage sourceFile : sourceFiles)
	{
		ExecAnalyze.print_counters(sourceFile);
		
		ExecAnalyze.print_source_counter_verbose(sourceFile);
	}
	
}
 
开发者ID:spideruci,项目名称:tacoco,代码行数:33,代码来源:PerJUnitTestCaseVisitor.java


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