This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm looking for a better way to run *ALL* the tests within Ant. I'm doing it with a name pattern match way. The name of the class ending with Test will be included in the batchtest. It has a problem, someone might check-in some class named with *Test, which is not a JUnit test indeed. I've read some documents about TestSuite, the problem is I have to update it whenever a new test is added.
The conventions say that all class names with they keyword test within them are to be considered as TestCases. Maven also works in the same manner. It matched the pattern of the className and looks for Test in the name of each class. So I suggest that you decide a convention on what type of class names are to be used in your application.
Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
I second that notion. It is a generally accepted convention that only unit test classes end with the word Test. Trying to configure some custom way to cherry pick particular classes to run as tests does not sound like a very maintainable approach. It'll be quite a cognitive load to remember how it works, and then to communicate to the rest of your team, and keep that communication going to future teams.
Just stick with the currently accepted convention.