All test methods are not detected during instrumentation

Aryan April 21, 2015

I am using Maven. Tests are written in TestNG and all test methods have @Test annotation to it.
Problem is, not all test class name contains "Test" in it. So all test Methods are not detected. I don't have option to modify the names of all classes.
So like in Ant where we can specify
<testsources dir="tests">
<testclass name="*.java">
<testmethod annotation="Test"/>
<testmethod name="verify*"/>
</testclass>
<testsources>
Do you have any such option for Maven ?
Thanks !

1 answer

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 21, 2015

Hi Aryan,

Unfortunately, there's no such option in a Maven plugin. However, I think there is a way to workaround it. Clover's test detector looks for the following class and method patterns to determine whether it's a test or not:

https://confluence.atlassian.com/display/CLOVER/Clover+test+detection

As you can see in the article above, if you add a JavaDoc tag named "@testng.test" to a class, Clover should recognize it as a test one.

Cheers
Marek

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events