Package org.jacoco.core.data

Examples of org.jacoco.core.data.ExecutionDataReader


  }

  private void loadExecutionData() throws IOException {
    final FileInputStream fis = new FileInputStream(executionDataFile);
    final ExecutionDataReader executionDataReader = new ExecutionDataReader(
        fis);
    executionDataStore = new ExecutionDataStore();
    sessionInfoStore = new SessionInfoStore();

    executionDataReader.setExecutionDataVisitor(executionDataStore);
    executionDataReader.setSessionInfoVisitor(sessionInfoStore);

    while (executionDataReader.read()) {
    }

    fis.close();
  }
View Full Code Here


    for (final Iterator<?> i = executiondataElement.iterator(); i.hasNext();) {
      final Resource resource = (Resource) i.next();
      InputStream in = null;
      try {
        in = new BufferedInputStream(resource.getInputStream());
        final ExecutionDataReader reader = new ExecutionDataReader(in);
        reader.setSessionInfoVisitor(sessionInfoStore);
        reader.setExecutionDataVisitor(executionDataStore);
        reader.read();
      } catch (final IOException e) {
        throw new BuildException("Unable to read execution data file "
            + resource.getName(), e);
      } finally {
        FileUtils.close(in);
View Full Code Here

  private static void dumpContent(final String file) throws IOException {
    System.out.printf("exec file: %s%n", file);
    System.out.println("CLASS ID         HITS/PROBES   CLASS NAME");

    final FileInputStream in = new FileInputStream(file);
    final ExecutionDataReader reader = new ExecutionDataReader(in);
    reader.setSessionInfoVisitor(new ISessionInfoVisitor() {
      public void visitSessionInfo(final SessionInfo info) {
        System.out.printf("Session \"%s\": %s - %s%n", info.getId(),
            new Date(info.getStartTimeStamp()),
            new Date(info.getDumpTimeStamp()));
      }
    });
    reader.setExecutionDataVisitor(new IExecutionDataVisitor() {
      public void visitClassExecution(final ExecutionData data) {
        System.out.printf("%016x  %3d of %3d   %s%n",
            Long.valueOf(data.getId()),
            Integer.valueOf(getHitCount(data.getData())),
            Integer.valueOf(data.getData().length), data.getName());
      }
    });
    reader.read();
    in.close();
    System.out.println();
  }
View Full Code Here

          Project.MSG_DEBUG);

      InputStream resourceStream = null;
      try {
        resourceStream = resource.getInputStream();
        final ExecutionDataReader reader = new ExecutionDataReader(
            resourceStream);
        reader.setSessionInfoVisitor(infoStore);
        reader.setExecutionDataVisitor(dataStore);
        reader.read();

        numFilesMerged++;
      } catch (final IOException e) {
        throw new BuildException(String.format("Unable to read %s",
            resource.getName()), e);
View Full Code Here

    for (final Iterator<?> i = executiondataElement.iterator(); i.hasNext();) {
      final Resource resource = (Resource) i.next();
      InputStream in = null;
      try {
        in = new BufferedInputStream(resource.getInputStream());
        final ExecutionDataReader reader = new ExecutionDataReader(in);
        reader.setSessionInfoVisitor(sessionInfoStore);
        reader.setExecutionDataVisitor(executionDataStore);
        reader.read();
      } catch (final IOException e) {
        throw new BuildException("Unable to read execution data file "
            + resource.getName(), e);
      } finally {
        FileUtils.close(in);
View Full Code Here

  private static void dumpContent(final String file) throws IOException {
    System.out.printf("exec file: %s%n", file);
    System.out.println("CLASS ID         HITS/PROBES   CLASS NAME");

    final FileInputStream in = new FileInputStream(file);
    final ExecutionDataReader reader = new ExecutionDataReader(in);
    reader.setSessionInfoVisitor(new ISessionInfoVisitor() {
      public void visitSessionInfo(final SessionInfo info) {
        System.out.printf("Session \"%s\": %s - %s%n", info.getId(),
            new Date(info.getStartTimeStamp()), new Date(info
                .getDumpTimeStamp()));
      }
    });
    reader.setExecutionDataVisitor(new IExecutionDataVisitor() {
      public void visitClassExecution(final ExecutionData data) {
        System.out
            .printf("%016x  %3d of %3d   %s%n", Long.valueOf(data
                .getId()), Integer.valueOf(getHitCount(data
                .getData())), Integer
                .valueOf(data.getData().length), data.getName());
      }
    });
    reader.read();
    in.close();
    System.out.println();
  }
View Full Code Here

          Project.MSG_DEBUG);

      InputStream resourceStream = null;
      try {
        resourceStream = resource.getInputStream();
        final ExecutionDataReader reader = new ExecutionDataReader(
            resourceStream);
        reader.setSessionInfoVisitor(infoStore);
        reader.setExecutionDataVisitor(dataStore);
        reader.read();

        numFilesMerged++;
      } catch (final IOException e) {
        throw new BuildException(String.format("Unable to read %s",
            resource.getName()), e);
View Full Code Here

    for (final Iterator<?> i = executiondataElement.iterator(); i.hasNext();) {
      final Resource resource = (Resource) i.next();
      InputStream in = null;
      try {
        in = new BufferedInputStream(resource.getInputStream());
        final ExecutionDataReader reader = new ExecutionDataReader(in);
        reader.setSessionInfoVisitor(sessionInfoStore);
        reader.setExecutionDataVisitor(executionDataStore);
        reader.read();
      } catch (final IOException e) {
        throw new BuildException("Unable to read execution data file "
            + resource.getName(), e);
      } finally {
        FileUtils.close(in);
View Full Code Here

      final Resource resource = (Resource) i.next();
      log(format("Loading execution data file %s", resource));
      InputStream in = null;
      try {
        in = new BufferedInputStream(resource.getInputStream());
        final ExecutionDataReader reader = new ExecutionDataReader(in);
        reader.setSessionInfoVisitor(sessionInfoStore);
        reader.setExecutionDataVisitor(executionDataStore);
        reader.read();
      } catch (final IOException e) {
        throw new BuildException(format(
            "Unable to read execution data file %s", resource), e,
            getLocation());
      } finally {
View Full Code Here

  private static void dumpContent(final String file) throws IOException {
    System.out.printf("exec file: %s%n", file);
    System.out.println("CLASS ID         HITS/PROBES   CLASS NAME");

    final FileInputStream in = new FileInputStream(file);
    final ExecutionDataReader reader = new ExecutionDataReader(in);
    reader.setSessionInfoVisitor(new ISessionInfoVisitor() {
      public void visitSessionInfo(final SessionInfo info) {
        System.out.printf("Session \"%s\": %s - %s%n", info.getId(),
            new Date(info.getStartTimeStamp()),
            new Date(info.getDumpTimeStamp()));
      }
    });
    reader.setExecutionDataVisitor(new IExecutionDataVisitor() {
      public void visitClassExecution(final ExecutionData data) {
        System.out.printf("%016x  %3d of %3d   %s%n",
            Long.valueOf(data.getId()),
            Integer.valueOf(getHitCount(data.getData())),
            Integer.valueOf(data.getData().length), data.getName());
      }
    });
    reader.read();
    in.close();
    System.out.println();
  }
View Full Code Here

TOP

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

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.