Package org.jacoco.core.runtime

Examples of org.jacoco.core.runtime.RemoteControlWriter


  @Test
  public void testLocalDump() throws Exception {
    data.getExecutionData(Long.valueOf(0x12345678), "Foo", 42);
    data.setSessionId("stubid");

    new RemoteControlWriter(mockConnection.getSocketB().getOutputStream());

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


  @Test
  public void testRemoteReset() throws Exception {
    data.getExecutionData(Long.valueOf(123), "Foo", 1).getProbes()[0] = true;

    final RemoteControlWriter remoteWriter = new RemoteControlWriter(
        mockConnection.getSocketB().getOutputStream());

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

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

    assertBlocks(f);

    remoteWriter.visitDumpCommand(false, true);

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

    final ExecutionDataStore execStore = new ExecutionDataStore();
View Full Code Here

    final ExecutionDataWriter localWriter = new ExecutionDataWriter(
        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

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

  public void testWriteExecutionData() throws Exception {
    data.getExecutionData(Long.valueOf(0x12345678), "Foo", 42);
    data.setSessionId("stubid");

    final Socket socket = serverSocket.connect();
    final RemoteControlWriter remoteWriter = new RemoteControlWriter(
        socket.getOutputStream());
    final RemoteControlReader remoteReader = new RemoteControlReader(
        socket.getInputStream());

    // First process a NOP command to ensure the connection is initialized:
    remoteWriter.visitDumpCommand(false, false);
    remoteReader.read();

    // Now the actual test starts:
    controller.writeExecutionData(false);
View Full Code Here

  public void accept(IExecutionDataVisitor executionDataVisitor,
      ISessionInfoVisitor sessionInfoVisitor) throws CoreException {
    try {
      final Socket socket = new Socket(address, port);
      final RemoteControlWriter writer = new RemoteControlWriter(
          socket.getOutputStream());
      final RemoteControlReader reader = new RemoteControlReader(
          socket.getInputStream());
      reader.setExecutionDataVisitor(executionDataVisitor);
      reader.setSessionInfoVisitor(sessionInfoVisitor);
      writer.visitDumpCommand(true, reset);
      reader.read();
      socket.close();
    } catch (IOException e) {
      throw new CoreException(EclEmmaStatus.AGENT_CONNECT_ERROR.getStatus(
          address, Integer.valueOf(port), e));
View Full Code Here

  @Override
  protected IStatus run(IProgressMonitor monitor) {
    try {
      final Socket socket = serverSocket.accept();
      writer = new RemoteControlWriter(socket.getOutputStream());
      final RemoteControlReader reader = new RemoteControlReader(
          socket.getInputStream());
      while (true) {
        final MemoryExecutionDataSource memory = new MemoryExecutionDataSource();
        memory.readFrom(reader);
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.