4

I use

assertEquals(String, String)

in a JUnit test. Netbeans (or is it Maven?) suggest that I add an import of one of:

org.junit.assert.assertEquals
junit.framework.assert.assertEquals
junit.framework.testcase.assertEquals

Which one should I use and why?

Edit:

As compared to the question differences between 2 JUnit Assert classes this question lists three possible imports as compared to two for the other question.

Community
  • 1
  • 1
tomsv
  • 7,207
  • 6
  • 55
  • 88
  • 1
    The junit.framework contains older version classes. The org.junit is the way of annotating methods as tests. Here is a link which would explain it better http://stackoverflow.com/questions/291003/differences-between-2-junit-assert-classes[enter link description here][1] [1]: http://stackoverflow.com/questions/291003/differences-between-2-junit-assert-classes – Hrishikesh Feb 10 '14 at 07:55
  • Where does maven suggest this? – khmarbaise Feb 10 '14 at 08:02
  • Ok I am not sure its Maven. Maybe Netbeans suggests it. – tomsv Feb 10 '14 at 08:03

1 Answers1

5

Do not use any classes in junit.framework or junit.extensions

Package junit.framework.* was used in JUnit 3.

Package org.junit.* is used in JUnit 4.

orlandocr
  • 313
  • 2
  • 8