繁体   English   中英

org.junit包和junit.framework包之间有什么区别?

[英]What is the difference between the org.junit package and the junit.framework package?

每当我在代码中使用Junit断言时,我的IDE(Intellij IDEA 12)礼貌地为我提供静态导入:

import static junit.framework.Assert.assertTrue;

但是,它总是让我可以选择导入“org.junit”版本或“junit.framework”版本:

import static org.junit.Assert.assertTrue;

我无法在网上找到关于这两个包之间差异的明确答案 - 有区别吗? 如果是这样,它是什么? 它们都来自完全相同的Junit4罐子,所以发生了什么?

org.junit.*JUnit 4+ 另一个是以前的版本。

有向后兼容性,因此junit.framework.*包含在junit-4.x.jar

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM