Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-11717

TestNG publisher plugin throws NullPointerException when trying to publish testng results and makes build to fail

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • testng-plugin
    • Linux 2.6.18-274.3.1.el5 #1 SMP Tue Sep 6 20:13:52 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

      Looking for TestNG results report in workspace using pattern: */.xml
      ERROR: Publisher hudson.plugins.testng.Publisher aborted due to exception
      java.lang.NullPointerException
      at hudson.plugins.testng.parser.ResultsParser.finishSuite(ResultsParser.java:267)
      at hudson.plugins.testng.parser.ResultsParser.parse(ResultsParser.java:166)
      at hudson.plugins.testng.TestNGBuildAction.loadResults(TestNGBuildAction.java:105)
      at hudson.plugins.testng.Publisher.perform(Publisher.java:103)
      at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:27)
      at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:694)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:669)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:647)
      at hudson.model.Build$RunnerImpl.post2(Build.java:162)
      at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:616)
      at hudson.model.Run.run(Run.java:1429)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:230)

      I have other jobs that are configured in the same way (cloned the failing one) and these jobs are not failing (no exception is thrown).

          [JENKINS-11717] TestNG publisher plugin throws NullPointerException when trying to publish testng results and makes build to fail

          Ghenadie Dumitru created issue -

          No groups are defined in suite file, only suite, and test sets with classes and parameters.

          Ghenadie Dumitru added a comment - No groups are defined in suite file, only suite, and test sets with classes and parameters.
          Ghenadie Dumitru made changes -
          Fix Version/s New: current [ 10162 ]
          Affects Version/s New: current [ 10162 ]

          nalin_makar added a comment -

          Can you check that testng-results.xml file is generated as part of running the tests? If it's generated, please attached that file.

          nalin_makar added a comment - Can you check that testng-results.xml file is generated as part of running the tests? If it's generated, please attached that file.

          I found the problem:

          When trying to read testng-results.xml in browser I get error:

          error on line 1330 at column 24: Input is not proper UTF-8, indicate encoding !
          Bytes: 0x01 0x0D 0x0A 0x2C

          It is something like the link below except that I don't have some Cyrillic/others strange characters but there are non-alpha-numeric characters (0x01) in one CDATA section :

          http://jira.opensymphony.com/browse/TESTNG-209

          ------
          <exception class="java.lang.AssertionError">
          <message>
          <![CDATA[Error, timestamp: 1321457461047 text: raw (0x01)]]>

          Ghenadie Dumitru added a comment - I found the problem: When trying to read testng-results.xml in browser I get error: error on line 1330 at column 24: Input is not proper UTF-8, indicate encoding ! Bytes: 0x01 0x0D 0x0A 0x2C It is something like the link below except that I don't have some Cyrillic/others strange characters but there are non-alpha-numeric characters (0x01) in one CDATA section : http://jira.opensymphony.com/browse/TESTNG-209 ------ <exception class="java.lang.AssertionError"> <message> <![CDATA [Error, timestamp: 1321457461047 text: raw (0x01)] ]>

          nalin_makar added a comment -

          Ghenadie,

          Thanks for debugging this further. Seems like it's an issue with TestNG's reporter itself which is not creating proper xml files.

          Can you possibly attach the testng.xml and a sample code that could generate such an XML? I can then work on fixing the TestNG's XML reporter.

          nalin_makar added a comment - Ghenadie, Thanks for debugging this further. Seems like it's an issue with TestNG's reporter itself which is not creating proper xml files. Can you possibly attach the testng.xml and a sample code that could generate such an XML? I can then work on fixing the TestNG's XML reporter.
          nalin_makar made changes -
          Assignee Original: nalin_makar [ nalin_makar ] New: Ghenadie Dumitru [ dumghen ]

          Thi is testng-results.xml file

          Ghenadie Dumitru added a comment - Thi is testng-results.xml file
          Ghenadie Dumitru made changes -
          Attachment New: testng-results.xml [ 21094 ]

          My code:

          @Test
          public void generateRawData() {
          Reporter.log("Log This: \u0001");
          }

          Ghenadie Dumitru added a comment - My code: @Test public void generateRawData() { Reporter.log("Log This: \u0001"); }

            nalin_makar nalin_makar
            dumghen Ghenadie Dumitru
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: