Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

junit

Whenever I use a Junit assert in my code, my IDE (Intellij IDEA 12) politely offers to static-import it for me:

import static junit.framework.Assert.assertTrue;

However, it always gives me the choice of importing either the "org.junit" version or the "junit.framework" version:

import static org.junit.Assert.assertTrue;

I can't find a clear answer online about what the difference is between these two packages - is there a difference? If so, what is it? They both come out of exactly the same Junit4 jar, so what's going on?

like image 546
user1071914 Avatar asked Sep 27 '13 17:09

user1071914


1 Answers

org.junit.* is JUnit 4+. The other is previous versions.

There's backwards compatibility, so junit.framework.* is included in junit-4.x.jar.

like image 97
Sotirios Delimanolis Avatar answered Nov 12 '22 08:11

Sotirios Delimanolis