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?
org.junit.*
is JUnit 4+
. The other is previous versions.
There's backwards compatibility, so junit.framework.*
is included in junit-4.x.jar
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With