簡體   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