@Test
public void testTcpOutgoingSuccessful (@Mocked final QoSControlConnection controlConnection,
                             @Mocked final Socket socket) throws Exception {

    new Expectations() {{
        controlConnection.sendTaskCommand((AbstractQoSTask) any, withPrefix("TCPTEST OUT"), (ControlConnectionResponseCallback) any);
        result = new Delegate () {
            public void delegateMethod (AbstractQoSTask qoSTask, String cmd, ControlConnectionResponseCallback callback) {
                callback.onResponse("OK", cmd);
            }
        };
        socket.getInputStream();
        result = new ByteArrayInputStream("PING".getBytes());
        socket.getOutputStream();
        result = testOutputStream;
    }};
    final TcpTask tcpTask = new TcpTask(qosTest, clientHolder.getTaskDescList().get(0), 0);
    tcpTask.setControlConnection(controlConnection);
    final QoSTestResult res = tcpTask.call();
    assertEquals("Result did not return OK","OK", res.getResultMap().get(TcpTask.RESULT_OUT));
    assertEquals("Payload sent to server != PING", "PING\n", testOutputStream.toString());
    assertEquals("Incorrect received result", "PING", res.getResultMap().get(TcpTask.RESULT_RESPONSE_OUT));
    assertEquals("Incorrect test out port", 80, res.getResultMap().get(TcpTask.RESULT_PORT_OUT));
}