Testng: New line characters are removed from stack traces in testng-results.xml

Created on 2 Jan 2018  ·  5Comments  ·  Source: cbeust/testng

TestNG Version

6.13.1

Expected behavior

Stack trace in testng-results.xml contains new line characters.

Actual behavior

New line characters are removed from stack traces.

Is the issue reproducible on runner?

  • [ ] Shell
  • [ ] Maven
  • [ ] Gradle
  • [ ] Ant
  • [x] Eclipse
  • [ ] IntelliJ
  • [ ] NetBeans

Test case sample

    @Test
    public void test()
    {
        Assert.fail( "failed" );
    }

Results in 6.12

            <full-stacktrace>
              <![CDATA[java.lang.AssertionError: failed
    at Tester.test(Tester.java:12)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:498)
]]>
            </full-stacktrace>

Results in 6.13

            <full-stacktrace>
              <![CDATA[java.lang.AssertionError: failedat Tester.test(Tester.java:12)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at java.lang.reflect.Method.invoke(Method.java:498)]]>
            </full-stacktrace>
report

Most helpful comment

can we have a new release to pick up this fix? it is very annoying looking at stack trace in one line :-)

All 5 comments

@katedreaper - Can you please let us know as to in which version was it exactly broken for you ? [ There were a lot of versions released between 6.9.11 and 6.13.1

Sorry. It was broken in 6.13.

this is the commit that made the behavior change
https://github.com/cbeust/testng/commit/b5ff38f39cf3410ee9c0e0a620018ae54592e9a8#diff-45d9027f05908b313ec3a948beaeefde

can we have a new release to pick up this fix? it is very annoying looking at stack trace in one line :-)

@dantran - @cbeust is working on releasing TestNG soon.

Was this page helpful?
0 / 5 - 0 ratings