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


Java Analyzer.analyzeAll方法代码示例

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


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

示例1: analyzeStructure

import org.jacoco.core.analysis.Analyzer; //导入方法依赖的package包/类
@VisibleForTesting
IBundleCoverage analyzeStructure() throws IOException {
  final CoverageBuilder coverageBuilder = new CoverageBuilder();
  final Analyzer analyzer = new Analyzer(execFileLoader.getExecutionDataStore(), coverageBuilder);
  Set<String> alreadyInstrumentedClasses = new HashSet<>();
  for (File classesJar : classesJars) {
    if (isNewCoverageImplementation) {
      analyzeUninstrumentedClassesFromJar(analyzer, classesJar, alreadyInstrumentedClasses);
    } else {
      analyzer.analyzeAll(classesJar);
    }
  }

  // TODO(bazel-team): Find out where the name of the bundle can pop out in the report.
  return coverageBuilder.getBundle("isthisevenused");
}
 
开发者ID:bazelbuild,项目名称:bazel,代码行数:17,代码来源:JacocoCoverageRunner.java

示例2: analyzeUninstrumentedClassesFromJar

import org.jacoco.core.analysis.Analyzer; //导入方法依赖的package包/类
/**
 * Analyzes all uninstrumented class files found in the given jar.
 *
 * <p>The uninstrumented classes are named using the .class.uninstrumented suffix.
 */
private void analyzeUninstrumentedClassesFromJar(
    Analyzer analyzer, File jar, Set<String> alreadyInstrumentedClasses) throws IOException {
  JarFile jarFile = new JarFile(jar);
  JarInputStream jarInputStream = new JarInputStream(new FileInputStream(jar));
  for (JarEntry jarEntry = jarInputStream.getNextJarEntry();
      jarEntry != null;
      jarEntry = jarInputStream.getNextJarEntry()) {
    String jarEntryName = jarEntry.getName();
    if (jarEntryName.endsWith(".class.uninstrumented")
        && !alreadyInstrumentedClasses.contains(jarEntryName)) {
      analyzer.analyzeAll(jarFile.getInputStream(jarEntry), jarEntryName);
      alreadyInstrumentedClasses.add(jarEntryName);
    }
  }
}
 
开发者ID:bazelbuild,项目名称:bazel,代码行数:21,代码来源:JacocoCoverageRunner.java

示例3: processNBModule

import org.jacoco.core.analysis.Analyzer; //导入方法依赖的package包/类
public void processNBModule(String projectName, List<String> classDirectories, List<String> sourceDirectories) throws IOException {
	CoverageBuilder coverageBuilder = new CoverageBuilder();
	Analyzer analyzer = new Analyzer(execFileLoader.getExecutionDataStore(), coverageBuilder);

	for (String classDirectory : classDirectories) {
		analyzer.analyzeAll(new File(classDirectory));
	}

	IBundleCoverage bundleCoverage = coverageBuilder.getBundle(projectName);

	MultiSourceFileLocator sourceLocator = new MultiSourceFileLocator(4);
	for (String sourceDirectory : sourceDirectories) {
		sourceLocator.add(new DirectorySourceFileLocator(new File(sourceDirectory), DEF_ENCODING, 4));
	}

	groupVisitor.visitBundle(bundleCoverage, sourceLocator);
}
 
开发者ID:jonathanlermitage,项目名称:tikione-jacocoverage,代码行数:18,代码来源:JacocoNBModuleReportGenerator.java

示例4: analyzeStructure

import org.jacoco.core.analysis.Analyzer; //导入方法依赖的package包/类
private IBundleCoverage analyzeStructure() throws IOException {
  final CoverageBuilder coverageBuilder = new CoverageBuilder();
  final Analyzer analyzer = new Analyzer(execFileLoader.getExecutionDataStore(), coverageBuilder);

  String[] classesDirs = classesPath.split(":");
  for (String classesDir : classesDirs) {
    File classesDirFile = new File(classesDir);
    if (classesDirFile.exists()) {
      for (File clazz : FileUtils.getFiles(classesDirFile, coverageIncludes, coverageExcludes)) {
        analyzer.analyzeAll(clazz);
      }
    }
  }

  return coverageBuilder.getBundle(title);
}
 
开发者ID:facebook,项目名称:buck,代码行数:17,代码来源:ReportGenerator.java

示例5: coverageResults

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

	try {
		analyzer.analyzeAll(new File(classesDirectory));
	} catch (IOException e) {
		throw new RuntimeException(e);
	}
	return new CoverageResults(coverageBuilder);
}
 
开发者ID:STAMP-project,项目名称:dspot,代码行数:12,代码来源:JacocoListener.java

示例6: coverageResults

import org.jacoco.core.analysis.Analyzer; //导入方法依赖的package包/类
private CoverageResults coverageResults(ExecutionDataStore executionData) {
    final String classesDirectory = this.program.getProgramDir() + "/" + this.program.getClassesDir();
    final CoverageBuilder coverageBuilder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executionData, coverageBuilder);

    try {
        analyzer.analyzeAll(new File(classesDirectory));
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
    return new CoverageResults(coverageBuilder);
}
 
开发者ID:STAMP-project,项目名称:dspot,代码行数:13,代码来源:JacocoExecutor.java

示例7: analyzeStructure

