vendredi 3 juillet 2020

java get Test Annotation

in my project (ReflectionProject) i search all Tests method in all class in a generic JAR (JarTest1.jar).

In project JarTest1:

IF Tests methods are in Test Folder (Junit Test) when in my ReflectionProject do:

Annotation annTest = method.getAnnotation(Test.class);

I obtain annTest=null always.

IF Tests methods are in src/main/java/ my ReflectionProject work correctly infact :

Annotation annTest = method.getAnnotation(Test.class);
annTest != null..

I

Why? getAnnotation method of Reflection class dont work for Test folder ?

Thanks Regards





Aucun commentaire:

Enregistrer un commentaire