Package org.testng.remote.strprotocol
Class StdoutMessageSender
- java.lang.Object
-
- org.testng.remote.strprotocol.StdoutMessageSender
-
- All Implemented Interfaces:
IMessageSender
public class StdoutMessageSender extends java.lang.Object implements IMessageSender
this is a dummy IMessageSender implementation for test purpose only.
-
-
Constructor Summary
Constructors Constructor Description StdoutMessageSender()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect()
void
initReceiver()
Initialize the receiver.IMessage
receiveMessage()
Will return null or throw EOFException when the connection has been severed.void
sendAck()
void
sendMessage(IMessage message)
void
sendStop()
void
shutDown()
void
stopReceiver()
Stop the receiver.
-
-
-
Method Detail
-
connect
public void connect() throws java.io.IOException
- Specified by:
connect
in interfaceIMessageSender
- Throws:
java.io.IOException
-
initReceiver
public void initReceiver() throws java.net.SocketTimeoutException
Description copied from interface:IMessageSender
Initialize the receiver. the underlying socket server will be polling until a first client connect.- Specified by:
initReceiver
in interfaceIMessageSender
- Throws:
java.net.SocketTimeoutException
-
stopReceiver
public void stopReceiver()
Description copied from interface:IMessageSender
Stop the receiver. it provides a way that allow the API invoker to stop the receiver, e.g. break from a dead while loop- Specified by:
stopReceiver
in interfaceIMessageSender
-
sendMessage
public void sendMessage(IMessage message) throws java.lang.Exception
- Specified by:
sendMessage
in interfaceIMessageSender
- Throws:
java.lang.Exception
-
receiveMessage
public IMessage receiveMessage() throws java.lang.Exception
Description copied from interface:IMessageSender
Will return null or throw EOFException when the connection has been severed.- Specified by:
receiveMessage
in interfaceIMessageSender
- Throws:
java.lang.Exception
-
shutDown
public void shutDown()
- Specified by:
shutDown
in interfaceIMessageSender
-
sendAck
public void sendAck()
- Specified by:
sendAck
in interfaceIMessageSender
-
sendStop
public void sendStop()
- Specified by:
sendStop
in interfaceIMessageSender
-
-