1st kind:
@BeforeClass
public static void setUp() throws Exception
{
}
@AfterClass
public static void tearDown() throws Exception
{
}
2nd kind:
@Before
public void setUp() throws Exception
{
}
@After
public void tearDown() throws Exception
{
}
本文介绍 JUnit 框架中 @BeforeClass, @AfterClass, @Before 和 @After 注解的基本使用方法,这些注解用于设置测试前后执行的操作。
1st kind:
@BeforeClass
public static void setUp() throws Exception
{
}
@AfterClass
public static void tearDown() throws Exception
{
}
2nd kind:
@Before
public void setUp() throws Exception
{
}
@After
public void tearDown() throws Exception
{
}
2650
380

被折叠的 条评论
为什么被折叠?