In this example, the method f1() will be invoked ten times from a pool made
of three threads. If any of these invocations fail to complete with ten
seconds, TestNG will abort the test and mark it failed. You can find more
information on this feature inthis article and inthe
documentation.

A new Reporter
API lets you log messages that will be reproduced in the HTML reports,
either on each individual method or as a combined output.

@Test now contains a description attribute that will also be included in the
final reports:

Writing your own reports has never been easier with the introduction of
the IReporter
interface. Only one method to override, it doesn’t get any easier
than this…

@DataProviders can now know which test method they are
providing data for. If you declare the signature of your @DataProvider
with a java.lang.reflect.Method as first parameter, TestNG will
invoke it with the @Test method that is about to be executed.
This makes it easier for you to provide slightly different data based on the
current test method. See thedocumentation for more details.

Numerous bug fixes in the Eclipse plug-in (see the CHANGES file) and an
improved view of the results (see the picture at the beginning of this
post).

14 Comments

This probably isn’t very critical, but the plugin no longer works in Eclipse 3.2M5… This is the error: java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/junit/ui/TabFolderLayout
(I can totally imagine this isn’t important to fix, just thought I would point it out)
Willem

Hi Willem,
Yes, we’re aware of this, there is a bug filed in JIRA to that effect. We are waiting for the 3.2 API to freeze before we port the plug-in there, which was supposed to happen in M6 but might actually have happened in M5, so we’ll be addressing this bug very soon…

hi cedric,
i think your example for description is not very compelling.
how about
@Test(description = “Verify the server is up”)
public void t1() { … }
or even better
@Test(description = “initial data: left(x=10, y=20), right(x=10, y=23)”)
public void t1() { … }
as this simply can not be expressed naturally in a java method name.
ciao robertj

Are you getting these updated libraries into the central Maven 2 repository? Alternately, can you set up a repository for TestNG (and other toys)? It easy enough to change settings.xml to point to additional repositories.

Are you getting these updated libraries into the central Maven 2 repository? Alternately, can you set up a repository for TestNG (and other toys)? It easy enough to change settings.xml to point to additional repositories.

> jMock, are the mocks evaluated after a test?
Stephan, normally, jmock calls “verify” on all your mocks in the teardown method. However, you can call verify manually at the end of every test. This could be a big change if you’ve got a lot of jmock tests. Example:
Mock mockGui = mock(IGuiController.class);
Notifier notifier = new Notifier((IGuiController)mockGui .proxy());
mockGui.expects(once()).method(“alert”);
notifier.doStuff();
mockGui.verify(); // <– add this line to force verify
There may be a better way to accomplish this with TestNG, but I don’t know it well enough. You would also need a way to access a list of all mocks created in a test, which JMock must be doing internally, so that you can call “verify” on all of them.