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

Nunit plugin : non ascii character problem

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: plugin-proposals
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      The use of a non-ascii character will give a exception :

      started
      Transforming NUnit tests results
      Recording test results
      FATAL: Failed to read C:\Documents and Settings\3167
      \.hudson\jobs\Nunit\workspace\temporary-junit-
      reports\TEST.HRATestCenter.HRABusinessLayer.Process.ComputeDayAutoTest.xml
      hudson.util.IOException2: Failed to read C:\Documents and Settings\3167
      \.hudson\jobs\Nunit\workspace\temporary-junit-
      reports\TEST.HRATestCenter.HRABusinessLayer.Process.ComputeDayAutoTest.xml
      at hudson.tasks.junit.TestResult.parse(TestResult.java:119)
      at hudson.tasks.junit.TestResult.parse(TestResult.java:83)
      at hudson.tasks.junit.TestResult.<init>(TestResult.java:66)
      at hudson.tasks.junit.JUnitResultArchiver$1.invoke
      (JUnitResultArchiver.java:67)
      at hudson.tasks.junit.JUnitResultArchiver$1.invoke
      (JUnitResultArchiver.java:52)
      at hudson.FilePath.act(FilePath.java:280)
      at hudson.tasks.junit.JUnitResultArchiver.perform
      (JUnitResultArchiver.java:52)
      at hudson.plugins.nunit.NUnitArchiver.performJUnitArchiver
      (NUnitArchiver.java:115)
      at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:73)
      at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:33)
      at hudson.FilePath.act(FilePath.java:280)
      at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:53)
      at hudson.model.Build$RunnerImpl.post2(Build.java:138)
      at hudson.model.AbstractBuild$AbstractRunner.post
      (AbstractBuild.java:243)
      at hudson.model.Run.run(Run.java:595)
      at hudson.model.Build.run(Build.java:103)
      at hudson.model.ResourceController.execute(ResourceController.java:66)
      at hudson.model.Executor.run(Executor.java:62)
      Caused by: org.dom4j.DocumentException: Invalid byte 1 of 1-byte UTF-8
      sequence. Nested exception: Invalid byte 1 of 1-byte UTF-8 sequence.
      at org.dom4j.io.SAXReader.read(SAXReader.java:484)
      at org.dom4j.io.SAXReader.read(SAXReader.java:264)
      at hudson.tasks.junit.SuiteResult.<init>(SuiteResult.java:38)
      at hudson.tasks.junit.TestResult.parse(TestResult.java:111)
      ... 17 more

      This extract of the complete nunit result xml file is the cause of the
      exception :

      <test-case
      name="HRATestCenter.HRABusinessLayer.Process.ComputeDayAutoTest.AutoCompute_0000
      01" executed="True" success="False" time="0.172" asserts="7">
      <failure>
      <message><![CDATA[Test 'VM01' n°1, Clockin #0 (at 1/2/2006 7:45:00 AM) on
      field ClDttDate.
      Expected: 'this.myDateNullValue'.
      Have: '1/01/0001 0:00:00'
      expected:<1/01/1900 0:00:00>
      but was:<1/01/0001 0:00:00>]]>
      </message>
      <stack-trace><![CDATA[ at
      HRATestCenter.HRABusinessLayer.Process.ComputeDayAutoTest.AutoCompute_000001()
      in
      C:\DevTree\src\trunk\TestCenter.root\HRATestCenter\HRABusinessLayer\Process\Comp
      uteDayAutoTest.cs:line 103
      ]]>
      </stack-trace>
      </failure>
      </test-case>

      We have the character 'n°1' in the xml!
      If I replace for example the 'n°1' by 'nr.1', then all will work like expected.

      Regards,
      Eric

        Attachments

          Activity

          Hide
          peterkittreilly peterkittreilly added a comment -

          The error is that the file is not valid UTF-8 encoded document.
          >>> org.dom4j.DocumentException: Invalid byte 1 of 1-byte UTF-8
          If the document is not UTF-8 (the default encoding for xml)
          you will get this message.

          Show
          peterkittreilly peterkittreilly added a comment - The error is that the file is not valid UTF-8 encoded document. >>> org.dom4j.DocumentException: Invalid byte 1 of 1-byte UTF-8 If the document is not UTF-8 (the default encoding for xml) you will get this message.
          Hide
          redsolo redsolo added a comment -

          Ive been able to reproduce the problem. It seems that the Xalan (XSL) will not
          do a correct conversion of characters when it is using <Redirect> to redirect
          the output to different files.

          Show
          redsolo redsolo added a comment - Ive been able to reproduce the problem. It seems that the Xalan (XSL) will not do a correct conversion of characters when it is using <Redirect> to redirect the output to different files.
          Hide
          evb evb added a comment -

          Peter, the used xml file is the default xml file from the Nunit engine.
          (<?xml version="1.0" encoding="utf-8" standalone="no"?>)
          So it is encoded with utf-8...

          It was the same error message ( >>> org.dom4j.DocumentException: Invalid byte 1
          of 1-byte UTF-8), that give me the direction where to search

          I see that Erik did find already the probably cause of the problem.
          Thanks,

          Show
          evb evb added a comment - Peter, the used xml file is the default xml file from the Nunit engine. (<?xml version="1.0" encoding="utf-8" standalone="no"?>) So it is encoded with utf-8... It was the same error message ( >>> org.dom4j.DocumentException: Invalid byte 1 of 1-byte UTF-8), that give me the direction where to search I see that Erik did find already the probably cause of the problem. Thanks,
          Hide
          peterkittreilly peterkittreilly added a comment -

          Sorry, I forgot that the nunit xml output was transformed to
          junit xml output, and so the transformation may be incorrect.

          Show
          peterkittreilly peterkittreilly added a comment - Sorry, I forgot that the nunit xml output was transformed to junit xml output, and so the transformation may be incorrect.
          Hide
          redsolo redsolo added a comment -

          Fixed in the next release 0.2.1

          Show
          redsolo redsolo added a comment - Fixed in the next release 0.2.1

            People

            • Assignee:
              redsolo redsolo
              Reporter:
              evb evb
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: