Results 1 to 3 of 3

Thread: JUnit Tests and Eclipse

  1. #1
    Join Date
    Oct 2004
    Location
    Bend, OR
    Posts
    16

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    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).
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

  3. #3
    Join Date
    Oct 2004
    Location
    Bend, OR
    Posts
    16

    Default 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

Similar Threads

  1. JUnit and PropertyPlaceholderConfigurer woes
    By analogueboy in forum Container
    Replies: 1
    Last Post: Oct 21st, 2005, 06:30 AM
  2. Replies: 5
    Last Post: Oct 4th, 2005, 04:08 PM
  3. Petclinic example and junit tests
    By spring04 in forum Architecture
    Replies: 1
    Last Post: Nov 17th, 2004, 01:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •