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

    new Expectations() {{
        //make sure the TCPTEST IN 80 cmd is sent exactly once
        controlConnection.sendTaskCommand((AbstractQoSTask) any, "TCPTEST IN 80", (ControlConnectionResponseCallback) any);
        times = 1;
        socket.getInputStream();
        result = new ByteArrayInputStream("PING".getBytes());
    }};
    final TcpTask tcpTask = new TcpTask(qosTest, incomingTaskDesc, 0);
    tcpTask.setControlConnection(controlConnection);
    final QoSTestResult res = tcpTask.call();
    assertEquals("Result did not return OK","OK", res.getResultMap().get(TcpTask.RESULT_IN));
    assertEquals("Incorrect received result", "PING", res.getResultMap().get(TcpTask.RESULT_RESPONSE_IN));
    assertEquals("Incorrect test in port", 80, res.getResultMap().get(TcpTask.RESULT_PORT_IN));
}