public class CommonProxyInterceptor extends Observable
InternalInterceptor as well as InternalInvocationhandler| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOG
Logger implementation
|
| Constructor and Description |
|---|
CommonProxyInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
void |
compareTime(Long timeTakenInNanos,
Method method,
MethodUnderTestDuration durationBean)
Compare the time taken by the method to the expected runtime.
|
Long |
getExpectedRunTime()
Get the maximum time in milliseconds that a method under test should take to run.
|
Long |
getExpectedTimeInNano(Long timeInMillis)
Get the expected time in Nano seconds
|
Object |
getTargetInstance()
The actual instance of the class that is being proxied
|
MethodIntercepter |
getUserIntercepter()
Get the User supplied
MethodIntercepter implementation. |
Object |
intercept(Method method,
Object[] args)
A common Interceptor method for both
InternalInvocationhandler and
InternalInterceptor that handles delegation to a user defined interceptor
and also compares the time taken by the method to the time a user expects a method
to be completed |
void |
setExpectedRunTime(Long expectedRunTime)
Set the maximum time in milliseconds that a method under test should take to run.
|
void |
setTargetInstance(Object targetInstance)
Set instance of the class that is being proxied
|
void |
setUserIntercepter(MethodIntercepter userIntercepter)
the User supplied
MethodIntercepter implementation. |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedpublic MethodIntercepter getUserIntercepter()
MethodIntercepter implementation.
Defaults to DefaultMethodIntercepterpublic void setUserIntercepter(MethodIntercepter userIntercepter)
MethodIntercepter implementation.
Defaults to DefaultMethodIntercepteruserIntercepter - the userIntercepter to setpublic Object getTargetInstance()
public void setTargetInstance(Object targetInstance)
targetInstance - the targetInstance to setpublic Long getExpectedRunTime()
public void setExpectedRunTime(Long expectedRunTime)
expectedRunTime - the expectedRunTime to setpublic Long getExpectedTimeInNano(Long timeInMillis)
timeInMillis - the given time in millispublic void compareTime(Long timeTakenInNanos, Method method, MethodUnderTestDuration durationBean)
timeTakenInNanos - time taken by the method under testmethod - Name of the methoddurationBean - the instance of MethodUnderTestDurationpublic Object intercept(Method method, Object[] args) throws Throwable
InternalInvocationhandler and
InternalInterceptor that handles delegation to a user defined interceptor
and also compares the time taken by the method to the time a user expects a method
to be completedmethod - the method to invokeargs - the arguments to the methodThrowable - if any exception occursCopyright © 2014. All rights reserved.