Class InstrumentedInstance

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

public class InstrumentedInstance extends 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.
  • Field Details

    • className

      private final String className
    • instanceId

      private final Integer instanceId
    • methodTraces

      private final Queue<String> methodTraces
  • Constructor Details

    • InstrumentedInstance

      InstrumentedInstance(String className, Integer instanceId)
  • Method Details

    • addMethodTrace

      void addMethodTrace(String methodName, Object[] args)
      Record a method invocation.
      Parameters:
      methodName - the method that was traced.
      args - the parameters to the method call.
    • getInvocationCount

      public int getInvocationCount(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(String message, 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.