public class TestContext extends Object
MethodInterceptor it wishes to advise a test. Second that MethodInterceptor must have a zero argument
constructor. Third any state the MethodInterceptor should be done so in a thread safe way. Either all in the zero length
argument constructor, or with synchronized logic. Fourth if a MethodInterceptor needs to tear down state it has
constructed, it should implement Closeable Fifth the marking Annotation should have a single parameter
implementedBy with a default value of the Class of the MethodInterceptor the author wishes to use.| Constructor and Description |
|---|
TestContext()
When the context is constructed, it is registered for destruction.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Call all close methods implemented by any
MethodInterceptor instances stored in local cache. |
org.aopalliance.intercept.MethodInterceptor |
getAdviceFor(Annotation annotation,
ClassLoader classLoader)
Build and cache, or retrieve, a
MethodInterceptor associated with the annotationClass input, as specified, by
TestContext class documentation. |
boolean |
isAdviceAnnotation(Annotation annotation) |
public TestContext()
public org.aopalliance.intercept.MethodInterceptor getAdviceFor(Annotation annotation, ClassLoader classLoader)
MethodInterceptor associated with the annotationClass input, as specified, by
TestContext class documentation.annotation - the annotation who's related MethodInterceptor instance will be returned.classLoader - in which to load the MethodInterceptor.public void close()
MethodInterceptor instances stored in local cache.public boolean isAdviceAnnotation(Annotation annotation)
Copyright © 2016–2019 AdvisedTesting. All rights reserved.