呵呵,初次接触自动测试,记录一下... 首先,使用junit编写测试类,就不详细写了..帖出代码: package src.test; import junit.framework.TestCase; import org.junit. * ; import src.baseline.Hello; import static junit.framework.Assert. * ; import static junit.runner.BaseTestRunner. * ; public class TestHello extends TestCase ... { private int x = 1; private int y = 1; @Test public void testSayHello()...{ Hello h = new Hello(); assertEquals(" hello, Junit 4",h.sayHello()); } @Before public void startTest()...{ System.out.println(" test start"); } @After public void endTest2()...{ System.out.println("test end"); }} < project name ="autotest.project" default ="runtest" basedir ="." > < property name ="src.dir" value ="src/baseline" /> < property name ="test.dir" value =&#