jUnit4 annotations
2010-08-10package testCases;
import static org.junit.Assert.assertEquals;
import org.junit.Test; import org.junit.Before; import org.junit.After;
public class myTest { @Test public void testCodes() throws Exception { System.out.println(“3”); }
@Before
public void testMakeClass1()
{
System.out.println("2");
}
@Before
public void testMakeClass()
{
System.out.println("1");
}
@After public void afterClass() { System.out.println(“4”);
}
@After
public void afterClass1()
{
System.out.println("5");
}
}
실행 결과는 적힌 대로 12345가 된다.