Differences between the JUnits?

Cherry Danielle :

I made a Java Maven project (Operations on Polynomials) in IntelliJ and I want to create a JUnit. I found that there are many types of JUnits, such as:

  • Arquillan JUnit4
  • Arquillan TestNG
  • Groovy JUnit
  • JUnit3
  • JUnit4
  • JUnit5
  • Spock
  • TestNG

Can someone explain me what are the differences between them and/or which one is the best in use?

Thank you!

Georg Muehlenberg :

For a list of differences between JUnit versions 3 and 4 please check out this question.

For differences between JUnit 4 and 5 please refer here. Essentially, there are mostly differences when it comes to more functionality. JUnit 5 has some more assertions and repeated tests, but does not support Java versions lower than 8.

For a comparison of TestNG and JUnit please refer here. Essentially, there are a lot of similarities between JUnit and TestNG, the annotations are a bit different and you can bundle the tests via xml files in TestNG.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=444434&siteId=1
Recommended