Could someone describe in a few words what the main differences between JUnit 3 and 4 are?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Java 5 annotations for setup and teardown (
@before
and@after
) instead ofsetUp()
andtearDown()
.don't need to extend TestCase anymore.
@Test
annotation replacestestSomeMethod()
naming convention.static imports
for asserts.Junit theories, which allow you to separate data sets from the test itself.