edu.sdsc.inca.agent
Class ReporterManagerControllerTest.MockAgent

java.lang.Object
  extended by java.lang.Thread
      extended by edu.sdsc.inca.agent.ReporterManagerControllerTest.MockAgent
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
ReporterManagerControllerTest

public static class ReporterManagerControllerTest.MockAgent
extends java.lang.Thread

Emulates the agent's tasks


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 int numConnections
           
 int numConnectionsReceived
           
 int port
           
 edu.sdsc.inca.protocol.ProtocolReader reader
           
 edu.sdsc.inca.protocol.ProtocolWriter writer
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ReporterManagerControllerTest.MockAgent(boolean auth, ReporterManagerController rmc)
           
 
Method Summary
 void cleanup()
          Ensure's correct cleanup.
 java.lang.String mockAgentRegister()
          Mimics the agent's register task
 void run()
          Allows this mock agent to be run as a thread
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

writer

public edu.sdsc.inca.protocol.ProtocolWriter writer

reader

public edu.sdsc.inca.protocol.ProtocolReader reader

port

public int port

numConnections

public int numConnections

numConnectionsReceived

public int numConnectionsReceived
Constructor Detail

ReporterManagerControllerTest.MockAgent

public ReporterManagerControllerTest.MockAgent(boolean auth,
                                               ReporterManagerController rmc)
                                        throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

run

public void run()
Allows this mock agent to be run as a thread

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

mockAgentRegister

public java.lang.String mockAgentRegister()
                                   throws java.lang.Exception
Mimics the agent's register task

Returns:
The name of the resource that registered.
Throws:
java.lang.Exception - if test fails

cleanup

public void cleanup()
             throws java.io.IOException
Ensure's correct cleanup. Shutdown the reporter manager and close the streams and sockets.

Throws:
java.io.IOException - if problem cleaning up