【发布时间】:2011-08-16 15:27:31
【问题描述】:
这里给出了我的问题的上下文:How to configure pom for StrutsTestCase so that web.xml is found?
在我的pom.xml 中,我包含以下内容,希望在测试期间提供各种文件:
<testResources>
<testResource>
<directory>src/test/java</directory>
<includes>
<include>*.*</include>
</includes>
</testResource>
<testResource>
<directory>webapp/WEB-INF</directory>
<includes>
<include>*.xml</include>
</includes>
</testResource>
</testResources>
我的期望是src/test/java 中的所有内容都将在测试期间可用,web.xml、struts-config.xml 中的webapp/WEB-INF 也将可用。
在测试期间找不到web.xml 文件。在解决这个问题时,我有两个问题。
- 我不完全确定我在哪里(或应该在哪里)告诉我的其他代码寻找
web.xml - 我不知道如何在运行测试时验证
web.xml是否可用。
现在,我要问的是 #2。如何验证上面的 XML 是否在做我认为应该做的事情,并使 web.xml 可用于测试?
【问题讨论】:
-
您表示要使“
pom.xml可用于测试”?这是准确的,还是您只对web.xml、struts-config.xml和其他网络内容感兴趣?
标签: java unit-testing maven