|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.junit.runners.model.TestClass
public class TestClass
Wraps a class to be run, providing method validation and annotation searching
Constructor Summary | |
---|---|
TestClass(Class<?> clazz)
Creates a TestClass wrapping clazz . |
Method Summary | ||
---|---|---|
protected static
|
addToAnnotationLists(T member,
Map<Class<? extends Annotation>,List<T>> map)
|
|
boolean |
equals(Object obj)
|
|
List<FrameworkField> |
getAnnotatedFields()
Returns, efficiently, all the non-overridden fields in this class and its superclasses that are annotated. |
|
List<FrameworkField> |
getAnnotatedFields(Class<? extends Annotation> annotationClass)
Returns, efficiently, all the non-overridden fields in this class and its superclasses that are annotated with annotationClass . |
|
|
getAnnotatedFieldValues(Object test,
Class<? extends Annotation> annotationClass,
Class<T> valueClass)
|
|
List<FrameworkMethod> |
getAnnotatedMethods()
Returns, efficiently, all the non-overridden methods in this class and its superclasses that are annotated}. |
|
List<FrameworkMethod> |
getAnnotatedMethods(Class<? extends Annotation> annotationClass)
Returns, efficiently, all the non-overridden methods in this class and its superclasses that are annotated with annotationClass . |
|
|
getAnnotatedMethodValues(Object test,
Class<? extends Annotation> annotationClass,
Class<T> valueClass)
|
|
|
getAnnotation(Class<T> annotationType)
Returns the annotation on the model element of the given type, or @code{null} |
|
Annotation[] |
getAnnotations()
Returns the annotations on this class |
|
Class<?> |
getJavaClass()
Returns the underlying Java class. |
|
String |
getName()
Returns the class's name. |
|
Constructor<?> |
getOnlyConstructor()
Returns the only public constructor in the class, or throws an AssertionError if there are more or less than one. |
|
int |
hashCode()
|
|
boolean |
isANonStaticInnerClass()
|
|
boolean |
isPublic()
|
|
protected void |
scanAnnotatedMembers(Map<Class<? extends Annotation>,List<FrameworkMethod>> methodsForAnnotations,
Map<Class<? extends Annotation>,List<FrameworkField>> fieldsForAnnotations)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TestClass(Class<?> clazz)
TestClass
wrapping clazz
. Each time this
constructor executes, the class is scanned for annotations, which can be
an expensive process (we hope in future JDK's it will not be.) Therefore,
try to share instances of TestClass
where possible.
Method Detail |
---|
protected void scanAnnotatedMembers(Map<Class<? extends Annotation>,List<FrameworkMethod>> methodsForAnnotations, Map<Class<? extends Annotation>,List<FrameworkField>> fieldsForAnnotations)
protected static <T extends FrameworkMember<T>> void addToAnnotationLists(T member, Map<Class<? extends Annotation>,List<T>> map)
public List<FrameworkMethod> getAnnotatedMethods()
public List<FrameworkMethod> getAnnotatedMethods(Class<? extends Annotation> annotationClass)
annotationClass
.
public List<FrameworkField> getAnnotatedFields()
public List<FrameworkField> getAnnotatedFields(Class<? extends Annotation> annotationClass)
annotationClass
.
public Class<?> getJavaClass()
public String getName()
public Constructor<?> getOnlyConstructor()
AssertionError
if there are more or less than one.
public Annotation[] getAnnotations()
getAnnotations
in interface Annotatable
public <T extends Annotation> T getAnnotation(Class<T> annotationType)
Annotatable
getAnnotation
in interface Annotatable
public <T> List<T> getAnnotatedFieldValues(Object test, Class<? extends Annotation> annotationClass, Class<T> valueClass)
public <T> List<T> getAnnotatedMethodValues(Object test, Class<? extends Annotation> annotationClass, Class<T> valueClass)
public boolean isPublic()
public boolean isANonStaticInnerClass()
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |