[ 
https://issues.apache.org/jira/browse/SUREFIRE-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15431526#comment-15431526
 ] 

Gili commented on SUREFIRE-1276:
--------------------------------

Confirmed. Surefire 2.12.4 trims newlines in exception messages but 2.19.1 does 
not. So that bug is fixed.

The second problem, which is unaffected by the value of {{<trimStacktrace>}}, 
can be reproduced in version 2.19.1 as follows:

Run a unit test containing:
{code}
        @Test
        public void test()
        {
                throw new IllegalArgumentException("Message");
        }
{code}

You will get the following output:

{code}
java.lang.IllegalArgumentException: 
Message
{code}

However, if you catch the exception inside the test method and invoke 
{{printStackTrace()}} then the output will be:

{code}
java.lang.IllegalArgumentException: Message
{code}

Let me know if you can reproduce this. Otherwise I will create a project as you 
requested.

> trimStackTrace trims newlines in exception message
> --------------------------------------------------
>
>                 Key: SUREFIRE-1276
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1276
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>            Reporter: Gili
>
> I am throwing an exception whose message contains newlines for readability. 
> When {{<trimStackTrace>}} is true (the default value) Surefire is removing 
> all newlines.
> Expected behavior: Consider moving this functionality out of 
> {{<trimStackTrace>}} into its own parameter. Regardless of which parameter 
> enables this behavior, please document it at 
> http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html ... 
> right now there is no mention of this behavior.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to