TestNG

From APIDesign

Revision as of 08:02, 24 February 2012 by JaroslavTulach (Talk | contribs)
Jump to: navigation, search

TestNG is a testing harness created to improve JUnit3 experience. Tests can be annotated with annotations and as such the design looked more modern when Java5 (and support for annotations was new). For a while it seemed TestNG will take over the Java testing market. It was new, slick and it offered a way to execute JUnit3 tests.

However the JUnit guys stroked back by creating JUnit4, which basically copies the way TestNG uses annotations. As such those who had previous investments in JUnit3 could just upgrade to JUnit4, keep compatibility and offer annotations to those who wished to be free-cool-in. Since then the adoption of TestNG slowed down, at least from point of me, an external observer.

Still there are reason to use TestNG. JUnit project decided to stick with archaic license, long time supersceeded by EPL, and at least Oracle is not comfortable with redistributing software under such license. TestNG comes with widely accepted Apache license.

Also JUnit claims to support primarily unit testing. Sometimes it leads to ridiculous stories when JUnit projects decides to prefer enfocing test isolation even it leads to irreproducible random test failures (probably to be resolved in next version). Thus when you mean more than just unit testing, TestNG can still be viable alternative.

Personal tools
buy