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



##########
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:
       Fine with me. I'll close this pull request then?




-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to