Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ant: runnig unit tests from a JAR?

 
Val Tkov
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic