maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dfabul...@apache.org
Subject svn commit: r601023 - in /maven/surefire/trunk: maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/ surefire-api/src/main/java/org/apache/maven/surefire/report/
Date Tue, 04 Dec 2007 18:09:20 GMT
Author: dfabulich
Date: Tue Dec  4 10:09:19 2007
New Revision: 601023

URL: http://svn.apache.org/viewvc?rev=601023&view=rev
Log:
[SUREFIRE-303] Report ignored/skipped tests.

Modified:
    maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestSuite.java
    maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/AbstractReporter.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/XMLReporter.java

Modified: maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestSuite.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestSuite.java?rev=601023&r1=601022&r2=601023&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestSuite.java
(original)
+++ maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestSuite.java
Tue Dec  4 10:09:19 2007
@@ -166,6 +166,10 @@
             {
                 testCase.addFailure( attributes.getValue( "message" ), attributes.getValue(
"type" ) );
             }
+            else if ( "skipped".equals( qName ) )
+            {
+                testCase.addFailure( "skipped", "skipped" ); // TODO extract real reasons
+            }
         }
         catch ( ParseException e )
         {

Modified: maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java?rev=601023&r1=601022&r2=601023&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
(original)
+++ maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
Tue Dec  4 10:09:19 2007
@@ -303,6 +303,10 @@
                     {
                         sinkIcon( "junit.framework", sink );
                     }
+                    else if ( suite.getNumberOfSkipped() > 0 )
+                    {
+                        sinkIcon( "skipped", sink );
+                    }
                     else
                     {
                         sinkIcon( "success", sink );
@@ -647,7 +651,7 @@
     {
         sink.figure();
 
-        if ( type.startsWith( "junit.framework" ) )
+        if ( type.startsWith( "junit.framework" ) || "skipped".equals( type ) )
         {
             sink.figureGraphics( "images/icon_warning_sml.gif" );
         }

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/AbstractReporter.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/AbstractReporter.java?rev=601023&r1=601022&r2=601023&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/AbstractReporter.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/AbstractReporter.java
Tue Dec  4 10:09:19 2007
@@ -228,7 +228,9 @@
      */
     protected String getStackTrace( ReportEntry report )
     {
-        return trimStackTrace ? report.getStackTraceWriter().writeTrimmedTraceToString()
-            : report.getStackTraceWriter().writeTraceToString();
+        StackTraceWriter writer = report.getStackTraceWriter();
+        if (writer == null) return null;
+        return trimStackTrace ? writer.writeTrimmedTraceToString()
+            : writer.writeTraceToString();
     }
 }

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/XMLReporter.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/XMLReporter.java?rev=601023&r1=601022&r2=601023&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/XMLReporter.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/XMLReporter.java
Tue Dec  4 10:09:19 2007
@@ -174,6 +174,12 @@
 
         writeTestProblems( report, stdOut, stdErr, "failure" );
     }
+    
+    public void testSkipped( ReportEntry report )
+    {
+        super.testSkipped( report );
+        writeTestProblems( report, null, null, "skipped" );
+    }
 
     private void writeTestProblems( ReportEntry report, String stdOut, String stdErr, String
name )
     {
@@ -185,7 +191,11 @@
 
         String stackTrace = getStackTrace( report );
 
-        Throwable t = report.getStackTraceWriter().getThrowable();
+        Throwable t = null;
+        if (report.getStackTraceWriter() != null)
+        {
+            t = report.getStackTraceWriter().getThrowable();
+        }
 
         if ( t != null )
         {
@@ -207,7 +217,10 @@
             }
         }
 
-        element.setValue( escapeAttribute(stackTrace) );
+        if (stackTrace != null)
+        {
+            element.setValue( escapeAttribute(stackTrace) );
+        }
 
         addOutputStreamElement( stdOut, "system-out", testCase );
 



Mime
View raw message