I’m a fan of TestNG. Unfortunately, it is company guideline to use JUnit.
Out of the box, TestNG has a lot of advantages. I got used to these advantages and I don’t
want to miss out on any of these features. So what are the advantages of TestNG in
- Grouping tests by using an annotation
- Using different data providers in one class for parameterized test methods
- Injecting parameters from outside of the test class
- Configuring content of the test run in a configuration file
- Defining the number of threads to run the tests in parallel, including timeout control
- Defining dependencies between test methods using annotation
For most of the missing features in JUnit a library exists that adds the missing functionality. Each of these libraries will be discussed briefly in this blog.
In the next post I will start to explain how JUnit can be enhanced to have different data providers in a single test class.