Examples of ExecutionDataStore


Examples of org.jacoco.core.data.ExecutionDataStore

public class ClassInfo implements ICoverageVisitor {

  private final Analyzer analyzer;

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

Examples of org.jacoco.core.data.ExecutionDataStore

    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

Examples of org.jacoco.core.data.ExecutionDataStore

  private Object access;

  @Before
  public void setup() {
    store = new ExecutionDataStore();
    access = new ExecutionDataAccess(store);
  }
View Full Code Here

Examples of org.jacoco.core.data.ExecutionDataStore

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

Examples of org.jacoco.core.data.ExecutionDataStore

    }
  }

  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

Examples of org.jacoco.core.data.ExecutionDataStore

  private void readAndAssertData() throws IOException {
    final RemoteControlReader remoteReader = new RemoteControlReader(
        mockConnection.getSocketB().getInputStream());

    final ExecutionDataStore execStore = new ExecutionDataStore();
    remoteReader.setExecutionDataVisitor(execStore);
    final SessionInfoStore infoStore = new SessionInfoStore();
    remoteReader.setSessionInfoVisitor(infoStore);

    assertTrue(remoteReader.read());

    final List<SessionInfo> infos = infoStore.getInfos();
    assertEquals(1, infos.size());
    assertEquals("stubid", infos.get(0).getId());

    assertEquals("Foo", execStore.get(0x12345678).getName());
  }
View Full Code Here

Examples of org.jacoco.core.data.ExecutionDataStore

    remoteWriter.visitDumpCommand(false, true);

    final RemoteControlReader remoteReader = new RemoteControlReader(
        mockConnection.getSocketB().getInputStream());

    final ExecutionDataStore execStore = new ExecutionDataStore();
    remoteReader.setExecutionDataVisitor(execStore);
    final SessionInfoStore infoStore = new SessionInfoStore();
    remoteReader.setSessionInfoVisitor(infoStore);

    assertTrue(remoteReader.read());
    assertTrue(infoStore.getInfos().isEmpty());
    assertTrue(execStore.getContents().isEmpty());
    runtime.assertNoProbes();

    con.close();
    f.get();
  }
View Full Code Here

Examples of org.jacoco.core.data.ExecutionDataStore

  @Test
  public void testWriteExecutionData() throws Exception {
    controller.writeExecutionData();

    final ExecutionDataStore execStore = new ExecutionDataStore();
    remoteReader.setExecutionDataVisitor(execStore);
    final SessionInfoStore infoStore = new SessionInfoStore();
    remoteReader.setSessionInfoVisitor(infoStore);

    remoteReader.read();

    assertEquals("Foo", execStore.get(0x12345678).getName());

    final List<SessionInfo> infos = infoStore.getInfos();
    assertEquals(1, infos.size());
    assertEquals("stubid", infos.get(0).getId());
View Full Code Here

Examples of org.jacoco.core.data.ExecutionDataStore

    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

Examples of org.jacoco.core.data.ExecutionDataStore

    }
  }

  @Before
  public void setup() {
    analyzer = new Analyzer(new ExecutionDataStore(),
        new EmptyStructureVisitor());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.