Bug 58435

Summary: System-out not being attached to JUnit test case with xml reporter
Product: Ant Reporter: bartlomiej
Component: Core tasksAssignee: Ant Notifications List <notifications>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 1.9.6   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description bartlomiej 2015-09-21 09:37:14 UTC
This happens when executing JUnit task with ant and XML reporter.

I'm running a test suite (that consists of other two test suites which include multiple classes with multiple tests) with XML reporter. In case of test failure, I write to stdout (also tested with stderr) db dump and some other information that can help track what's wrong. 

The output (system-out element) is however a child of test suite node - it's not being attached to proper test case during which said output was generated. This in turn makes it very difficult to actually use output to check what went wrong.

Steps to reproduce:

1. Create class with test cases, add system.out.println("Hello world"), make some of tests in such a way that they fail and print something to stdout just in case.
2. Make previously created class a part of test suite.
3. Define new Ant target with JUnit task that executes newly created test suite and writes XML report
4. Examine XML file and check whether the system-out is a child of to testcase element.