junit中@Before和@BeforeClass区别

 

@before

在每个测试方法之前都执行一次, 方法需要声明为public

@beforeclass

只在类中执行一次, 必须声明为public static

 

posted @ 2019-09-21 09:49  遥远2  阅读(1737)  评论(0编辑  收藏  举报