JUnit 3 和 JUnit 4 之间的区别 [英] The differences between JUnit 3 and JUnit 4

查看:30
本文介绍了JUnit 3 和 JUnit 4 之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能用几句话描述一下 JUnit 3 和 4 之间的主要区别是什么?

Could someone describe in a few words what the main differences between JUnit 3 and 4 are?

推荐答案

  1. 用于设置和拆卸的 Java 5 注释(@before@after)而不是 setUp()tearDown().

  1. Java 5 annotations for setup and teardown (@before and @after) instead of setUp() and tearDown().

不再需要扩展 TestCase.

don't need to extend TestCase anymore.

@Test 注释替换了 testSomeMethod() 命名约定.

@Test annotation replaces testSomeMethod() naming convention.

静态导入用于断言.

Junit 理论,它允许您将数据集与测试分开自己.

Junit theories, which allow you to separate data sets from the test itself.

这篇关于JUnit 3 和 JUnit 4 之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