junit 测试注解

时间:2022-03-14 22:22:38

* @Test: 将一个 普通的方法修饰成为一个测试方法

* @BeforeClass: 他会在所有的方法运行前被执行,static修饰

* @AfterClass 他会在所有方法运行结束后被执行,static修饰

* @Before:会在每一个测试方法被运行前执行一次

* @After 会在每个测试方法被运行后执行一次

* @Ignore 所修饰的测试方法会被测试运行器忽略

* @RunWith: 可以修改测试运行器  org.junit.runner.Runner

import static org.junit.Assert.*;//静态导入assert中所有的方法