Community
Participate
Working Groups
Build ID: M20070921-1145 This is a spinoff from bug 206750. Thanks to Markus Keller for most of the below instructions. 1. run junit ant task with <junit printsummary="yes"> <formatter type="xml"/> ... 2. create a summary: <junitreport todir="${result}"> <fileset dir="${result}"> <include name="TEST-*.xml"/> </fileset> </junitreport> Current results: Test results summary is created by ANT. Nothing more happens. Expected results: Test results summary is created by ANT. Eclipse finds the test results and automatically pops up its JUnit test results UI, just as if you had done: " 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. " Note: I wouldn't mind having to fill in something in the Eclipse ANT job description for this to work. Checking a box and telling Eclipse which file it should import after running the tests would be fine.
> I wouldn't mind having to fill in something in the Eclipse ANT job description > for this to work. Checking a box and telling Eclipse which file it should > import after running the tests would be fine. The difficult part is where to put this option. Ant build launch configurations can be used for anything, and we can't pollute all Ant launch config dialogs with a rarely-used JUnit tab. A way out could be a general "Open this file after the Ant build" facility (e.g. on the Refresh) tab, and JDT/JUnit registering an IEditorLauncher that opens test result files in the JUnit view.
I really don't know how Eclipse works so this might be the worst idea ever, but how about having the JUnit UI behave like an editor: 0. I run my JUnit tests through ANT once. 1. I load the test results file into the JUnit UI. 2. I run my JUnit tests through ANT once more. 3. The JUnit UI notices that the file it loaded has changed on disk, and reads it again.