使用Myeclipse开发Struts,用StrutsTestCase进行测试时,首先要在setUp()
中设置setContextDirectory(new File("WebRoot"));
否则回出现如下错误:
junit.framework.AssertionFailedError: Error initializing action servlet: Unable to find /WEB-INF/web.xml. TestCase is running from D:\eclipse3.0.2\eclipse\workspace\StrutsDemo directory. Context directory has not been set.