• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

A better way to run all the JUnit tests within Ant?

 
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Do you have better ways to do this job?

Thanks.
 
Ranch Hand
Posts: 440
Hibernate Eclipse IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 5555
326
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Did you just should on me? You should read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic