首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

The /WEB-INF/web.xml was not found MockStrutsTestCase有关问题

2012-08-26 
The /WEB-INF/web.xml was not found MockStrutsTestCase问题?在eclipse这样的环境中,?MockStrutsTestCase

The /WEB-INF/web.xml was not found MockStrutsTestCase问题

?

在eclipse这样的环境中,?MockStrutsTestCase中的是不能直接调用默认的Web-inf目录的.

因为:我们通常建立的web?project都在项目下加入了WebRoot作为输出的路径.

那么在测试用例中覆盖setup方法:

?

protected void setUp() throws Exception {    super.setUp();   setContextDirectory(new File("WebRoot"));  this.setConfigFile("/WEB-INF/struts-config.xml"); }
?

这样就可以进行action的测试了.

热点排行