nl.cwi.sen1.tunit
Class TestToolBridge
java.lang.Object
toolbus.adapter.ToolBridge
nl.cwi.sen1.tunit.TestToolBridge
- All Implemented Interfaces:
- java.lang.Runnable, toolbus.communication.IDataHandler, toolbus.IOperations
public class TestToolBridge
- extends toolbus.adapter.ToolBridge
Fields inherited from interface toolbus.IOperations |
ACKDO, ACKEVENT, CONNECT, DEBUGPERFORMANCESTATS, DISCONNECT, DO, END, EVAL, EVENT, PERFORMANCESTATS, REQUEST, RESPONSE, TERMINATE, UNDEFINED, VALUE |
Constructor Summary |
TestToolBridge(TUnitTestCase testCase,
aterm.pure.PureFactory termFactory,
toolbus.adapter.AbstractTool tool,
java.lang.String toolName,
int toolID,
java.lang.ClassLoader classLoader,
toolbus.ToolBus toolbus,
boolean verbose)
|
TestToolBridge(TUnitTestCase testCase,
aterm.pure.PureFactory termFactory,
toolbus.adapter.AbstractTool tool,
java.lang.String toolName,
int toolID,
java.net.InetAddress host,
int port,
boolean verbose)
|
Methods inherited from class toolbus.adapter.ToolBridge |
exceptionOccured, getFactory, getHost, getPort, getToolID, getToolName, getType, postEvent, postRequest, run, send, setIOHandler, setToolID, shutDown, terminate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULTTIMEOUT
public static final long DEFAULTTIMEOUT
- See Also:
- Constant Field Values
completionLock
private final java.lang.Object completionLock
expectLock
private final TestToolBridge.WaitLock expectLock
actionLock
private final TestToolBridge.WaitLock actionLock
testCase
private final TUnitTestCase testCase
termFactory
private final aterm.pure.PureFactory termFactory
tool
private final toolbus.adapter.AbstractTool tool
expectedAckEvents
private final java.util.Map<java.lang.String,TestToolBridge.WaitLock> expectedAckEvents
expectedEvals
private final java.util.Map<aterm.ATerm,aterm.ATerm> expectedEvals
expectedDos
private final java.util.Set<aterm.ATerm> expectedDos
actionQueue
private final java.util.List<aterm.ATerm> actionQueue
expecting
private volatile boolean expecting
verbose
private final boolean verbose
TestToolBridge
public TestToolBridge(TUnitTestCase testCase,
aterm.pure.PureFactory termFactory,
toolbus.adapter.AbstractTool tool,
java.lang.String toolName,
int toolID,
java.net.InetAddress host,
int port,
boolean verbose)
TestToolBridge
public TestToolBridge(TUnitTestCase testCase,
aterm.pure.PureFactory termFactory,
toolbus.adapter.AbstractTool tool,
java.lang.String toolName,
int toolID,
java.lang.ClassLoader classLoader,
toolbus.ToolBus toolbus,
boolean verbose)
receive
public void receive(byte operation,
aterm.ATerm aTerm)
- Specified by:
receive
in interface toolbus.communication.IDataHandler
- Overrides:
receive
in class toolbus.adapter.ToolBridge
checkSignature
public boolean checkSignature(aterm.ATerm signature)
- Specified by:
checkSignature
in class toolbus.adapter.ToolBridge
doDo
public void doDo(aterm.ATerm aTerm)
- Specified by:
doDo
in class toolbus.adapter.ToolBridge
doEval
public aterm.ATerm doEval(aterm.ATerm aTerm)
- Specified by:
doEval
in class toolbus.adapter.ToolBridge
doGetPerformanceStats
public aterm.ATerm doGetPerformanceStats()
- Specified by:
doGetPerformanceStats
in class toolbus.adapter.ToolBridge
doReceiveAckEvent
public void doReceiveAckEvent(aterm.ATerm aTerm)
- Specified by:
doReceiveAckEvent
in class toolbus.adapter.ToolBridge
doTerminate
public void doTerminate(aterm.ATerm aTerm)
- Specified by:
doTerminate
in class toolbus.adapter.ToolBridge
sendEvent
public void sendEvent(aterm.ATerm event,
long timeout)
sendRequest
public aterm.ATerm sendRequest(aterm.ATerm request,
aterm.ATerm expectedResponse,
long timeout)
registerForDo
public void registerForDo(aterm.ATerm action)
registerForEval
public void registerForEval(aterm.ATerm action,
aterm.ATerm expectedResult)
expectAction
public void expectAction(long timeout)
waitForCompletion
public void waitForCompletion(long timeout)
getPerformanceStats
private aterm.ATerm getPerformanceStats()
- Gathers performance statistics about this tool, like memory usage and the user-/system-time
spend per thread.
- Returns:
- Performance statictics.