junit 4.x 常用注解

467 阅读1分钟

常用注解

  1. @Test
    1. @Test(expected = ArithmeticException.class) 匹配可能会抛出的异常
  2. @BeforeClass 在测试类的用例执行前,加载所需资源等
  3. @AfterClass 在测试类的用例执行后,清理资源
  4. @Before
  5. @After
  6. @Ingore 忽视当前测试方法