Why is JUnit not finding my classes in my application when it is in a package?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sol_Ins
Posted On:   Wednesday, April 23, 2003 10:38 PM

Hi, Why is JUnit not finding my classes in my application when it is in a package?. Do I need to include the package name somewhere so that JUnit can resolve it? While I try to run JUnit for testing my application. It is unable to find my class. The test class name is JMSAPICommandHandlerTest and it is in the package jmff.apis.commandhandler.JMSAPICommandHandlerTest. When my Test class is run using JUnit it reports "class not found" Can you suggest me where I need to look into so that JUnit can resolve it. Thanking you, Solins    More>>

Hi,



Why is JUnit not finding my classes in my application when it is in a package?. Do I need to include the package name somewhere so that JUnit can resolve it?



While I try to run JUnit for testing my application. It is unable to find my class. The test class name is JMSAPICommandHandlerTest and it is in the package jmff.apis.commandhandler.JMSAPICommandHandlerTest. When my Test class is run using JUnit it reports "class not found"



Can you suggest me where I need to look into so that JUnit can resolve it.



Thanking you,

Solins

   <<Less

Re: Why is JUnit not finding my classes in my application when it is in a package?

Posted By:   Peter_Craddock  
Posted On:   Wednesday, April 30, 2003 07:48 AM

Are you having the problem at run time or compile ?


If at run time how r u trying to run the test case ?
Are you trying to use the gui ?


You should try writing a class that has its own entry point and builds up a testsuite from your test cases.


public static void main (String[] args)

{

junit.textui.TestRunner.run (suite());

}



public static Test suite ( )

{

TestSuite suite= new TestSuite("Date exercise JUnit Tests");

suite.addTest(TestPeteDate.suite());

suite.addTest(TestSolutions.suite());

return suite;

}



Hope this helps.

Re: Why is JUnit not finding my classes in my application when it is in a package?

Posted By:   Anonymous  
Posted On:   Saturday, April 26, 2003 02:30 AM

Sounds like a classpath problem. What is your setup looking like?
About | Sitemap | Contact