Announcement Announcement Module
Collapse
No announcement yet.
JUnit Tests and Eclipse Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JUnit Tests and Eclipse

    I am trying to run some unit tests of the Spring configured persistence layer in Eclipse and having problems. I have based these tests on code from Spring Live by Matt Raible.

    I get a nested file not found error when the ClasspathXMLApplicationContext class tries to load the applicationContext.xml file.

    Is Eclipse setting the working directory for the VM to the location of the test case class?

    This has been frustrating.

    Thanks for any help

    Brad

  • #2
    If you are using ClasspathXmlApplicationContext as the context type, then the context needs to be somewhere on your classpath. It's that simple. Can you verify that the file is indeed somewhere which is marked as a classpath location as far as eclipse is concerned (this includes all source dirs, since the contents get copied to the target build location).

    Comment


    • #3
      Classpath

      Thank you Colin. The file is in ../WEB-INF which is not in the classpath. I will make that adjustment. I was not parsing the class name (ClasspathXMLApplicationContext) very well.

      Thanks,

      Brad

      Comment

      Working...
      X