Package org.jacoco.core.analysis

Examples of org.jacoco.core.analysis.Analyzer


      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) {
View Full Code Here


      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) {
View Full Code Here

    return nodes;
  }

  private AnalyzedNodes analyze(IPath path) throws CoreException {
    final CoverageBuilder builder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executiondata, builder);

    try {
      analyzer.analyzeAll(path.toFile());
    } catch (IOException e) {
      throw new CoreException(EclEmmaStatus.CLASS_FILE_READ_ERROR.getStatus(
          path, e));
    }
View Full Code Here

    }
  }

  private IBundleCoverage createBundle() throws IOException {
    final CoverageBuilder builder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executionDataStore, builder);
    final File classesDir = new File(getProject().getBuild()
        .getOutputDirectory());

    List<File> filesToAnalyze = getFilesToAnalyze(classesDir);

    for (File file : filesToAnalyze) {
      analyzer.analyzeAll(file);
    }

    return builder.getBundle(getProject().getName());
  }
View Full Code Here

    runtime.shutdown();

    // Together with the original class definition we can calculate coverage
    // information:
    final CoverageBuilder coverageBuilder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executionData, coverageBuilder);
    analyzer.analyzeClass(getTargetClass(targetName));

    // Let's dump some metrics and line coverage information:
    for (final IClassCoverage cc : coverageBuilder.getClasses()) {
      System.out.printf("Coverage of class %s%n", cc.getName());
View Full Code Here

    runtime.shutdown();

    // Together with the original class definition we can calculate coverage
    // information:
    final CoverageBuilder coverageBuilder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executionData, coverageBuilder);
    analyzer.analyzeClass(getTargetClass(targetName));

    // Let's dump some metrics and line coverage information:
    for (final IClassCoverage cc : coverageBuilder.getClasses()) {
      System.out.printf("Coverage of class %s%n", cc.getName());
View Full Code Here

public final class ClassInfo implements ICoverageVisitor {

  private final Analyzer analyzer;

  private ClassInfo() {
    analyzer = new Analyzer(new ExecutionDataStore(), this);
  }
View Full Code Here

    fis.close();
  }

  private IBundleCoverage analyzeStructure() throws IOException {
    final CoverageBuilder coverageBuilder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executionDataStore,
        coverageBuilder);

    analyzer.analyzeAll(classesDirectory);

    return coverageBuilder.getBundle(title);
  }
View Full Code Here

  protected abstract void run(final Class<?> targetClass) throws Exception;

  private void analyze(final ClassReader reader,
      final ExecutionDataStore store) {
    final CoverageBuilder builder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(store, builder);
    analyzer.analyzeClass(reader);
    final Collection<IClassCoverage> classes = builder.getClasses();
    assertEquals(1, classes.size(), 0.0);
    classCoverage = classes.iterator().next();
    final Collection<ISourceFileCoverage> files = builder.getSourceFiles();
    assertEquals(1, files.size(), 0.0);
View Full Code Here

    }
  }

  private IBundleCoverage createBundle() throws IOException {
    final CoverageBuilder builder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executionDataStore, builder);
    final File classesDir = new File(getProject().getBuild()
        .getOutputDirectory());

    final List<File> filesToAnalyze = getFilesToAnalyze(classesDir);

    for (final File file : filesToAnalyze) {
      analyzer.analyzeAll(file);
    }

    return builder.getBundle(getProject().getName());
  }
View Full Code Here

TOP

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

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.