maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r398546 - /maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
Date Mon, 01 May 2006 08:10:47 GMT
Author: brett
Date: Mon May  1 01:10:38 2006
New Revision: 398546

URL: http://svn.apache.org/viewcvs?rev=398546&view=rev
Log:
[MSUREFIRE-87] trim stack traces back to just the test class by default

Modified:
    maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java

Modified: maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java?rev=398546&r1=398545&r2=398546&view=diff
==============================================================================
--- maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
(original)
+++ maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
Mon May  1 01:10:38 2006
@@ -308,6 +308,13 @@
     private boolean parallel;
 
     /**
+     * Whether to trim the stack trace in the reports to just the lines within the test,
or show the full trace.
+     *
+     * @parameter expression="${trimStackTrace}" default-value="true"
+     */
+    private boolean trimStackTrace;
+
+    /**
      * @component
      */
     private ArtifactResolver artifactResolver;
@@ -700,41 +707,44 @@
      */
     private void addReporters( SurefireBooter surefireBooter, boolean forking )
     {
+        Boolean trimStackTrace = Boolean.valueOf( this.trimStackTrace );
         if ( useFile )
         {
             if ( printSummary )
             {
                 if ( forking )
                 {
-                    surefireBooter.addReport( ForkingConsoleReporter.class.getName() );
+                    surefireBooter.addReport( ForkingConsoleReporter.class.getName(), new
Object[]{trimStackTrace} );
                 }
                 else
                 {
-                    surefireBooter.addReport( ConsoleReporter.class.getName() );
+                    surefireBooter.addReport( ConsoleReporter.class.getName(), new Object[]{trimStackTrace}
);
                 }
             }
 
             if ( BRIEF_REPORT_FORMAT.equals( reportFormat ) )
             {
-                surefireBooter.addReport( BriefFileReporter.class.getName(), new Object[]{reportsDirectory}
);
+                surefireBooter.addReport( BriefFileReporter.class.getName(),
+                                          new Object[]{reportsDirectory, trimStackTrace}
);
             }
             else if ( PLAIN_REPORT_FORMAT.equals( reportFormat ) )
             {
-                surefireBooter.addReport( FileReporter.class.getName(), new Object[]{reportsDirectory}
);
+                surefireBooter.addReport( FileReporter.class.getName(),
+                                          new Object[]{reportsDirectory, trimStackTrace}
);
             }
         }
         else
         {
             if ( BRIEF_REPORT_FORMAT.equals( reportFormat ) )
             {
-                surefireBooter.addReport( BriefConsoleReporter.class.getName() );
+                surefireBooter.addReport( BriefConsoleReporter.class.getName(), new Object[]{trimStackTrace}
);
             }
             else if ( PLAIN_REPORT_FORMAT.equals( reportFormat ) )
             {
-                surefireBooter.addReport( DetailedConsoleReporter.class.getName() );
+                surefireBooter.addReport( DetailedConsoleReporter.class.getName(), new Object[]{trimStackTrace}
);
             }
         }
 
-        surefireBooter.addReport( XMLReporter.class.getName(), new Object[]{reportsDirectory}
);
+        surefireBooter.addReport( XMLReporter.class.getName(), new Object[]{reportsDirectory,
trimStackTrace} );
     }
 }



Mime
View raw message