Package org.jacoco.core.runtime

Examples of org.jacoco.core.runtime.RemoteControlWriter


        throws IOException {
      this.socket = socket;
      this.fileWriter = fileWriter;

      // Just send a valid header:
      new RemoteControlWriter(socket.getOutputStream());

      reader = new RemoteControlReader(socket.getInputStream());
      reader.setSessionInfoVisitor(this);
      reader.setExecutionDataVisitor(this);
    }
View Full Code Here


  @Before
  public void setup() throws Exception {
    logger = new ExceptionRecorder();
    final MockSocketConnection con = new MockSocketConnection();
    remoteSocket = con.getSocketB();
    remoteWriter = new RemoteControlWriter(remoteSocket.getOutputStream());
    controller = new TcpClientController(logger) {
      @Override
      protected Socket createSocket(AgentOptions options)
          throws IOException {
        return con.getSocketA();
View Full Code Here

        throws IOException {
      this.socket = socket;
      this.fileWriter = fileWriter;

      // Just send a valid header:
      new RemoteControlWriter(socket.getOutputStream());

      reader = new RemoteControlReader(socket.getInputStream());
      reader.setSessionInfoVisitor(this);
      reader.setExecutionDataVisitor(this);
    }
View Full Code Here

   *
   * @param args
   * @throws IOException
   */
  public static void main(final String[] args) throws IOException {
    final RemoteControlWriter fileWriter = new RemoteControlWriter(
        new FileOutputStream(DESTFILE));
    final ServerSocket server = new ServerSocket(PORT, 0, InetAddress
        .getByName(ADDRESS));
    while (true) {
      final Handler handler = new Handler(server.accept(), fileWriter);
View Full Code Here

        throws IOException {
      this.socket = socket;
      this.fileWriter = fileWriter;

      // Just send a valid header:
      new RemoteControlWriter(socket.getOutputStream());

      reader = new RemoteControlReader(socket.getInputStream());
      reader.setSessionInfoVisitor(this);
      reader.setExecutionDataVisitor(this);
    }
View Full Code Here

        output = new Nul();
      }

      final Socket socket = new Socket(InetAddress.getByName(address),
          port);
      final RemoteControlWriter remoteWriter = new RemoteControlWriter(
          socket.getOutputStream());
      final RemoteControlReader remoteReader = new RemoteControlReader(
          socket.getInputStream());
      final ExecutionDataWriter outputWriter = new ExecutionDataWriter(
          output);
      remoteReader.setSessionInfoVisitor(outputWriter);
      remoteReader.setExecutionDataVisitor(outputWriter);

      remoteWriter.visitDumpCommand(dump, reset);
      // Read session and/or execution data
      remoteReader.read();

      socket.close();
    } catch (final IOException e) {
View Full Code Here

   * @param args
   * @throws IOException
   */
  public static void main(final String[] args) throws IOException {
    final FileOutputStream localFile = new FileOutputStream(DESTFILE);
    final RemoteControlWriter localWriter = new RemoteControlWriter(
        localFile);

    // Open a socket to the coverage agent:
    final Socket socket = new Socket(InetAddress.getByName(ADDRESS), PORT);
    final RemoteControlWriter writer = new RemoteControlWriter(socket
        .getOutputStream());
    final RemoteControlReader reader = new RemoteControlReader(socket
        .getInputStream());
    reader.setSessionInfoVisitor(localWriter);
    reader.setExecutionDataVisitor(localWriter);

    // Send a dump command and read the response:
    writer.visitDumpCommand(true, false);
    reader.read();

    socket.close();
    localFile.close();
  }
View Full Code Here

        output = new Nul();
      }

      final Socket socket = new Socket(InetAddress.getByName(address),
          port);
      final RemoteControlWriter remoteWriter = new RemoteControlWriter(
          socket.getOutputStream());
      final RemoteControlReader remoteReader = new RemoteControlReader(
          socket.getInputStream());
      final ExecutionDataWriter outputWriter = new ExecutionDataWriter(
          output);
      remoteReader.setSessionInfoVisitor(outputWriter);
      remoteReader.setExecutionDataVisitor(outputWriter);

      remoteWriter.visitDumpCommand(dump, reset);
      // Read session and/or execution data
      remoteReader.read();

      socket.close();
    } catch (final IOException e) {
View Full Code Here

    f.get();
  }

  @Test
  public void testRemoteDump() throws Exception {
    final RemoteControlWriter remoteWriter = new RemoteControlWriter(
        mockConnection.getSocketB().getOutputStream());

    final TcpConnection con = new TcpConnection(
        mockConnection.getSocketA(), runtime);
    con.init();

    final Future<Void> f = executor.submit(new Callable<Void>() {
      public Void call() throws Exception {
        con.run();
        return null;
      }
    });

    assertBlocks(f);

    remoteWriter.visitDumpCommand(true, false);
    readAndAssertData();

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

    f.get();
  }

  @Test
  public void testLocalDump() throws Exception {
    new RemoteControlWriter(mockConnection.getSocketB().getOutputStream());

    final TcpConnection con = new TcpConnection(
        mockConnection.getSocketA(), runtime);
    con.init();
View Full Code Here

TOP

Related Classes of org.jacoco.core.runtime.RemoteControlWriter

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.