[GRADLE-2058] testNG listeners' system out/err is swallowed Created: 23/Jan/12  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Tomek Kaczanowski Assignee: Unassigned
Resolution: Won't Fix Votes: 0

Issue Links:
Duplicate
Duplicates GRADLE-1252 output of TestNG listeners is not vis... Resolved
Related
Related to GRADLE-2524 JAVA PLUGIN - test task - Setting of ... Resolved

 Description   

My TestNG listener outputs a lot of information in each of onTestXYZ method - when used with Maven and Surefire, it prints a lot of stuff, but using Gradle only what is printed by onFinish method is being printed. Weird, isn't it?

To see it not working please see a project here: https://github.com/tomekkaczanowski/gradle_1009

The output from the listener is not seen anywhere, not on the console nor in the reports. I was able to reproduce this problem with M3->M7



 Comments   
Comment by Szczepan Faber [ 23/Jan/12 ]

does the listener work at all or its just logging not relayed?

Comment by Tomek Kaczanowski [ 24/Jan/12 ]

not sure what you are asking - the listener works fine with Maven, but with Gradle it only outputs what is printed by onFinish method, completely ignoring the rest :

// ONLY this one is printed
@Override
public void onFinish(ITestContext context)

{ System.out.println("onFinish"); }

// the rest is ignored
@Override
public void onStart(ITestContext context)

{ System.out.println("onStart"); }

@Override
public void onTestStart(ITestResult result)

{ System.out.println("onTestStart"); }

@Override
public void onTestFailure(ITestResult result)

{ log(result, "failed"); }

@Override
public void onTestSkipped(ITestResult result)

{ log(result, "skipped"); }

@Override
public void onTestSuccess(ITestResult result)

{ log(result, "passed"); }

private synchronized void log(ITestResult result, String string)

{ System.out.println(result.getMethod() + " " + string); }

Could you please look at the github project? It demonstrates the issue.

Comment by Szczepan Faber [ 26/Jan/12 ]

I looked at it and it seems to me that this problem has been apparent in Gradle for some time now. E.g. even with M3 it only prints 'onFinish'. I'll update this ticket.

Comment by Szczepan Faber [ 06/Sep/12 ]

possibly a duplicate.

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 12:11:40 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.