I\'ve been trying in vain to get ant to execute some tests written in junit. Any advice would be much appreciated. I\'m pretty new to both ant and Java so please be patient.
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);
}
}
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.