my dog learned polymorphism*
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant 1.7 + Junit 4 problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant 1.7 + Junit 4 problems" Watch "Ant 1.7 + Junit 4 problems" New topic
Author

Ant 1.7 + Junit 4 problems

Gorby Green
Greenhorn

Joined: Nov 23, 2002
Posts: 12
Having some problems with configuring junit 4 in ant 1.7.
This is how the target looks like:

This is the exception:

Is there something specific i need to think about when using these things?
Have "wasted" an entire work day trying to figure this out.

// Gorby
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39551
    
  27
Have you read the documentation? It explicitly states that the name attribute is a classname, not a file name. The fact that you're getting a ClassNotFoundException should also be a clue.

The docs also explain what to do if you want to run several tests (namely, use the <batchtest> tag).
[ September 18, 2008: Message edited by: Ulf Dittmer ]

Ping & DNS - updated with new look and Ping home screen widget
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2477
    
    7

The test name attribute expects a Java class.
If you look at the examples, you can see that a valid classname like my.test.TestCase is expected.

You are passing C:\client\test\AllTests.*
That is not a valid Java class. That is a dos filemask.

To do what you want to do, please have a look at the batchtest example found on the same link given above.

Regards, Jan

[ah! parallel posts]
[ September 18, 2008: Message edited by: Jan Cumps ]

OCUP UML fundamental and ITIL foundation
youtube channel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant 1.7 + Junit 4 problems
 
Similar Threads
Could not create JUNIT HTML reports?
Ant + Junit + Log4J Problem
ANT JUnit Problem
using ant and junit getting ClassDefNotFoundException
[junit] java.lang.ClassNotFoundException: UserActivityTest