日期:2014-05-20 浏览次数:20781 次
import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; public class JustTest { @BeforeClass public static void beforeClass() { System.out.println("before class"); } @Before public void before() { System.out.println("before"); } @Test public void test() { System.out.println("test"); } @Test public void test2() { System.out.println("test2"); } @After public void after() { System.out.println("after"); } @AfterClass public static void afterClass() { System.out.println("after class"); } @Before public void beforeAgain() { System.out.println("before again"); } }