2
在我的团队中,我们都在Eclipse和Idea中工作。 这工作很好,除了一个小问题,我不知道如何解决。 当设置在我们的测试中ContextConfiguration位置和运行它们的Eclipse里面的一切就像一个魅力:为什么在想法和日食中ContextConfiguration位置不同
@Test(groups = { "database" })
@ContextConfiguration(locations = {" file:src/main/webapp/WEB-INF/applicationContext.xml" })
但我的想法ENV我得到“无法找到ApplicationContext”中的错误。我需要 设置的位置是这样的(项目名称为服务):
@Test(groups = { "database" })
@ContextConfiguration(locations = {" file:services/src/main/webapp/WEB-INF/applicationContext.xml" })
这个项目的结构是这样的: parent.pom有两个孩子劲歌:services.pom和other.pom。在服务项目中运行终端测试时如下:
mvn -Dtest=com.mytest.service.somepackage.TheTest test
没有问题。我想,因为我的项目结构是父 - 双子女需要/服务是必要的(该项目是通过指出父POM创建的)。有没有办法来解决这个问题?你能帮我解决一下吗? thx
酷这个工作有改进,只好跟随添加到我的聚甲醛为它找到上下文: 的src /主/ web应用/ WEB-INF * .XML 的web.xml testResource> testResources> –
jakob
2010-10-07 14:02:19