org.jboss.byteman.contrib.dtest
Class InstrumentedInstance

java.lang.Object
  extended by org.jboss.byteman.contrib.dtest.InstrumentedInstance

public class InstrumentedInstance
extends java.lang.Object

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.

Author:
Jonathan Halliday (jonathan.halliday@redhat.com) 2010-05

Method Summary
 void assertMethodCallCount(java.lang.String message, java.lang.String methodName, CallCount callCount)
          Checks that the number of known invocations of the given method falls within the specified range.
 int getInvocationCount(java.lang.String methodName)
          Returns the number of known invocations of the given method upon the object instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInvocationCount

public int getInvocationCount(java.lang.String methodName)
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

public void assertMethodCallCount(java.lang.String message,
                                  java.lang.String methodName,
                                  CallCount callCount)
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.


Copyright © 2011. All Rights Reserved.