"TestNG, written by Cedric Beust and Alexandru Popescu, is a light framework based on Java annotations (for J2SE 5.0) that allows you to design complex unit testing for J2SE 5.0 and J2SE 1.4. Why bother learning another unit-testing framework when you're already comfortable using JUnit? If you are interested in simplifying your unit-test cases, in leveraging J2SE 5.0 annotations to tag your test classes as well as being backward compatible with J2SE 1.4, in having out-of-the-box support for dependent methods and parallel and asynchronous testing, TestNG is the tool you are looking for."
"What does this gain you? It allows you to mix and match JUnit and TestNG style tests. You can for example keep using your legacy JUnit tests and use TestNG for all new tests, while incrementally migrating old tests to the new syntax on an ad-hoc basis."
"Frank Sommers: You describe TestNG as a next-generation testing framework. What do you mean by next-generation testing, and what problems does TestNG address that are not also addressed in JUnit?"
"To execute TestNGSuites with ScalaTest's Runner, you must include TestNG's jar file on the class path or runpath. This version of TestNGSuite was tested with TestNG version 5.7."
"To execute TestNGWrapperSuites with ScalaTest's Runner, you must include TestNG's jar file on the class path or runpath. This version of TestNGSuite was tested with TestNG version 5.7."
"In this article, you will learn how to write unit tests for an application using a new testing framework called TestNG. TestNG takes its inspiration from JUnit, trying to maintain the latter's simplicity; at the same time, however, TestNG eliminates most of the limitations of the older framework and gives the developer the ability to write more flexible and powerful tests. As it heavily borrows from Java Annotations (introduced with JDK 5.0; see Resources for more information on this new feature) to define tests, it can also show you how to use this new feature of the Java language in a real production environment."
"So that you can see how TestNG-Abbot works, I've created a simple GUI that does one thing -- it looks up a given word in an underlying dictionary (which is a database) and displays its definition. Regardless of how the application is actually coded, testing a user scenario with this GUI involves three steps:"
"In Selenium, you can author tests programmatically using the language of your choice or via Fit-style tables. From a testing standpoint, the process and results aren't much different regardless of which one you choose. I'm interested in exploring Selenium's programmatic approach here because it offers some interesting possibilities when combined with TestNG."
"At first glance, tests implemented in JUnit 4 and TestNG look remarkably similar. To see what I mean, take a look at the code in Listing 1, a JUnit 4 test that has a macro-fixture (a fixture that is called just once before any tests are run), which is denoted by the @BeforeClass attribute:"