Package org.jacoco.core.data

Examples of org.jacoco.core.data.ExecutionDataStore


    runtime.startup();
    final byte[] bytes = new Instrumenter(runtime).instrument(reader);
    final TargetLoader loader = new TargetLoader(target, bytes);
    final Object instance = loader.getTargetClass().newInstance();
    ((Runnable) instance).run();
    final ExecutionDataStore store = new ExecutionDataStore();
    runtime.collect(store, false);
    runtime.shutdown();
    return store;
  }
View Full Code Here


    }
  }

  private void loadExecutionData() throws IOException {
    sessionInfoStore = new SessionInfoStore();
    executionDataStore = new ExecutionDataStore();
    FileInputStream in = null;
    try {
      in = new FileInputStream(dataFile);
      final ExecutionDataReader reader = new ExecutionDataReader(in);
      reader.setSessionInfoVisitor(sessionInfoStore);
View Full Code Here

    modelcoverage = new JavaModelCoverage();
    final Collection<IPackageFragmentRoot> roots = session.getScope();
    monitor.beginTask(
        NLS.bind(CoreMessages.AnalyzingCoverageSession_task,
            session.getDescription()), 1 + roots.size());
    executiondatastore = new ExecutionDataStore();
    sessioninfostore = new SessionInfoStore();
    session.accept(executiondatastore, sessioninfostore);
    monitor.worked(1);

    final PackageFragementRootAnalyzer analyzer = new PackageFragementRootAnalyzer(
View Full Code Here

  /**
   * Creates a new runtime.
   */
  protected AbstractRuntime() {
    store = new ExecutionDataStore();
  }
View Full Code Here

    final Runnable targetInstance = (Runnable) targetClass.newInstance();
    targetInstance.run();

    // At the end of test execution we collect execution data and shutdown
    // the runtime:
    final ExecutionDataStore executionData = new ExecutionDataStore();
    runtime.collect(executionData, null, false);
    runtime.shutdown();

    // Together with the original class definition we can calculate coverage
    // information:
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

    }
  }

  private void loadExecutionData() {
    sessionInfoStore = new SessionInfoStore();
    executionDataStore = new ExecutionDataStore();
    for (final Iterator<?> i = executiondataElement.iterator(); i.hasNext();) {
      final Resource resource = (Resource) i.next();
      InputStream in = null;
      try {
        in = new BufferedInputStream(resource.getInputStream());
View Full Code Here

public class ClassInfo implements ICoverageVisitor {

  private final Analyzer analyzer;

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

    }
  }

  private void loadExecutionData() throws IOException {
    sessionInfoStore = new SessionInfoStore();
    executionDataStore = new ExecutionDataStore();
    FileInputStream in = null;
    try {
      in = new FileInputStream(dataFile);
      final ExecutionDataReader reader = new ExecutionDataReader(in);
      reader.setSessionInfoVisitor(sessionInfoStore);
View Full Code Here

    if (destfile.exists() && (!destfile.canWrite() || !destfile.isFile())) {
      throw new BuildException("Unable to write to destination file");
    }

    final SessionInfoStore infoStore = new SessionInfoStore();
    final ExecutionDataStore dataStore = new ExecutionDataStore();

    loadSourceFiles(infoStore, dataStore);

    OutputStream outputStream = null;
    try {
      FileUtils.getFileUtils().createNewFile(destfile, true);

      outputStream = new BufferedOutputStream(new FileOutputStream(
          destfile));
      final ExecutionDataWriter dataWriter = new ExecutionDataWriter(
          outputStream);
      infoStore.accept(dataWriter);
      dataStore.accept(dataWriter);
    } catch (final IOException e) {
      throw new BuildException(String.format(
          "Unable to write merged file %s", destfile.getName()), e);
    } finally {
      FileUtils.close(outputStream);
View Full Code Here

TOP

Related Classes of org.jacoco.core.data.ExecutionDataStore

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.