[
https://issues.apache.org/jira/browse/SUREFIRE-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15431601#comment-15431601
]
Tibor Digana edited comment on SUREFIRE-1276 at 8/22/16 8:51 PM:
-----------------------------------------------------------------
[~cowwoc]
Something is wrong on your side because I have expected result and the newline
is added only if the message has {{\n}} character:
{code:java}
result.append( t.getClass().getName() );
String msg = t.getMessage();
if ( msg != null )
{
result.append( ": " );
if ( isMultiLine( msg ) )
{
// SUREFIRE-986
result.append( '\n' );
}
result.append( msg );
}
{code}
Check your CLI window, maybe it's cutting the lines.
{quote}
Running ATest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.065 s - in
ATest
Running SomeTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 s <<<
FAILURE! - in SomeTest
test(SomeTest) Time elapsed: 0.001 s <<< ERROR!
java.lang.IllegalArgumentException: Message
at SomeTest.test(SomeTest.java:9)
Results:
Tests in error:
SomeTest.test:9 IllegalArgument Message
Tests run: 2, Failures: 0, Errors: 1, Skipped: 0
{quote}
was (Author: tibor17):
[~cowwoc]
Something is wrong on your side because I have expected result and the newline
is added only if the message has {{\n}} character:
{code:java}
result.append( t.getClass().getName() );
String msg = t.getMessage();
if ( msg != null )
{
result.append( ": " );
if ( isMultiLine( msg ) )
{
// SUREFIRE-986
result.append( '\n' );
}
result.append( msg );
}
{code}
Check your CLI window, maybe it's cutting the lines.
{{Running ATest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.065 s - in
ATest
Running SomeTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 s <<<
FAILURE! - in SomeTest
test(SomeTest) Time elapsed: 0.001 s <<< ERROR!
java.lang.IllegalArgumentException: Message
at SomeTest.test(SomeTest.java:9)
Results:
Tests in error:
SomeTest.test:9 IllegalArgument Message
Tests run: 2, Failures: 0, Errors: 1, Skipped: 0}}
> 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)