1

我使用 maven、git 和 netbeans。在 netbeans 中,有 Other Test Sources 文件夹,在这个文件夹中我有 src/test/resources。在这个文件夹中,我有一个包 spring,它包含 web-context.xml、service-context.xml 和 mvc-context.xml

在一个junit测试中我做:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
  "classpath:/spring/web-context.xml",
  "classpath:/spring/services-context.xml",
  "classpath:/spring/mvc-context.xml"})
public class repositoryTest {
...
}

java.lang.IllegalStateException: Failed to load ApplicationContext
class path resource [web-context.xml] cannot be opened because it does not exist

我怎样才能运行我的测试?

4

0 回答 0