import org.jacoco.core.analysis.Analyzer; //导入方法依赖的package包/类
private IBundleCoverage analyzeStructure() throws IOException {
    final CoverageBuilder coverageBuilder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executionDataStore,
            coverageBuilder);
    for (File file : classesDirectories) {
        analyzer.analyzeAll(file);

    }

    return coverageBuilder.getBundle(title);
}
 
开发者ID:GITNE,项目名称:icedtea-web,代码行数:12,代码来源:ReportGenerator.java

示例8: analyzeStructure

import org.jacoco.core.analysis.Analyzer; //导入方法依赖的package包/类
private IBundleCoverage analyzeStructure(final ExecutionDataStore data) 
		throws IOException {
	final CoverageBuilder coverageBuilder = new CoverageBuilder();
	final Analyzer analyzer = new Analyzer(data, coverageBuilder);
	analyzer.analyzeAll(classesDirectory);
	return coverageBuilder.getBundle(coverageTitle);
}
 
开发者ID:spideruci,项目名称:tacoco,代码行数:8,代码来源:ExecutionDataParser.java

示例9: analyzeCurrentDataStore

import org.jacoco.core.analysis.Analyzer; //导入方法依赖的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

示例10: analyzeStructure

import org.jacoco.core.analysis.Analyzer; //导入方法依赖的package包/类
private IBundleCoverage analyzeStructure() throws IOException {
	final CoverageBuilder coverageBuilder = new CoverageBuilder();
	final Analyzer analyzer = new Analyzer(
			execFileLoader.getExecutionDataStore(), coverageBuilder);

	analyzer.analyzeAll(classesDirectory);

	return coverageBuilder.getBundle(title);
}
 
开发者ID:spideruci,项目名称:tacoco,代码行数:10,代码来源:ReportGenerator.java

示例11: analyzeStructure

import org.jacoco.core.analysis.Analyzer; //导入方法依赖的package包/类
private IBundleCoverage analyzeStructure(final ExecutionDataStore data) 
		throws IOException {
	final CoverageBuilder coverageBuilder = new CoverageBuilder();
	final Analyzer analyzer = new Analyzer(data, coverageBuilder);
	
	for(String dir : this.probe.getClassDirs()){
		File classDir = new File(dir);
		if(classDir.exists()){
			analyzer.analyzeAll(classDir);
		}
	}
	
	return coverageBuilder.getBundle(coverageTitle);
}
 
开发者ID:spideruci,项目名称:tacoco,代码行数:15,代码来源:DataParser.java

示例12: buildBundle

import org.jacoco.core.analysis.Analyzer; //导入方法依赖的package包/类
/**
 * Builds a bundle for all loaded inputs
 */
private void buildBundle() {
  final CoverageBuilder builder = new CoverageBuilder();
  final Analyzer analyzer = new Analyzer(loader.getExecutionDataStore(),
      builder);
  for (final File file : analyzeFors) {
    try {
      analyzer.analyzeAll(file);
    } catch (final IOException e) {
      exit("Could not analyze for '" + file + "'", e);
    }
  }
  bundle = builder.getBundle(title);
}
 
开发者ID:quelltextlich,项目名称:jacoco-toolbox,代码行数:17,代码来源:ReportTool.java

示例13: analyzeStructure

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

    analyzer.analyzeAll(classesDirectory);

    return coverageBuilder;
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:10,代码来源:CoverageReport.java

示例14: analyzeAll

import org.jacoco.core.analysis.Analyzer; //导入方法依赖的package包/类
/**
 * Copied from {@link Analyzer#analyzeAll(File)} in order to add logging.
 */
private void analyzeAll(Analyzer analyzer, File file) {
  if (file.isDirectory()) {
    for (File f : file.listFiles()) {
      analyzeAll(analyzer, f);
    }
  } else if (file.getName().endsWith(".class")) {
    try {
      analyzer.analyzeAll(file);
    } catch (Exception e) {
      J3cLogger.LOGGER.error("Exception during analysis of file " + file.getAbsolutePath(), e);
    }
  }
}
 
开发者ID:cezarcoca,项目名称:sonar-j3c,代码行数:17,代码来源:JacocoAnalyzer.java

示例15: analyzeStructure

import org.jacoco.core.analysis.Analyzer; //导入方法依赖的package包/类
private IBundleCoverage analyzeStructure() throws IOException {

        final CoverageBuilder coverageBuilder = new CoverageBuilder();
        final Analyzer analyzer = new Analyzer(execFileLoader.getExecutionDataStore(), coverageBuilder);

        String[] includes = {FrameworkConstants.CLASS_FILE_PATTERN}; //class file patten to be include
        String exclusionList = CodeCoverageUtils.getExclusionJarsPattern(",");
        String[] excludes = exclusionList.split(",");

        final List<File> filesToAnalyze =
                FileUtils.getFiles(classesDirectory,
                                   CodeCoverageUtils.getInclusionJarsPattern(","),
                                   exclusionList);

        for (final File file : filesToAnalyze) {

            String extractedDir = CodeCoverageUtils.extractJarFile(file.getAbsolutePath());
            log.info("Jar file analyzed for coverage : " + file.getName());
            String[] classFiles = CodeCoverageUtils.scanDirectory(extractedDir, includes, excludes);

            for (String classFile : classFiles) {
                analyzer.analyzeAll(new File(extractedDir + File.separator + classFile));
            }
            FileUtils.forceDelete(new File(extractedDir));
        }
        return coverageBuilder.getBundle("Overall Coverage Summary");
    }
 
开发者ID:wso2,项目名称:carbon-platform-integration,代码行数:28,代码来源:ReportGenerator.java


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