• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

eclipse: Junit ClassNotFoundException

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a Struts 2 project with JUnit4 in eclipse Juno.

I want to run a test in one of my action classes. I use the @Test annotation for the method I want to test. So far so good.

To run the test, I right click on the action class, select Run as -> JUnit Test.

Now it appears that the build.xml, which compliles all classes, is used but once build finishes, some classes are not in the build folder so I get the ClassNotFoundException. (the console is cleared before the exception is displayed so difficult to capture see what happened).

I have 3 action classes but only 1 has .class file in the build folder. (obviously this is not the one that I want to JUnit test)

Using Project -> Clean will result in all .class files being in the build folder.

Why is Run Junit test using build.xml and why are some classes getting cleared?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic