jQuery in Action, 3rd edition
The moose likes Java in General and the fly likes java.lang.classnotfoundexception in junit report Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "java.lang.classnotfoundexception in junit report" Watch "java.lang.classnotfoundexception in junit report" New topic

java.lang.classnotfoundexception in junit report

srinivas Doni

Joined: Jun 02, 2011
Posts: 23
Hi to all,

I am getting error
java.lang.ClassNotFoundException: org.test.HelloWorldTest
while i am
generating a junit report with ant script. but, junit test cases are being executed successfully when i run independently(not with ant script).

I have written ant script like this,

if any one is familiar about junit report with ant, can help to solve this problem

With Regards,
N Sahni
Ranch Hand

Joined: Jul 07, 2011
Posts: 55

You need to provide compiled junit class files to <junit> task.
Try modifying line no: 42 with below code sample:

Inclusion of classes.dir is important, as this is the location where compiled junit class files are going.

Thanks and Regards,
Nilesh Sahni | nsahni@infocepts.com | www.infocepts.com
srinivas Doni

Joined: Jun 02, 2011
Posts: 23
Hi Nilesh Sahni,

Thanks for helping me to fix this error.

Thanks & Regards,
I agree. Here's the link: http://aspose.com/file-tools
subject: java.lang.classnotfoundexception in junit report
It's not a secret anymore!