Package org.jacoco.core.data

Examples of org.jacoco.core.data.ExecutionDataWriter


    assertEquals("MyClass", execStore.get(123).getName());
  }

  private byte[] createSessionData() throws Exception {
    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    ExecutionDataWriter writer = new ExecutionDataWriter(buffer);
    SessionInfo info = new SessionInfo("id1", 1, 2);
    writer.visitSessionInfo(info);
    writer.visitClassExecution(new ExecutionData(123, "MyClass", new boolean[] {
        true, false }));
    return buffer.toByteArray();
  }
View Full Code Here


  }

  private IExecutionDataSource createValidSource() throws IOException {
    File execfile = new File(folder.getRoot(), "test.exec");
    OutputStream out = new FileOutputStream(execfile);
    ExecutionDataWriter writer = new ExecutionDataWriter(out);
    writer.visitSessionInfo(new SessionInfo("id", 1, 2));
    writer.visitClassExecution(new ExecutionData(123, "MyClass", 15));
    out.close();
    return new URLExecutionDataSource(execfile.toURL());
  }
View Full Code Here

      throws CoreException {
    try {
      final File file = File.createTempFile("session", ".exec", folder); //$NON-NLS-1$ //$NON-NLS-2$
      final OutputStream out = new BufferedOutputStream(new FileOutputStream(
          file));
      final ExecutionDataWriter writer = new ExecutionDataWriter(out);
      source.accept(writer, writer);
      out.close();
      return new URLExecutionDataSource(file.toURL());
    } catch (IOException e) {
      throw new CoreException(EclEmmaStatus.EXEC_FILE_CREATE_ERROR.getStatus(e));
View Full Code Here

    monitor.beginTask(
        NLS.bind(CoreMessages.ExportingSession_task, session.getDescription()),
        1);
    final OutputStream out = new BufferedOutputStream(new FileOutputStream(
        destination));
    final ExecutionDataWriter writer = new ExecutionDataWriter(out);
    session.accept(writer, writer);
    out.close();
    monitor.done();
  }
View Full Code Here

  
   private void write(OutputStream stream, ExecutionDataStore executionData, SessionInfoStore sessionStore)
   {
      try
      {
         ExecutionDataWriter writer = new ExecutionDataWriter(stream);
        
         executionData.accept(writer);
         sessionStore.accept(writer);
         writer.flush();
      }
      catch (IOException e)
      {
         if(stream != null)
         {
View Full Code Here

TOP

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

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.