Announcing TestNG 5.9
I’m happy to announce the release of TestNG 5.9. A lot of bug fixes went into this release, and a few noteworthy new features:
-
Parallelism can now be specified on classes. In the previous versions, you could specify either a setting of
"methods"(every test method will be run in its own thread) and"tests"(all the methods in a giventag will be run in the same thread but each <test>tag will run in its own thread). The new"classes"setting extends this functionality to test classes: all the test methods in the same class will run in the same thread but each class will have its own thread. Of course, the thread pool size and time out for these three settings are configurable. -
You can now specify a time-out on
@Testmethods that use theinvocationCountattribute. This way, you can specify that a test method should be invoked fifty times but that the maximal time allowed for these fifty invocations is ten seconds. If the invocations don’t complete in time, the test will be marked as failed. -
A few new interfaces to assist developers who use the TestNG API:
IAnnotationTransformer2extends the annotation modification capabilities to more than just@TestandIInvokedMethodListener, which gives you additional monitoring on what test method is being invoked and when. A lot of people have contributed patches, fixed and improvements for this release, and their names can be found in the full release notes below. Thank you all!
Release notes for TestNG 5.9
- Added: New ant task boolean flag:
delegateCommandSystemProperties(Justin) - Added:
skipfailedinvocationsunder<suite>in testng-1.0.dtd (Gael Marziou / Stevo Slavic) - Added:
-testrunfactoryon the command line and in the ant task (Vitalyi Pamajonkov) - Added: TESTNG-298:
parallel="classes", which allows entire classes to be run in the same thread - Added:
@BeforeMethodcan now declareObject[]as a parameter, which will be filled by the parameters of the test method - Added:
IAnnotationTransformer2 - Added:
@Test(invocationTimeOut), which lets you set a time out for the total time taken by invocationCount - Added:
IInvokedMethodListener - Added:
-testjarsupports jar file with no testng.xml file - Fixed:
IInvokedMethodListenerwasn’t properly recognized from the command line (Leonardo Rafaeli) - Fixed: TESTNG-309 Illegal default value for attribute in DTD file
- Fixed: TESTNG-192: JUnit XML output includes wrong tests (Aleksandar Borojevic)
- Fixed: Set a generated suite to default to non-parallel (Mark Derricutt)
- Fixed:
-testJarcommand line parsing bug - Fixed: testng-failed.xml didn’t include the listeners
- Fixed: annotation transformers were not run when specified in testng.xml
- Fixed: TESTNG-192: JUnit XML output includes wrong tests (Borojevic)
- Fixed:
@Parameterswas not working correctly on@BeforeMethodswith@DataProviderused on@Testmethods - Fixed: testng-failed.xml was sometimes incorrectly generated (Borojevic)
- Fixed: TESTNG-228:
Assert.assertEqualsNoOrder - Fixed: TESTNG-229:
Assert.assertEqualsdoes not behave properly when arguments are sets - Fixed: TESTNG-36:
assertEquals(Collection actual, Collection expected, String message)may have bug - Fixed: TESTNG-296: Malformed jar URLs breaking -testJar
- Fixed: TESTNG-297: TestNG seemingly never stops running while building failed test suite (Gregg Yost)
- Fixed: TESTNG-285:
@Test(sequential=true)works incorrectly for classes with inheritance - Fixed: TESTNG-254: XmlSuite toXML() ignores listeners
- Fixed: TESTNG-276: Thread safety problem in Reporter class
- Fixed: TESTNG-277: Make Reporter.getCurrentTestResult() public
- Fixed: Potential NPE in
XmlTest#getVerbose(Ryan Morgan) - Fixed: EmailableReporter only displayed the first group for each test method
- Fixed: time-outs were not working in
<test>and ` - Fixed:
@BeforeTest` failing in a base class would not cause subsequent test methods to be skipped - Fixed: TESTNG-195:
@AfterMethodhas no way of knowing if the current test failed - Fixed: TESTNG-249: Overridden test methods were shadowing each other if specified with `
- Fixed:
DataProviders from@Factory`-created tests were all invoked from the same instance - Fixed: enabled was not working on configuration methods
- Fixed:
IIinvokedMethodListenerwas not correctly added in TestNG - Fixed: NPE in
XmlSuite#toXml - Fixed: TESTNG-231: NullPointerException thrown converting a suite to XML (Mark)
Comments (8)
Congratulations on the release. Any idea about how well the new version works with Maven/Surefire?
Sounds really good; congratulations. I'm bummed because I can't use it with Spring because their test framework (e.g., AbstractTransactionalTestNGSpringContextTests) doesn't do the @Before stuff correctly. Or something like that. Fixed in 3.0 if I remember correctly.
Congrats C
Oops! My mistake! I was looking for link with a "5.9"...I didn't see the "download TestNG here" (I blame staying too late at night) :D Cheers, -Alex
Congrats! So... no Maven repo1 artifact yet?
Not yet in Maven repo?
I'm also wondering why this hasn't been published to the maven.org repositories.
Where can we log issues for TestNG? I have the issue explained here: jira.opensymphony.com/browse/TESTNG-219. Has this been addressed? I am using 5.9.