|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.flexunit.ant.FlexUnitSocketServer
public class FlexUnitSocketServer
Class responsible for managing the connections to the test runner and any boiler plate in the network interactivity.
Field Summary | |
---|---|
private java.net.Socket |
clientSocket
|
private static java.lang.String |
DOMAIN_POLICY
|
private static java.lang.String |
END_OF_TEST_RUN
|
private static java.lang.String |
END_OF_TEST_RUN_ACK
|
private int |
inboundBufferSize
|
private java.io.InputStreamReader |
inboundReader
|
private static char |
NULL_BYTE
|
private java.io.OutputStreamWriter |
outboundWriter
|
private static java.lang.String |
POLICY_FILE_REQUEST
|
private int |
port
|
private java.net.ServerSocket |
serverSocket
|
private static java.lang.String |
START_OF_TEST_RUN_ACK
|
private int |
timeout
|
private boolean |
waitForPolicyFile
|
Constructor Summary | |
---|---|
FlexUnitSocketServer(int port,
int timeout,
int inboundBufferSize,
boolean waitForPolicyFile)
|
Method Summary | |
---|---|
private void |
closeClientSocket()
Closes the client connection and all buffers, ignoring any errors |
private void |
closeServerSocket()
Closes the server socket. |
private void |
openClientSocket()
Creates the client connection. |
private void |
openServerSocket()
Creates a connection on the specified socket. |
private void |
prepareClientSocket()
Decides whether to send a policy request or a start ack |
java.lang.String |
readNextTokenFromSocket()
Reads tokens from the socket input stream based on NULL_BYTE as a delimiter |
private void |
resetInboundStream()
Resets the client connection. |
private void |
sendOutboundMessage(java.lang.String message)
|
private void |
sendPolicyFile()
Generate domain policy message and send |
private void |
sendTestRunEndAcknowledgement()
Sends the end of test run to the listener to close the connection |
private void |
sendTestRunStartAcknowledgement()
Generate and send message to inform test runner to begin sending test data |
void |
start()
Starts the socket server, managing policy file requests, and starting the test process. |
void |
stop()
Stops the socket server, notifying the test runner, and closing the appropriate connections. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final char NULL_BYTE
private static final java.lang.String POLICY_FILE_REQUEST
private static final java.lang.String DOMAIN_POLICY
private static final java.lang.String START_OF_TEST_RUN_ACK
private static final java.lang.String END_OF_TEST_RUN
private static final java.lang.String END_OF_TEST_RUN_ACK
private int port
private int timeout
private int inboundBufferSize
private boolean waitForPolicyFile
private java.net.ServerSocket serverSocket
private java.net.Socket clientSocket
private java.io.InputStreamReader inboundReader
private java.io.OutputStreamWriter outboundWriter
Constructor Detail |
---|
public FlexUnitSocketServer(int port, int timeout, int inboundBufferSize, boolean waitForPolicyFile)
Method Detail |
---|
public void start() throws java.io.IOException
java.io.IOException
private void resetInboundStream() throws java.io.IOException
java.io.IOException
private void openServerSocket() throws java.io.IOException
java.io.IOException
private void openClientSocket() throws java.io.IOException
java.io.IOException
private void prepareClientSocket() throws java.io.IOException
java.io.IOException
private void sendPolicyFile() throws java.io.IOException
java.io.IOException
private void sendTestRunStartAcknowledgement() throws java.io.IOException
java.io.IOException
public java.lang.String readNextTokenFromSocket() throws java.io.IOException
java.io.IOException
private void sendOutboundMessage(java.lang.String message) throws java.io.IOException
java.io.IOException
public void stop() throws java.io.IOException
java.io.IOException
private void sendTestRunEndAcknowledgement() throws java.io.IOException
java.io.IOException
private void closeClientSocket() throws java.io.IOException
java.io.IOException
private void closeServerSocket() throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |