import org.junit.After; import org.junit.Before; import org.junit.Test; public class TestUnit { public static void main(String[] args) { System.out.println("aa"); } @Test public void testJunit(){ System.out.println("hello junit!"); } @Before public void testBefore(){ System.out.println("before!"); } @After public void testAfter(){ System.out.println("after!"); } }
可以定义方法的执行顺序