problem in adding listener to junit TestResult
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   yogesh_seth
Posted On:   Friday, July 8, 2005 05:11 PM

Hi, I am invoking junit tests programmatically. Gotto generate the reports as well. For that purpose I have added XMLJUnitResultFormatter (from ant-junit) as a listener to the TestResult. i get the following runtime error: java.lang.NoClassDefFoundError: junit/framework/TestListener at the statement: XMLJUnitResultFormatter resultFormatter = new XMLJUnitResultFormatter(); However following statement runs fine: TestListener listener = new TestRunner(); //both are junit framework classes and are accessible. This means that the problem is when ant-junit class XMLJUnitResultFormatter tries to access TestListener. is it that XMLJUnitResultFormatter uses some other class lo   More>>

Hi,

I am invoking junit tests programmatically. Gotto generate the reports as well. For that purpose I have added XMLJUnitResultFormatter (from ant-junit) as a listener to the TestResult. i get the following runtime error:

java.lang.NoClassDefFoundError: junit/framework/TestListener

at the statement:

XMLJUnitResultFormatter resultFormatter = new XMLJUnitResultFormatter();

However following statement runs fine:

TestListener listener = new TestRunner(); //both are junit framework classes and are accessible.

This means that the problem is when ant-junit class XMLJUnitResultFormatter tries to access TestListener.
is it that XMLJUnitResultFormatter uses some other class loader which does not have access to junit.jar or is it that there is some other way of loading a class from ant lib?

Any ideas/suggestions?

Cheers
yogesh

   <<Less
About | Sitemap | Contact