Detailed comparison TestNG 6 and JUnit 4 for Integration, System and Acceptance testing levels. Everything needed by QA automation/SDET team. IT Talk was in Wroclaw on 30/03/2017. https://crossweb.pl/wydarzenia/qa-talk-test-analyze-manage-marzec-2017
JUnit 4 code on github: https://github.com/a-oleynik/junit-workshop/tree/junit-4.13.2
TestNG code on github: https://github.com/a-oleynik/testng-workshop
Webinar on youtube: https://www.youtube.com/watch?v=3C-Nu5mkyOQ&t=3189
5. 30 March 2017
JUnit is a unit testing framework for the
Java programming language. JUnit has
been important in the development of test-
driven development, and is one of a family
of unit testing frameworks which is
collectively known as xUnit that originated
with SUnit.
7. 30 March 2017
TestNG is a testing framework for the Java
programming language created by Cédric
Beust and inspired by JUnit and NUnit. The
design goal of TestNG is to cover a wider
range of test categories: unit, functional,
end-to-end, integration, etc., with more
powerful and easy-to-use functionalities.
46. TestNG parallelization
30 March 2017 46
Maven plugin
The suite tag has parallel and thread-count attributes
@Test has threadPoolSise attribute
47. More details about JUnit
30 March 2017 47
• Official Website: http://junit.org/junit4/
• Assert: http://junit.org/junit4/javadoc/latest/org/junit/Assert.html
• Junit Wiki on GitHub: https://github.com/junit-team/junit4/wiki
• JUnit Tutorial (Mkyong.com) http://www.mkyong.com/tutorials/junit-
tutorials/
• RunListener:
http://junit.sourceforge.net/javadoc/org/junit/runner/notification/RunListe
ner.html
• How to implement RunListener a JUnit Listener example:
http://memorynotfound.com/add-junit-listener-example/
48. More details about some additional libs
30 March 2017 48
• AssertJ http://joel-costigliola.github.io/assertj/index.html
• Hamcrest http://hamcrest.org/JavaHamcrest/
• The Benefits of Using assertThat over other Assert Methods in Unit
Tests https://objectpartners.com/2013/09/18/the-benefits-of-using-
assertthat-over-other-assert-methods-in-unit-tests/
• Hamcrest matchers tutorial
https://www.javacodegeeks.com/2015/11/hamcrest-matchers-
tutorial.html
• JUnitParams: https://github.com/Pragmatists/JUnitParams
• junit-dataprovider: https://github.com/TNG/junit-dataprovider
49. More details about TestNG
30 March 2017 49
• Official Website: http://testng.org/doc/documentation-main.html
• Assert: http://testng.org/javadocs/org/testng/Assert.html
• ITestListener: http://testng.org/javadocs/org/testng/ITestListener.html
• IInvokedMethodListener:
http://testng.org/javadocs/org/testng/IInvokedMethodListener.html
• TestNG Listeners Example:
https://examples.javacodegeeks.com/enterprise-java/testng/testng-
listeners-example/
• TestNG Tutorial (Mkyong.com) http://www.mkyong.com/tutorials/testng-
tutorials/