This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

call a JUnit test from another class ?

 
David Coulthard
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using Rad 6. I have test cases written for some of the programs in the test package. I want to write a java program in some other package to trigger the JUnit test. Is it possible ?

(what im trying is to have a jsp page that can select the exact test to run from a drop down, pass it to a java class in another package, and this java class has to trigger that exact JUnit test)

I tried it and am getting the following error.


Error 500: Error while defining class: com.macys.ps.parms.comm.test.allMessagesTest This error indicates that the class: junit.framework.TestCase could not be located while defining the class: com.macys.ps.parms.comm.test.allMessagesTest This is often caused by having the class at a higher point in the classloader hierarchy Dumping the current context classloader hierarchy: ==> indicates defining classloader *** indicates classloader where the missing class could have been found ==>[0] com.ibm.ws.classloader.CompoundClassLoader@4a9e9ce7
 
David Coulthard
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope i have posted it in the right place .. Im new here and I dont know where to post for JUnit related questions. thanks.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ram,
Where is JUnit.jar? In the ear? war? somewhere else?
 
David Coulthard
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got it figured out .... I had added JUnit to my project classpath but apparently that was not enough.... silly me ! I copied the jar file and placed it in my library and it works now !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic