Bug 58435 - System-out not being attached to JUnit test case with xml reporter
Summary: System-out not being attached to JUnit test case with xml reporter
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.9.6
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-21 09:37 UTC by bartlomiej
Modified: 2015-09-21 09:37 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.