PDA

View Full Version : @contextconfiguration



realdonjuandemarco
Dec 20th, 2010, 05:25 AM
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\\applicati onContext.xml\\"})

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

Thanks

ptalakanti
Dec 23rd, 2010, 09:14 AM
Why don't you try this spring will find this context file as long as it is in classpath.


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