Community
Participate
Working Groups
Build ID: M20070921-1145 Steps To Reproduce: 1. Create some JUnit tests 2. Make sure you can run them using an ANT launcher 3. Run the JUnit tests through an ANT launcher Expected behavior: The same UI that appears when running JUnit tests through a JUnit launcher should pop up and track the progress. Current behavior: I have to manually read and parse the text output from ANT + JUnit in a console view. More information: The reason I can't just use the Eclipse JUnit launcher is that ANT sets up some prerequisites (like starting WebLogic) before running some of my tests. Don't know who should own this, I'll take my chances with JDT UI.
In 3.3 or later, you can already import xml files generated by the Ant JUnit task: 1. run junit ant task with <junit printsummary="yes"> <formatter type="xml"/> ... 2. optionally create a summary: <junitreport todir="${result}"> <fileset dir="${result}"> <include name="TEST-*.xml"/> </fileset> </junitreport> 3. in JUnit view, open the menu on the 'Test Run History' button, choose Import..., and select the generated TEST-yourTest.xml or TESTS-TestSuites.xml file. You won't get progress reporting with this, but at least you can browse the tests more easily. Possible enhancements: - Make it easier to open test result files: - support drag and drop of test result files into the JUnit view - support opening test result files by double-click or via a file link in the Console view A full-fledged solution would be this (however, JDT/UI has currently no resources to implement this): - Write a JUnitResultFormatter for clients to use in their <junit> tasks. - Formatter is informed about test progress and can post results to the JUnit view. - Open question: how can we feed the data from the formatter to the JUnit view (probably need some socket connection like in the RemoteTestRunner/-Client), but this is difficult to set up for external Ant launches).
Another approach could be an Ant task that opens the generated xml files in Eclipse after the tests have finished. Drawbacks: - clients must manually add the task to the Ant classpath - no progress - telling a running Eclipse instance to open a file is difficult, see bug 4922 and bug 178927
See also related bug 206879.