File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant-junit batch test Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant-junit batch test" Watch "Ant-junit batch test" New topic
Author

Ant-junit batch test

rakesh sugirtharaj
Ranch Hand

Joined: Dec 16, 2007
Posts: 151
Hi,

When i do a batch test using ant junit task, why do i have to include .java files in my fileset?


Cheers!
RSR
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

Rakesh,
You don't. The JUnit batch task uses compiled code (.class or .jar files.)


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
rakesh sugirtharaj
Ranch Hand

Joined: Dec 16, 2007
Posts: 151
Hi Jeanne,

I found this in 'JUnit in action' book and also in junit-ant task document. The build code goes like this
Kindly explain.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

Rakesh,
This example uses .class. I also have a couple working examples with .class. I tried changing one of them to .java and it couldn't find the test. I'm inclined to think the manual has a typo.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

Just noticed this is more likely to get a response in the Build forum rather than the Testing one. Moving now.
rakesh sugirtharaj
Ranch Hand

Joined: Dec 16, 2007
Posts: 151
Jeanne,

Thanks for the link. But my code worked perfectly when i used .java files in my fileset.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

I'm only going of the Javadoc for the latest version of ANT here and it reads:

"Define a number of tests based on pattern matching.

batchtest collects the included resources from any number of nested Resource Collections. It then generates a test class name for each resource that ends in .java or .class."

see here for details.

Looks like it works for both (using the latest version of ANT)?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant-junit batch test