Package org.testng.internal.annotations
Class AnnotationHelper
java.lang.Object
org.testng.internal.annotations.AnnotationHelper
Helper methods to find @Test and @Configuration tags. They minimize the amount of casting we need
to do.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final List<Class<? extends IAnnotation>> private static final List<Class<? extends IAnnotation>> private static final Loggerprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static IConfigurationAnnotationcreateConfiguration(IConfigurationAnnotation bs, IConfigurationAnnotation as, IConfigurationAnnotation bt, IConfigurationAnnotation at, IConfigurationAnnotation bg, IConfigurationAnnotation ag, IConfigurationAnnotation bc, IConfigurationAnnotation ac, IConfigurationAnnotation bm, IConfigurationAnnotation am) private static Stringstatic <A extends Annotation>
AfindAnnotationSuperClasses(Class<A> annotationClass, Class<?> parameterClass) static IConfigurationAnnotationfindConfiguration(IAnnotationFinder finder, Method m) static IConfigurationAnnotationstatic IFactoryAnnotationfindFactory(IAnnotationFinder finder, Constructor<?> c) static IFactoryAnnotationfindFactory(IAnnotationFinder finder, Method m) static ITestNGMethod[]findMethodsWithAnnotation(ITestObjectFactory objectFactory, Class<?> rootClass, Class<? extends IAnnotation> annotationClass, IAnnotationFinder annotationFinder, XmlTest xmlTest) static ITestAnnotationfindTest(IAnnotationFinder finder, Class<?> cls) static ITestAnnotationfindTest(IAnnotationFinder finder, Method m) static ITestAnnotationfindTest(IAnnotationFinder finder, ITestNGMethod m) private static voidstatic List<Class<? extends IAnnotation>> (package private) static <A extends Annotation>
AgetAnnotationFromClass(Class<?> clazz, Class<A> a) (package private) static <A extends Annotation>
AgetAnnotationFromConstructor(Constructor<?> c, Class<A> a) (package private) static <A extends Annotation>
AgetAnnotationFromMethod(Method method, Class<A> a) private static booleanisAnnotationPresent(IAnnotationFinder annotationFinder, Class<?> cls, Class<? extends IAnnotation> annotationClass) private static booleanisAnnotationPresent(IAnnotationFinder annotationFinder, Method m) private static booleanisAnnotationPresent(IAnnotationFinder annotationFinder, Method m, Class<? extends IAnnotation> annotationClass)
-
Field Details
-
LOGGER
-
SUFFIX
- See Also:
-
ALL_ANNOTATIONS
-
CONFIGURATION_CLASSES
-
-
Constructor Details
-
AnnotationHelper
private AnnotationHelper()
-
-
Method Details
-
findTest
-
findTest
-
findTest
-
findFactory
-
findFactory
-
findConfiguration
public static IConfigurationAnnotation findConfiguration(IAnnotationFinder finder, ConstructorOrMethod m) -
findConfiguration
-
createConfiguration
private static IConfigurationAnnotation createConfiguration(IConfigurationAnnotation bs, IConfigurationAnnotation as, IConfigurationAnnotation bt, IConfigurationAnnotation at, IConfigurationAnnotation bg, IConfigurationAnnotation ag, IConfigurationAnnotation bc, IConfigurationAnnotation ac, IConfigurationAnnotation bm, IConfigurationAnnotation am) -
finishInitialize
-
getAllAnnotations
-
findMethodsWithAnnotation
public static ITestNGMethod[] findMethodsWithAnnotation(ITestObjectFactory objectFactory, Class<?> rootClass, Class<? extends IAnnotation> annotationClass, IAnnotationFinder annotationFinder, XmlTest xmlTest) -
findAnnotationSuperClasses
public static <A extends Annotation> A findAnnotationSuperClasses(Class<A> annotationClass, Class<?> parameterClass) -
isAnnotationPresent
-
isAnnotationPresent
private static boolean isAnnotationPresent(IAnnotationFinder annotationFinder, Method m, Class<? extends IAnnotation> annotationClass) -
isAnnotationPresent
private static boolean isAnnotationPresent(IAnnotationFinder annotationFinder, Class<?> cls, Class<? extends IAnnotation> annotationClass) -
createMethodKey
- Returns:
- A hashcode representing the name of this method and its parameters, but without its class
-
getAnnotationFromClass
-
getAnnotationFromMethod
-
getAnnotationFromConstructor
-