
JUnit
a9529lty
这个作者很懒,什么都没留下…
展开
-
junit 注解 及 Assert
@RunWith(SpringJUnit4ClassRunner.class) 用于配置spring中测试的环境 @Test标注在方法前,表示其是一个测试的方法 无需在其配置文件中额外设置属性. @ContextConfiguration 用来指定加载的Spring配置文件的位置,会加载默认配置文件 例如下例会加载:classpath:/com/example/MyTest-context转载 2012-12-06 10:04:01 · 4342 阅读 · 0 评论 -
JUnit4 Annotations注释
@Test public void method() 定义一个要测试的方法 @Before public void method() 在每一个测试之前都会被执行的方法,这个方法常常用来进行一些测试环境的准备,比喻说读入输入数据,初始化类 @After public void method() 与@Before进行对应,做一个清理工作 @BeforeCla转载 2012-12-06 10:02:07 · 1786 阅读 · 0 评论