Results 1 to 2 of 2

Thread: @contextconfiguration

  1. #1

    Default @contextconfiguration

    Hi I am wondering if the follwoing code is correct. I have an ApplicationContext on my local drive that I want to use when running a JUnit test.

    I have the following code -
    @RunWith(SpringJUnit4ClassRunner.class)
    @ContextConfiguration(locations={"C:\\Users\\John. Doe\\Workspace\\Project\\applicationContext.xml\\" })

    will this load the applicationContext so I can do JUnit tests?

    Thanks

  2. #2

    Default

    Why don't you try this spring will find this context file as long as it is in classpath.

    Code:
    @ContextConfiguration(locations={"classpath:applicationContext.xml" })

Posting Permissions

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