Package org.jboss.byteman.contrib.dtest
Class InstrumentedInstance
java.lang.Object
org.jboss.byteman.contrib.dtest.InstrumentedInstance
InstrumentedInstance instances serve two purposes:
Internally to the framework they provide storage of traced method invocation information
received from the remote execution via BytemanTestHelper->InstrumentedClass->this.
To the framework user, they provide utility methods for verifying expectations relating
to that remote execution e.g. the number of method calls made.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
addMethodTrace
(String methodName, Object[] args) Record a method invocation.void
assertMethodCallCount
(String message, String methodName, CallCount callCount) Checks that the number of known invocations of the given method falls within the specified range.int
getInvocationCount
(String methodName) Returns the number of known invocations of the given method upon the object instance.
-
Field Details
-
className
-
instanceId
-
methodTraces
-
-
Constructor Details
-
InstrumentedInstance
-
-
Method Details
-
addMethodTrace
Record a method invocation.- Parameters:
methodName
- the method that was traced.args
- the parameters to the method call.
-
getInvocationCount
Returns the number of known invocations of the given method upon the object instance.- Parameters:
methodName
- the method name to look for.- Returns:
- the number of invocations seen.
-
assertMethodCallCount
Checks that the number of known invocations of the given method falls within the specified range.- Parameters:
message
- the message to print in case of assertion failure.methodName
- the method name to look for.callCount
- the expected range for the invocation count.
-