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 Logger
private static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static IConfigurationAnnotation
createConfiguration
(IConfigurationAnnotation bs, IConfigurationAnnotation as, IConfigurationAnnotation bt, IConfigurationAnnotation at, IConfigurationAnnotation bg, IConfigurationAnnotation ag, IConfigurationAnnotation bc, IConfigurationAnnotation ac, IConfigurationAnnotation bm, IConfigurationAnnotation am) private static String
static <A extends Annotation>
AfindAnnotationSuperClasses
(Class<A> annotationClass, Class<?> parameterClass) static IConfigurationAnnotation
findConfiguration
(IAnnotationFinder finder, Method m) static IConfigurationAnnotation
static IFactoryAnnotation
findFactory
(IAnnotationFinder finder, Constructor c) static IFactoryAnnotation
findFactory
(IAnnotationFinder finder, Method m) static ITestNGMethod[]
findMethodsWithAnnotation
(Class<?> rootClass, Class<? extends IAnnotation> annotationClass, IAnnotationFinder annotationFinder, XmlTest xmlTest) static ITestAnnotation
findTest
(IAnnotationFinder finder, Class<?> cls) static ITestAnnotation
findTest
(IAnnotationFinder finder, Method m) static ITestAnnotation
findTest
(IAnnotationFinder finder, ITestNGMethod m) private static void
static 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 boolean
isAnnotationPresent
(IAnnotationFinder annotationFinder, Class<?> cls, Class<? extends IAnnotation> annotationClass) private static boolean
isAnnotationPresent
(IAnnotationFinder annotationFinder, Method m) private static boolean
isAnnotationPresent
(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(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
-