|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.util.AnnotationConfigLoader<A,CFG>
A - The annotation class used for configuring the resource on a test objectCFG - The type of the resource configuration classpublic abstract class AnnotationConfigLoader<A extends java.lang.annotation.Annotation,CFG extends ResourceConfig>
Loads the configuration of a resource that is configured on a test object, by reading class, method or field level annotations. Also supports custom configuration methods.
| Field Summary | |
|---|---|
protected java.lang.Class<A> |
annotationClass
The annotation class used for configuring the resource on a test object |
| Constructor Summary | |
|---|---|
AnnotationConfigLoader(java.lang.Class<A> annotationClass)
Creates a new instance for the given annotation class |
|
| Method Summary | |
|---|---|
protected abstract CFG |
createResourceConfig(A configuringAnnotation,
java.lang.reflect.Method customConfigMethod)
Either the given configuring annotation or custom config method must not be null (may also both be not-null) |
protected java.lang.reflect.Method |
getCustomConfigMethod(java.lang.Class<?> testClass)
|
protected CFG |
getResourceConfig(java.lang.Class<?> testClass)
|
protected abstract boolean |
isConfiguringAnnotation(A annotation)
|
protected abstract boolean |
isCustomConfigMethod(java.lang.reflect.Method annotatedMethod)
|
CFG |
loadResourceConfig(java.lang.Object testObject)
Loads the resource configuration for the given test object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.Class<A extends java.lang.annotation.Annotation> annotationClass
| Constructor Detail |
|---|
public AnnotationConfigLoader(java.lang.Class<A> annotationClass)
annotationClass - The class of the configuring annotation, not null| Method Detail |
|---|
public CFG loadResourceConfig(java.lang.Object testObject)
loadResourceConfig in interface ResourceConfigLoader<CFG extends ResourceConfig>testObject - The test instance, not null
protected CFG getResourceConfig(java.lang.Class<?> testClass)
testClass - The test class, not null
protected abstract CFG createResourceConfig(A configuringAnnotation,
java.lang.reflect.Method customConfigMethod)
configuringAnnotation - Configuring annotation, if anycustomConfigMethod - Custom config method, if any
protected java.lang.reflect.Method getCustomConfigMethod(java.lang.Class<?> testClass)
testClass - The test class, not null
protected abstract boolean isCustomConfigMethod(java.lang.reflect.Method annotatedMethod)
annotatedMethod - A method annotated with annotationClass
protected abstract boolean isConfiguringAnnotation(A annotation)
annotation - Annotation of type annotationClass
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||