Announcement Announcement Module
Collapse
No announcement yet.
@contextconfiguration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @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
    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" })

    Comment

    Working...
    X