Package org.jacoco.core.data

Examples of org.jacoco.core.data.ExecutionDataStore$Entry


    }
  }

  @Before
  public void setup() {
    analyzer = new Analyzer(new ExecutionDataStore(),
        new EmptyStructureVisitor());
  }
View Full Code Here


      throw new BuildException("Destination file must be supplied",
          getLocation());
    }

    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(format("Unable to write merged file %s",
          destfile.getAbsolutePath()), e, getLocation());
    } finally {
      FileUtils.close(outputStream);
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

    source.visitSessionInfo(info);
    source.visitClassExecution(new ExecutionData(123, "MyClass", new boolean[] {
        true, false }));

    SessionInfoStore sessionStore = new SessionInfoStore();
    ExecutionDataStore execStore = new ExecutionDataStore();
    source.accept(execStore, sessionStore);

    assertEquals(Collections.singletonList(info), sessionStore.getInfos());
    assertEquals("MyClass", execStore.get(123).getName());
  }
View Full Code Here

    ExecutionDataReader reader = new ExecutionDataReader(
        new ByteArrayInputStream(createSessionData()));
    source.readFrom(reader);

    SessionInfoStore sessionStore = new SessionInfoStore();
    ExecutionDataStore execStore = new ExecutionDataStore();
    source.accept(execStore, sessionStore);

    assertEquals(1, sessionStore.getInfos().size());
    assertEquals("MyClass", execStore.get(123).getName());
  }
View Full Code Here

    assertTrue(execfile.isFile());

    final ExecutionDataReader reader = new ExecutionDataReader(
        new FileInputStream(execfile));
    final SessionInfoStore sessionInfoStore = new SessionInfoStore();
    final ExecutionDataStore executionDataStore = new ExecutionDataStore();
    reader.setSessionInfoVisitor(sessionInfoStore);
    reader.setExecutionDataVisitor(executionDataStore);
    reader.read();

    assertEquals("id", sessionInfoStore.getInfos().get(0).getId());
    assertEquals("MyClass", executionDataStore.get(123).getName());
  }
View Full Code Here

  private void verifyExecContent(IPath path, String... classnames)
      throws Exception {
    final FileInputStream in = new FileInputStream(path.toFile());
    final ExecutionDataReader reader = new ExecutionDataReader(in);
    reader.setSessionInfoVisitor(new SessionInfoStore());
    final ExecutionDataStore store = new ExecutionDataStore();
    reader.setExecutionDataVisitor(store);
    while (reader.read()) {
    }
    in.close();
    final Set<String> actual = new HashSet<String>();
    for (ExecutionData data : store.getContents()) {
      actual.add(data.getName());
    }
    assertEquals(new HashSet<String>(Arrays.asList(classnames)), actual);
  }
View Full Code Here

    this.dataReceived = false;
  }

  public IPath dump() throws IOException, CoreException {
    final SessionInfoStore sessionInfos = new SessionInfoStore();
    final ExecutionDataStore executionData = new ExecutionDataStore();
    reader.setSessionInfoVisitor(sessionInfos);
    reader.setExecutionDataVisitor(executionData);
    reader.read();
    if (sessionInfos.isEmpty()) {
      return null;
View Full Code Here

  private PackageFragementRootAnalyzer analyzer;

  @Before
  public void setup() throws Exception {
    javaProject = new JavaProjectKit("project");
    final ExecutionDataStore data = new ExecutionDataStore();
    analyzer = new PackageFragementRootAnalyzer(data);
  }
View Full Code Here

  private final SessionInfoStore sessionInfoStore;
  private ExecutionDataStore executionDataStore;

  public MemoryExecutionDataSource() {
    sessionInfoStore = new SessionInfoStore();
    executionDataStore = new ExecutionDataStore();
  }
View Full Code Here

TOP

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

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.