• 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

Ant - the junit task: can load TestCases from jar ?

 
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using an ant task (the < junit > task) to run my TestCases.
Since I have many TestCases, I use < batchtest > with some wild card notation (so that I don't have to list each test separately).
You get something like:



This example works, assuming the mentioned "testClasses" is a *directory*, holding my compiled TestCases.

However, my question is: can you make it take the TestCases from a *jar* or zip file (rather than a simple directory) ?
Namely, I'd like to compile my TestCases, jar them into a "test-cases.jar" file, and run them all from ant.
Of course, i'd still like to use wildcard notation ("**/*Test*.class").

Thanks.
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, since there's nothing magic about tests. They're just classes that follow a certain convention and extend certain base classes. So you can put your test classes in any classpath construct you like.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic