我正在使用JUnit進行Web服務(Springs)的單元測試。運行JUnit測試用例時加載應用程序競爭錯誤失敗
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath:WSexample/config/service/WSexample-service.xml"})
和測試文件位於WSexample/test/find/controller
位置
我使用上面的代碼來加載一個XML文件。它正在拋出無法加載應用程序上下文錯誤。
java.lang.IllegalStateException:無法在org.springframework.test.context.TestContext.getApplicationContext(TestContext.j ava:308)上加載ApplicationContext,位於org.springframework.test.context.support.DependencyInjectionTestExecutionListene r。在org.springframework.test.context.TestContextManager.prepareTestInstance中測試org.springframework.test.context.support.DependencyInjectionTestExecutionListene中的injectDependencies(DependencyInjectionTestExecutionListener.java:109)r.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)(TestCont extManager.java: 321)
任何人都可以幫我解決這個問題。
在此先感謝。
請包括實際錯誤 –
再次,不要使用評論來更新問題。更新問題。 –