Package com.google.common.testing
Class ForwardingWrapperTester.InteractionTester<T>
java.lang.Object
com.google.common.reflect.AbstractInvocationHandler
com.google.common.testing.ForwardingWrapperTester.InteractionTester<T>
- All Implemented Interfaces:
InvocationHandler
- Enclosing class:
ForwardingWrapperTester
private static final class ForwardingWrapperTester.InteractionTester<T>
extends AbstractInvocationHandler
Tests a single interaction against a method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicInteger
private final Method
private final Object[]
private final Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
handleInvocation
(Object p, Method calledMethod, Object[] args) AbstractInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
delegates to this method upon any method invocation on the proxy instance, exceptObject.equals(java.lang.Object)
,Object.hashCode()
andObject.toString()
.(package private) void
testInteraction
(Function<? super T, ? extends T> wrapperFunction) toString()
By default delegates toObject.toString()
.Methods inherited from class com.google.common.reflect.AbstractInvocationHandler
equals, hashCode, invoke
-
Field Details
-
interfaceType
-
method
-
passedArgs
-
returnValue
-
called
-
-
Constructor Details
-
InteractionTester
-
-
Method Details
-
handleInvocation
Description copied from class:AbstractInvocationHandler
AbstractInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
delegates to this method upon any method invocation on the proxy instance, exceptObject.equals(java.lang.Object)
,Object.hashCode()
andObject.toString()
. The result will be returned as the proxied method's return value.Unlike
AbstractInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
,args
will never be null. When the method has no parameter, an empty array is passed in.- Specified by:
handleInvocation
in classAbstractInvocationHandler
- Throws:
Throwable
-
testInteraction
-
toString
Description copied from class:AbstractInvocationHandler
By default delegates toObject.toString()
. The dynamic proxies'toString()
will delegate to this method. Subclasses can override this method to provide custom string representation for the proxies.- Overrides:
toString
in classAbstractInvocationHandler
-