Apache Ant 1.10.10 was released about a month ago. Among the usual bugfixes we have added a new improvement for the “junitlauncher” task.
For those of you who have not used or are unfamiliar with the “junitlauncher” task, this is a new task that we introduced a few years ago to allow projects using Ant to be able to use the new framework. JUnit5 test. The previous (and still supported) “junit” task is intended to be used only if you want to continue using only JUnit4. If you plan to use JUnit5 (which also supports JUnit4 style test cases) then you will need to use the “junitlauncher” task.
This “junitlauncher” task has been around for a few years now and some users have reported that its “printSummary” function is not very useful. Those familiar with the ‘junit’ task will know that when a test is run, the task prints an instant summary like:
Tests run: 5, fail: 0, errors: 0, skipped: 0, elapsed time: 0.002 sec
This is useful for seeing a quick summary of the tests in progress.
The “junitlauncher” has a “printSummary” attribute which until Ant version 1.10.10 used to print a summary after all tests have been run. Additionally, the printed summary was a summary that the JUnit5 framework generates by default, something like:
[junitlauncher] The test is finished after 5103 ms
[junitlauncher] [ 2 containers found ]
[junitlauncher] [ 0 containers skipped ]
[junitlauncher] [ 2 containers started ]
[junitlauncher] [ 0 containers aborted ]
[junitlauncher] [ 2 containers successful ]
[junitlauncher] [ 0 containers failed ]
[junitlauncher] [ 1 tests found ]
[junitlauncher] [ 0 tests skipped ]
[junitlauncher] [ 1 tests started ]
[junitlauncher] [ 0 tests aborted ]
[junitlauncher] [ 1 tests successful ]
[junitlauncher] [ 0 tests failed ]
As you can see, the summary of this form is not really helpful. So some of the Ant users have asked (https://bz.apache.org/bugzilla/show_bug.cgi?id=64836) to improve to provide a summary that looks like what we have with the “junit” task.
This Ant version 1.10.10 now includes this improvement. When you use “printSummary = true” on the “junitlauncher” task, it will now print a more useful and immediate summary like the “junit” task does:
Running org.myapp.foo.bar.SimpleTest: 5, fail: 0, errors: 0, skipped: 0, elapsed time: 0.002 sec
As usual, the version is available for download on the Ant download page https://ant.apache.org/bindownload.cgi. Please give it a try and if you have any suggestions or comments on this release, please contact us on our mailing lists. https://ant.apache.org/mail.html or our issue follow-up https://ant.apache.org/bugs.html.