Tibor17 commented on a change in pull request #457:
URL: https://github.com/apache/maven-surefire/pull/457#discussion_r804511824



##########
File path: 
surefire-api/src/main/java/org/apache/maven/surefire/api/report/LegacyPojoStackTraceWriter.java
##########
@@ -81,19 +80,26 @@ public String smartTrimmedStackTrace()
         result.append( "#" );
         result.append( testMethod );
         SafeThrowable throwable = getThrowable();
-        if ( throwable.getTarget() instanceof AssertionError )
-        {
-            result.append( " " );
-            result.append( getTruncatedMessage( throwable.getMessage(), 
MAX_LINE_LENGTH - result.length() ) );
-        }
-        else
+        Throwable target = throwable.getTarget();
+
+        if ( target != null )
         {
-            Throwable target = throwable.getTarget();
-            if ( target != null )
+
+            final String excClassName = target.getClass().getName();
+
+            if ( ! ( AssertionError.class.isInstance( target )
+                    || excClassName.endsWith( ".AssertionFailedError" )
+                    || excClassName.endsWith( ".ComparisonFailure" )
+                    || excClassName.startsWith( "org.opentest4j." ) ) )
+            {
+                result.append( ' ' )
+                      .append( target.getClass().getSimpleName() );
+            }
+            final String msg = throwable.getMessage();
+            if ( isNotEmpty( msg ) )
             {
-                result.append( " " );
-                result.append( target.getClass().getSimpleName() );
-                result.append( getTruncatedMessage( throwable.getMessage(), 
MAX_LINE_LENGTH - result.length() ) );
+                result.append( ' ' )
+                      .append( msg.split( "\r?\n" )[0] );

Review comment:
       The Spark/Groovy is having such assertion statements which have 
excellent benefit with multiline message for user.
   I would not like to break the users since they rely on complete message.
   Thx for your work and all your efforts!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to