测试 错误集

一:he hierarchy of the type Test Cactus LoginAction is inconsistent
     These errors happend because some interface /class in the hierarchy cannot be resolve.
For example: the error is occur in your class - class x, x inherits y, and in turn, y inherits z. However, the compiler
cannot resolve z (in above error is EventManager), because z is belong to a library that is not included.
Therefore, you have to add package containing z to the classpath/ or project's Java Build Path (if you are using eclipse).
  二:import junit.framework.TestCase,错误的解释是The import junit cannot be resolved
  在你的项目上点击右键--->Properties--->Java Build Path--->(Libraries标签)add Library-->JUnit-->Next-->Finish
三:Transormer.class 未找到
要加入commons-collections-3.1.jar这个包,不然也会报错.
四:使用StrutsTestCase:junit.framework.AssertionFailedError: The /WEB-INF/web.xml was not found. 或者  Missing configuration resource for path...
    public void setUp() throws Exception {
        super.setUp();
        File web = new File("D:/WEB_STORE/project/teststruts1/WebRoot");
        this.setContextDirectory(web);
        setConfigFile("/WEB-INF/web.xml");
        setConfigFile("/WEB-INF/struts-config.xml");
        //setConfigFile("/WEB-INF/struts-config-teststruts1.xml");
       
    }

你可能感兴趣的:(eclipse,xml,Web,struts,JUnit)