| Author |
Juint task in Ant
|
Hongli Li
Ranch Hand
Joined: Oct 29, 2006
Posts: 124
|
|
Hi, folks, I spent the whole afternoon trying to figure out why I couldn't run junit with ant, but unfortunately, it didn't work for me.Can somebody help me? part of my build.xml: I'm sure the sequence of compiling test and source code is correct, I added the lib, src/classes, and test/classes to test.classpath which is defined in path datatype. I test my code in Junit from Eclipse, it passed! When I tried to run it with ANT, then I always got this error: here is the console output: I also tried to run ant in eclipse, it didn't work in eclipse neither. When I run "which ant" in my console, it displays /usr/bin/ant. Anyone has any clue? Any suggestion is high appreciated.  [ January 10, 2008: Message edited by: Hongli Li ]
|
Do you know why this cup is useful? Because it is empty.
|
 |
Jan Cumps
Bartender
Joined: Dec 20, 2006
Posts: 2343
|
|
Did you follow Ant's instructions You must have junit.jar available? Try running ant with the -verbose option to get more details logged. Regards, Jan
|
OCUP UML fundamental
ITIL foundation
|
 |
Hongli Li
Ranch Hand
Joined: Oct 29, 2006
Posts: 124
|
|
thanks for you reply, Jan yes, I did follow ant's instruction. junit-3.8.2.jar is under $ANT_HOME/lib folder, as you can see from the log, junit-3.8.2.jar is implicitly added to the classpath. the following is what I got with -verbose mode.
|
 |
Jan Cumps
Bartender
Joined: Dec 20, 2006
Posts: 2343
|
|
'first ant junit test' is not a valid java class name. Your test class has to be a valid java class, say FirstAntJunitTest. Regards, Jan
|
 |
Hongli Li
Ranch Hand
Joined: Oct 29, 2006
Posts: 124
|
|
thanks a lot Jan, I overlooked at that line, My bad, I thought the test node inside Junit is just served as meta info, but actually it should be a full qualified class name. cheers
|
 |
 |
|
|
subject: Juint task in Ant
|
|
|