Search in sources :

Example 1 with ExceptionRecorder

use of org.jacoco.agent.rt.internal.ExceptionRecorder in project jacoco by jacoco.

the class TcpClientOutputTest method setup.

@Before
public void setup() throws Exception {
    logger = new ExceptionRecorder();
    final MockSocketConnection con = new MockSocketConnection();
    localSocket = con.getSocketA();
    remoteSocket = con.getSocketB();
    remoteWriter = new RemoteControlWriter(remoteSocket.getOutputStream());
    controller = new TcpClientOutput(logger) {

        @Override
        protected Socket createSocket(AgentOptions options) throws IOException {
            return localSocket;
        }
    };
    data = new RuntimeData();
    controller.startup(new AgentOptions(), data);
    remoteReader = new RemoteControlReader(remoteSocket.getInputStream());
}
Also used : RemoteControlWriter(org.jacoco.core.runtime.RemoteControlWriter) RuntimeData(org.jacoco.core.runtime.RuntimeData) ExceptionRecorder(org.jacoco.agent.rt.internal.ExceptionRecorder) IOException(java.io.IOException) AgentOptions(org.jacoco.core.runtime.AgentOptions) Socket(java.net.Socket) MockSocket(org.jacoco.agent.rt.internal.output.MockSocketConnection.MockSocket) RemoteControlReader(org.jacoco.core.runtime.RemoteControlReader) Before(org.junit.Before)

Example 2 with ExceptionRecorder

use of org.jacoco.agent.rt.internal.ExceptionRecorder in project jacoco by jacoco.

the class TcpServerOutputTest method setup.

@Before
public void setup() throws Exception {
    options = new AgentOptions();
    logger = new ExceptionRecorder();
    serverSocket = new MockServerSocket();
    controller = new TcpServerOutput(logger) {

        @Override
        protected ServerSocket createServerSocket(AgentOptions options) throws IOException {
            return serverSocket;
        }
    };
    data = new RuntimeData();
    controller.startup(options, data);
}
Also used : RuntimeData(org.jacoco.core.runtime.RuntimeData) ExceptionRecorder(org.jacoco.agent.rt.internal.ExceptionRecorder) ServerSocket(java.net.ServerSocket) IOException(java.io.IOException) AgentOptions(org.jacoco.core.runtime.AgentOptions) Before(org.junit.Before)

Aggregations

IOException (java.io.IOException)2 ExceptionRecorder (org.jacoco.agent.rt.internal.ExceptionRecorder)2 AgentOptions (org.jacoco.core.runtime.AgentOptions)2 RuntimeData (org.jacoco.core.runtime.RuntimeData)2 Before (org.junit.Before)2 ServerSocket (java.net.ServerSocket)1 Socket (java.net.Socket)1 MockSocket (org.jacoco.agent.rt.internal.output.MockSocketConnection.MockSocket)1 RemoteControlReader (org.jacoco.core.runtime.RemoteControlReader)1 RemoteControlWriter (org.jacoco.core.runtime.RemoteControlWriter)1