Hello everyone!
We are pleased to announce the availability of TestNG 7.0!
This new major version introduces a few breaking changes with the previous versions, the most important one being that JDK 8 is now a requirement to run TestNG.
TestNG 7 is available for download on Maven Central and JCenter.
Special thanks go to Julien Herr for continuing with all the hard work on TestNG, and of course, to all the other contributors who made this release possible.
Here is a more detailed list of the new features and most important fixes follows:
TestNG has now moved over to using JDK8 as its minimum JDK needs.
When you enforce ordering of tests either via preserve-order or via dependsOnMethods, you can now have TestNG to adhere to using the same thread by setting the JVM argument -Dtestng.thread.affinity=true
TestNG default reports now explicitly call out test methods that were retried.
TestNG now lets you leverage graphical visualisation tools such as Graphviz for building visualisation that represent test execution in real-time by letting you wire in implementations of the TestNG listener org.testng.IExecutionVisualiser
TestNG now adds contextual information into what configuration method (or) an upstream test failure resulted in the current test method being skipped by querying iTestResult.getSkipCausedBy() [ here iTestResult is of type org.testng.ITestResult and represents the execution result of either a config method or a test method ]
TestNG now lets you get access to a data provider method that is referenced via the dataProvider (or) dataProviderClass attributes of the @Test method via iTestResult.getMethod().getDataProviderMethod()[ here iTestResult is of type org.testng.ITestResult and represents the execution result of a data driven test method ]
You can now define a data provider at the class level @Test and also add specifics of a test method by specifying a @Test at method level and TestNG will merge both and run your test as a data driven test.
If at all you have a use case wherein you would like to work with a customized threadpool executor which TestNG should use, you can now do it by implementing the interface org.testng.thread.IExecutorFactory and then plugging it into TestNG via one of the below mechanisms:
· If using the TestNG API, then the implementation should be hooked into TestNG via
§ tng.setExecutorFactory() (or)
§ tng.setExecutorFactoryClass()
· If using a build tool, for e.g., Maven, then pass in a classname via the property
<property>
<name>threadpoolfactoryclass</name>
<value>fully.qualified.class.name.goes.here</value>
</property>
· If using the TestNG CLI, then the fully qualified class name that implements the IExecutorFactory interface can be passed via -threadpoolfactoryclass
TestNG now employs more efficient algorithms to deal with test ordering before execution so that your tests run faster and there are no hanging of JVM when working with a decently large test set.
TestNG now natively injects instance of org.testng.ITestContext (or) org.testng.xml.XmlTest into your Factory method so that you can get access to the current <test> context.
TestNG now lets you be notified when a test fails due to time-out via a new method onTestFailedWithTimeout() within the listener interface org.testng.ITestListener
When implementing a TestNG listener by implementing the corresponding interfaces, you now no longer need to add empty implementations to all other methods in the same interface which you dont want to tweak. You can now instead just implement only your customization. For e.g.,
public class MyListener implements ITestListener {
@Override
public void onTestSuccess(ITestResult result) {
System.out.println("Test passed");
}
}
TestNG now by default will ONLY load dtd definition in your suite xml from a secure end-point (if the DTD is not found locally). If you use a http end-point, you will see TestNG throwing an error. You can disable this behavior by setting the JVM argument: -Dtestng.dtd.http=true
Thanks & Regards
Krishnan Mahadevan
"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.com/
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/46EE21EA-FC16-4019-B0F9-71676E4B19E6%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/CAFdtVe%3DxOLq14Nn7_WyBVyfYnD2Drm65EfkY56-sN939va8Tcw%40mail.gmail.com.
On Tue, Aug 20, 2019 at 5:16 AM Giorgio Vespucci <giorgio...@gmail.com> wrote:
Hi KrishnanI cannot find any evidence of this on https://testng.org.I'd like to have some links to share with my developers' community.Thank you very much.
To unsubscribe from this group and stop receiving emails from it, send an email to testng...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/46EE21EA-FC16-4019-B0F9-71676E4B19E6%40gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to testng...@googlegroups.com.
>> TestNG 7.0! ... a few breaking changes ... the most important one being that JDK 8 ...
Other than JDK8, what are the top few gotchas to look out for, in terms of breaking changes in 7.x ?
We have about 60 microservices, all using TestNg 6.11, and all on JDK8. Never migrated before because we don;t know if we need the new features. But, we would like to be on the latest major version, all the same.
Is there a page somewhere that would indicate other breaking changes? If not... if anyone knows any that are top-of-mind, that will be useful too.
thanks
- Darius
I updated 5.14 -> 6.8.8 -> 7.0.0 -> 7.3.0 recently, and my key surprise was that @Listener above the class was triggered for all the classes in the suite rather than for a specific class. I am not sure if the behavior was always like that, but I noticed it during 7.0 -> 7.3 upgrade.All the rest was smooth, so there was nothing to update and my tests just worked.
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/22ba2126-b6b2-4d4e-a51f-db2a67d4300fn%40googlegroups.com.