ZipException when running junit tests

╄→гoц情女王★ 提交于 2019-12-01 03:56:46

You added EasyTest.class as a JAR file to the classpath. This doesn't work. Class files aren't JAR archives, so the classloader throws an error when it tries to load classes from it.

I'm assuming you're running jUnit 3. You may want to try creating a TestCase class that isn't abstract class. Also, have a default constructor or else jUnit won't know how to create the test class.

In your case it should be:

package testmanagment; 

import junit.framework.*;

public class EasyTest extends TestCase {

    public EasyTest() {
        super("Easy Test");
    }

    public void setUp() {
    }

    public void testSeeMee() throws Exception {
        assertTrue(true);
    }

    public void testSeeMeetoo() throws Exception {
        assertTrue(true);
    }   
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!