Eclipse and TestNG: the Next Next Generation
Join the DZone community and get the full member experience.Join For Free
i have been adding a steady amount of improvements to the testng eclipse plug-ins over the past weeks, so i thought i’d stop for a minute and put together a quick summary of the upcoming features.
the first improvement is the appearance of the tree. you will notice that it now mirrors faithfully the hierarchy that is found in testng.xml: suites, tests, classes and then methods. failures are captured in the “failed tests” tab for easier look up:
this tab allows you to focus on the tests that fail and ignore all those that passed.
another new feature is the search box. when you have hundreds of tests running, finding a specific one is not always easy, so you can now type a few letters of the test method or its parameters and the content of the tree will automatically narrow down to methods matching your search. note in the screen shot above that the search also works on parameters provided by @dataprovider.
there is now a new tab called “summary”. this tab gives you statistics on your test run, such as the timings, the test names, the number of methods and classes, etc… since the results are shown in a table, you can also sort on any criterion you like for easier parsing. this is especially handy when you are trying to determine what tests take the longest time.
of course, the search box works in this view as well, and note that in the screen shot below, the time column is sorted in decreasing order:
this view is still a work in the progress and i’m planning to add more information there in the future, such as statistics on individual classes, time line, etc… let me know if you have suggestions.
better conversions from junit 3
i also improved the automatic conversion of junit tests and added support for junit 4 conversions. the screen shot above shows how deep the junit 3 quick fix now goes. notice that your code is now correctly updated so that the converted file will compile without additional changes on your part.
… and junit 4
when i started writing the conversion fixes, i made support junit 4 a non-goal since i was under the impression that developers would be converting from junit 3 but that junit 4 users would probably not see the need to convert to testng.
well, i was wrong, and since i started receiving requests from junit 4 users to help them convert over to testng, i went ahead and added quick fixes for junit 4 classes. the screen shot above illustrates this.
there are also a lot of other more subtle changes, but i’ll stop here. with these improvements, i’m hoping that the testng eclipse plug-in will become even more appealing as the central hub for all your testing needs.
i will be pushing these new features to the update site very soon.
Opinions expressed by DZone contributors are their own.