This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant: runnig unit tests from a JAR? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant: runnig unit tests from a JAR? " Watch "Ant: runnig unit tests from a JAR? " New topic
Author

Ant: runnig unit tests from a JAR?

Val Tkov
Greenhorn

Joined: Dec 09, 2004
Posts: 1
Is it possible to run JUnit tests from a JAR file?

This task does not work:

<junit fork="yes" printsummary="on" haltonfailure="yes" failureproperty="tests.failed">
<formatter type="plain" usefile="true" />
<batchtest todir="${test.reports}">
<fileset dir="dist">
<include name="**/Test*.class" />
</fileset>
</batchtest>
</junit>

The my.jar file is in the \dist directiry.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
The junit task certainly can run tests from a jar file. I don't know an easy way to select the tests from a jar via batchtest, though, sorry.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant: runnig unit tests from a JAR?
 
Similar Threads
Want to run multiple Test Cases by Ant ?
Ant runs tests twice?
Not able run junit test cases from ANT
ANT issues - Unable to create JUnit Reports- Please help
Junit and ant