Gradle
  1. Gradle
  2. GRADLE-2058

testNG listeners' system out/err is swallowed

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None

      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

        Issue Links

          Activity

          Hide
          Szczepan Faber
          added a comment -

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

          Show
          Szczepan Faber
          added a comment - does the listener work at all or its just logging not relayed?
          Hide
          Tomek Kaczanowski
          added a comment -

          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.

          Show
          Tomek Kaczanowski
          added a comment - 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.
          Hide
          Szczepan Faber
          added a comment -

          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.

          Show
          Szczepan Faber
          added a comment - 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.
          Hide
          Szczepan Faber
          added a comment -

          possibly a duplicate.

          Show
          Szczepan Faber
          added a comment - possibly a duplicate.

            People

            • Assignee:
              Unassigned
              Reporter:
              Tomek Kaczanowski
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: