maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r381899 - /maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/
Date Wed, 01 Mar 2006 04:24:19 GMT
Author: brett
Date: Tue Feb 28 20:24:17 2006
New Revision: 381899

URL: http://svn.apache.org/viewcvs?rev=381899&view=rev
Log:
remove duplicate code in reports

Added:
    maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/AbstractConsoleReporter.java
  (with props)
Modified:
    maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/AbstractReporter.java
    maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/BriefConsoleReporter.java
    maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/BriefFileReporter.java
    maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/ConsoleReporter.java
    maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/DetailedConsoleReporter.java
    maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/FileReporter.java
    maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/ForkingConsoleReporter.java
    maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/SummaryConsoleReporter.java

Added: maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/AbstractConsoleReporter.java
URL: http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/AbstractConsoleReporter.java?rev=381899&view=auto
==============================================================================
--- maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/AbstractConsoleReporter.java
(added)
+++ maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/AbstractConsoleReporter.java
Tue Feb 28 20:24:17 2006
@@ -0,0 +1,80 @@
+package org.apache.maven.surefire.report;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.BufferedOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+
+/**
+ * Base class for console reporters.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ */
+public abstract class AbstractConsoleReporter
+    extends AbstractReporter
+{
+    protected static final int BUFFER_SIZE = 4096;
+
+    protected PrintWriter writer;
+
+    protected long batteryStartTime;
+
+    protected AbstractConsoleReporter()
+    {
+        writer = new PrintWriter( new OutputStreamWriter( new BufferedOutputStream( System.out,
BUFFER_SIZE ) ) );
+    }
+
+    public void batteryStarting( ReportEntry report )
+    {
+        batteryStartTime = System.currentTimeMillis();
+
+        writer.println( "[surefire] Running " + report.getName() );
+        writer.flush();
+    }
+
+    public void writeMessage( String message )
+    {
+        writer.println( message );
+        writer.flush();
+    }
+
+    public void runStarting( int testCount )
+    {
+        writer.println();
+        writer.println( "-------------------------------------------------------" );
+        writer.println( " T E S T S" );
+        writer.println( "-------------------------------------------------------" );
+        writer.flush();
+    }
+
+    protected StringBuffer getBatterySummary()
+    {
+        StringBuffer batterySummary = new StringBuffer();
+
+        batterySummary.append( "[surefire] Tests run: " );
+        batterySummary.append( completedCount );
+        batterySummary.append( ", Failures: " );
+        batterySummary.append( failures );
+        batterySummary.append( ", Errors: " );
+        batterySummary.append( errors );
+        batterySummary.append( ", Time elapsed: " );
+        batterySummary.append( elapsedTimeAsString( System.currentTimeMillis() - batteryStartTime
) );
+        batterySummary.append( " sec" );
+        return batterySummary;
+    }
+}

Propchange: maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/AbstractConsoleReporter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/AbstractConsoleReporter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/AbstractReporter.java
URL: http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/AbstractReporter.java?rev=381899&r1=381898&r2=381899&view=diff
==============================================================================
--- maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/AbstractReporter.java
(original)
+++ maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/AbstractReporter.java
Tue Feb 28 20:24:17 2006
@@ -40,6 +40,8 @@
 
     private NumberFormat numberFormat = NumberFormat.getInstance();
 
+    protected static final String NL = System.getProperty( "line.separator" );
+
     private static final int MS_PER_SEC = 1000;
 
     public void setReportsDirectory( String reportsDirectory )

Modified: maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/BriefConsoleReporter.java
URL: http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/BriefConsoleReporter.java?rev=381899&r1=381898&r2=381899&view=diff
==============================================================================
--- maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/BriefConsoleReporter.java
(original)
+++ maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/BriefConsoleReporter.java
Tue Feb 28 20:24:17 2006
@@ -16,8 +16,6 @@
  * limitations under the License.
  */
 
-import java.io.BufferedOutputStream;
-import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 
@@ -29,102 +27,54 @@
  */
 
 public class BriefConsoleReporter
-    extends AbstractReporter
+    extends AbstractConsoleReporter
 {
-    private static final int BUFFER_SIZE = 4096;
-
-    private PrintWriter writer;
-
     private StringBuffer reportContent;
 
-    private long batteryStartTime;
-
-    private static final String NL = System.getProperty( "line.separator" );
-
-    public BriefConsoleReporter()
-    {
-        writer = new PrintWriter( new OutputStreamWriter( new BufferedOutputStream( System.out,
BUFFER_SIZE ) ) );
-    }
-
-    public void writeMessage( String message )
-    {
-        writer.println( message );
-        writer.flush();
-    }
-
-    public void runStarting( int testCount )
-    {
-        writer.println();
-        writer.println( "-------------------------------------------------------" );
-        writer.println( " T E S T S" );
-        writer.println( "-------------------------------------------------------" );
-        writer.flush();
-
-    }
-
     public void batteryStarting( ReportEntry report )
     {
-        batteryStartTime = System.currentTimeMillis();
+        super.batteryStarting( report );
 
         reportContent = new StringBuffer();
-
-        writer.println( "[surefire] Running " + report.getName() );
     }
 
     public void batteryCompleted( ReportEntry report )
     {
-        long runTime = System.currentTimeMillis() - this.batteryStartTime;
-
-        StringBuffer batterySummary = new StringBuffer();
+        StringBuffer batterySummary = getBatterySummary();
 
-        batterySummary.append( "[surefire] Tests run: " );
-        batterySummary.append( String.valueOf( this.getNbTests() ) );
-        batterySummary.append( ", Failures: " ).append( String.valueOf( this.getNbFailures()
) );
-        batterySummary.append( ", Errors: " ).append( String.valueOf( this.getNbErrors()
) );
-        batterySummary.append( ", Time elapsed: " ).append( elapsedTimeAsString( runTime
) );
-        batterySummary.append( " sec" );
         batterySummary.append( NL );
         batterySummary.append( "[surefire] " ).append( NL );
 
         reportContent = batterySummary.append( reportContent );
 
-        writer.println( reportContent.toString() );
+        writer.println( batterySummary );
 
         writer.flush();
     }
 
-    public void testStarting( ReportEntry report )
-    {
-        super.testStarting( report );
-    }
-
-
     public void testError( ReportEntry report, String stdOut, String stdErr )
     {
         super.testError( report, stdOut, stdErr );
 
-        reportContent.append( "[surefire] " ).append( report.getName() );
-
-        long runTime = this.endTime - this.startTime;
-
-        writeTimeElapsed( runTime );
-
-        reportContent.append( "  <<< ERROR!" ).append( NL );
-
-        reportContent.append( getStackTrace( report ) ).append( NL );
+        appendOutput( report, "ERROR" );
     }
 
     public void testFailed( ReportEntry report, String stdOut, String stdErr )
     {
         super.testFailed( report, stdOut, stdErr );
 
+        appendOutput( report, "FAILURE" );
+    }
+
+    private void appendOutput( ReportEntry report, String msg )
+    {
         reportContent.append( "[surefire] " ).append( report.getName() );
 
         long runTime = this.endTime - this.startTime;
 
-        writeTimeElapsed( runTime );
+        reportContent.append( "  Time elapsed: " ).append( elapsedTimeAsString( runTime )
).append( " sec" );
 
-        reportContent.append( "  <<< FAILURE!" ).append( NL );
+        reportContent.append( "  <<< " ).append( msg ).append( "!" ).append( NL
);
 
         reportContent.append( getStackTrace( report ) ).append( NL );
     }

Modified: maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/BriefFileReporter.java
URL: http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/BriefFileReporter.java?rev=381899&r1=381898&r2=381899&view=diff
==============================================================================
--- maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/BriefFileReporter.java
(original)
+++ maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/BriefFileReporter.java
Tue Feb 28 20:24:17 2006
@@ -33,12 +33,10 @@
 {
     private PrintWriter writer;
 
-    private StringBuffer reportContent;
+    protected StringBuffer reportContent;
 
     private long batteryStartTime;
 
-    private static final String NL = "\n";
-
     public void batteryStarting( ReportEntry report )
         throws IOException
     {
@@ -71,7 +69,9 @@
         batterySummary.append( ", Failures: " ).append( String.valueOf( this.getNbFailures()
) );
         batterySummary.append( ", Errors: " ).append( String.valueOf( this.getNbErrors()
) );
         batterySummary.append( ", Time elapsed: " ).append( elapsedTimeAsString( runTime
) );
-        batterySummary.append( " sec \n\n" );
+        batterySummary.append( " sec" );
+        batterySummary.append( NL );
+        batterySummary.append( NL );
 
         reportContent = batterySummary.append( reportContent );
 
@@ -82,11 +82,6 @@
         writer.close();
     }
 
-    public void testStarting( ReportEntry report )
-    {
-        super.testStarting( report );
-    }
-
     public void testError( ReportEntry report, String stdOut, String stdErr )
     {
         super.testError( report, stdOut, stdErr );
@@ -97,7 +92,7 @@
 
         writeTimeElapsed( runTime );
 
-        reportContent.append( "  <<< ERROR!\n" );
+        reportContent.append( "  <<< ERROR!" ).append( NL );
 
         writeStdLogs( stdOut, stdErr );
 
@@ -114,7 +109,7 @@
 
         writeTimeElapsed( runTime );
 
-        reportContent.append( "  <<< FAILURE!\n" );
+        reportContent.append( "  <<< FAILURE!" ).append( NL );
 
         writeStdLogs( stdOut, stdErr );
 
@@ -130,16 +125,16 @@
         completedCount = 0;
     }
 
-    private void writeTimeElapsed( long sec )
+    protected void writeTimeElapsed( long sec )
     {
         reportContent.append( "  Time elapsed: " ).append( elapsedTimeAsString( sec ) ).append(
" sec" );
     }
 
-    private void writeStdLogs( String stdOut, String stdErr )
+    protected void writeStdLogs( String stdOut, String stdErr )
     {
         reportContent.append( NL );
 
-        reportContent.append( "[ stdout ] ---------------------------------------------------------------"
+ NL );
+        reportContent.append( "[ stdout ] ---------------------------------------------------------------"
);
 
         reportContent.append( NL );
 
@@ -147,7 +142,7 @@
 
         reportContent.append( NL );
 
-        reportContent.append( "[ stderr ] ---------------------------------------------------------------"
+ NL );
+        reportContent.append( "[ stderr ] ---------------------------------------------------------------"
);
 
         reportContent.append( NL );
 
@@ -155,7 +150,7 @@
 
         reportContent.append( NL );
 
-        reportContent.append( "[ stacktrace ] -----------------------------------------------------------"
+ NL );
+        reportContent.append( "[ stacktrace ] -----------------------------------------------------------"
);
 
         reportContent.append( NL );
     }
@@ -166,7 +161,7 @@
      * @param report ReportEntry object.
      * @return stacktrace as string.
      */
-    private String getStackTrace( ReportEntry report )
+    protected String getStackTrace( ReportEntry report )
     {
         StringWriter writer = new StringWriter();
 

Modified: maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/ConsoleReporter.java
URL: http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/ConsoleReporter.java?rev=381899&r1=381898&r2=381899&view=diff
==============================================================================
--- maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/ConsoleReporter.java
(original)
+++ maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/ConsoleReporter.java
Tue Feb 28 20:24:17 2006
@@ -16,103 +16,52 @@
  * limitations under the License.
  */
 
-import java.io.BufferedOutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-
+/**
+ * Console reporter.
+ *
+ * @author <a href="mailto:jruiz@exist.com">Johnny R. Ruiz III</a>
+ * @version $Id$
+ */
 public class ConsoleReporter
-    extends AbstractReporter
+    extends AbstractConsoleReporter
 {
-    protected static final int BUFFER_SIZE = 4096;
-
-    protected PrintWriter writer;
-
-    protected long batteryStartTime;
-
-    public ConsoleReporter()
+    public void batteryCompleted( ReportEntry report )
     {
-        writer = new PrintWriter( new OutputStreamWriter( new BufferedOutputStream( System.out,
BUFFER_SIZE ) ) );
-    }
+        StringBuffer batterySummary = getBatterySummary();
 
-    // ----------------------------------------------------------------------
-    //
-    // ----------------------------------------------------------------------
+        if ( failures > 0 || errors > 0 )
+        {
+            batterySummary.append( " <<<<<<<< FAILURE !! " );
+        }
 
-    public void println( String message )
-    {
-        writer.println( message );
+        writer.println( batterySummary );
 
         writer.flush();
-    }
 
-    public void print( String message )
-    {
-        writer.print( message );
-
-        writer.flush();
-    }
+        completedCount = 0;
 
-    // ----------------------------------------------------------------------
-    // Run
-    // ----------------------------------------------------------------------
+        errors = 0;
 
-    public void runStarting( int testCount )
-    {
-        println( "" );
-        println( "-------------------------------------------------------" );
-        println( " T E S T S" );
-        println( "-------------------------------------------------------" );
+        failures = 0;
     }
 
     public void runAborted( ReportEntry report )
     {
-        println( "RUN ABORTED" );
-        println( report.getSource().getClass().getName() );
-        println( report.getName() );
-        println( report.getMessage() );
-        println( report.getThrowable().getMessage() );
+        writer.println( "RUN ABORTED" );
+        writer.println( report.getSource().getClass().getName() );
+        writer.println( report.getName() );
+        writer.println( report.getMessage() );
+        writer.println( report.getThrowable().getMessage() );
+        writer.flush();
     }
 
     public void batteryAborted( ReportEntry report )
     {
-        println( "BATTERY ABORTED" );
-        println( report.getSource().getClass().getName() );
-        println( report.getName() );
-        println( report.getMessage() );
-        println( report.getThrowable().getMessage() );
-    }
-
-    // ----------------------------------------------------------------------
-    // Battery
-    // ----------------------------------------------------------------------
-
-    public void batteryStarting( ReportEntry report )
-    {
-        batteryStartTime = System.currentTimeMillis();
-
-        println( "[surefire] Running " + report.getName() );
-    }
-
-    public void batteryCompleted( ReportEntry report )
-    {
-        long runTime = System.currentTimeMillis() - batteryStartTime;
-
-        print( "[surefire] Tests run: " + completedCount + ", Failures: " + failures + ",
Errors: " + errors +
-            ", Time elapsed: " + elapsedTimeAsString( runTime ) + " sec" );
-
-        if ( failures > 0 || errors > 0 )
-        {
-            writer.print( " <<<<<<<< FAILURE !! " );
-        }
-
-        writer.println( "" );
-
+        writer.println( "BATTERY ABORTED" );
+        writer.println( report.getSource().getClass().getName() );
+        writer.println( report.getName() );
+        writer.println( report.getMessage() );
+        writer.println( report.getThrowable().getMessage() );
         writer.flush();
-
-        completedCount = 0;
-
-        errors = 0;
-
-        failures = 0;
     }
 }

Modified: maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/DetailedConsoleReporter.java
URL: http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/DetailedConsoleReporter.java?rev=381899&r1=381898&r2=381899&view=diff
==============================================================================
--- maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/DetailedConsoleReporter.java
(original)
+++ maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/DetailedConsoleReporter.java
Tue Feb 28 20:24:17 2006
@@ -40,8 +40,6 @@
 
     private long batteryStartTime;
 
-    private static final String NL = System.getProperty( "line.separator" );
-
     public DetailedConsoleReporter()
     {
         writer = new PrintWriter( new OutputStreamWriter( new BufferedOutputStream( System.out,
BUFFER_SIZE ) ) );
@@ -60,7 +58,6 @@
         writer.println( " T E S T S" );
         writer.println( "-------------------------------------------------------" );
         writer.flush();
-
     }
 
     public void batteryStarting( ReportEntry report )
@@ -70,25 +67,30 @@
         reportContent = new StringBuffer();
 
         writer.println( "[surefire] Running " + report.getName() );
+        writer.flush();
     }
 
     public void batteryCompleted( ReportEntry report )
     {
-        long runTime = System.currentTimeMillis() - this.batteryStartTime;
+        long runTime = System.currentTimeMillis() - batteryStartTime;
 
         StringBuffer batterySummary = new StringBuffer();
 
-        batterySummary.append( "[surefire] Tests run: " ).append( String.valueOf( this.getNbTests()
) );
-        batterySummary.append( ", Failures: " ).append( String.valueOf( this.getNbFailures()
) );
-        batterySummary.append( ", Errors: " ).append( String.valueOf( this.getNbErrors()
) );
-        batterySummary.append( ", Time elapsed: " ).append( elapsedTimeAsString( runTime
) );
+        batterySummary.append( "[surefire] Tests run: " );
+        batterySummary.append( completedCount );
+        batterySummary.append( ", Failures: " );
+        batterySummary.append( failures );
+        batterySummary.append( ", Errors: " );
+        batterySummary.append( errors );
+        batterySummary.append( ", Time elapsed: " );
+        batterySummary.append( elapsedTimeAsString( runTime ) );
         batterySummary.append( " sec" );
         batterySummary.append( NL );
         batterySummary.append( "[surefire] " ).append( NL );
 
         reportContent = batterySummary.append( reportContent );
 
-        writer.println( reportContent.toString() );
+        writer.println( batterySummary );
 
         writer.flush();
     }
@@ -152,7 +154,7 @@
     }
 
     /**
-     * Returns stacktrace as string.
+     * Returns stacktrace as String.
      *
      * @param report ReportEntry object.
      * @return stacktrace as string.

Modified: maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/FileReporter.java
URL: http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/FileReporter.java?rev=381899&r1=381898&r2=381899&view=diff
==============================================================================
--- maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/FileReporter.java
(original)
+++ maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/FileReporter.java
Tue Feb 28 20:24:17 2006
@@ -16,12 +16,6 @@
  * limitations under the License.
  */
 
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
 /**
  * Text file reporter.
  *
@@ -29,61 +23,8 @@
  * @version $Id$
  */
 public class FileReporter
-    extends AbstractReporter
+    extends BriefFileReporter
 {
-    private PrintWriter writer;
-
-    private StringBuffer reportContent;
-
-    private long batteryStartTime;
-
-    private static final String NL = System.getProperty( "line.separator" );
-
-    public void batteryStarting( ReportEntry report )
-        throws IOException
-    {
-        batteryStartTime = System.currentTimeMillis();
-
-        reportContent = new StringBuffer();
-
-        File reportFile = new File( getReportsDirectory(), report.getName() + ".txt" );
-
-        File reportDir = reportFile.getParentFile();
-
-        reportDir.mkdirs();
-
-        writer = new PrintWriter( new FileWriter( reportFile ) );
-
-        writer.println( "-------------------------------------------------------------------------------"
);
-
-        writer.println( "Battery: " + report.getName() );
-
-        writer.println( "-------------------------------------------------------------------------------"
);
-    }
-
-    public void batteryCompleted( ReportEntry report )
-    {
-        long runTime = System.currentTimeMillis() - this.batteryStartTime;
-
-        StringBuffer batterySummary = new StringBuffer();
-
-        batterySummary.append( "Tests run: " ).append( String.valueOf( this.getNbTests()
) );
-        batterySummary.append( ", Failures: " ).append( String.valueOf( this.getNbFailures()
) );
-        batterySummary.append( ", Errors: " ).append( String.valueOf( this.getNbErrors()
) );
-        batterySummary.append( ", Time elapsed: " ).append( elapsedTimeAsString( runTime
) );
-        batterySummary.append( " sec" );
-        batterySummary.append( NL );
-        batterySummary.append( NL );
-
-        reportContent = batterySummary.append( reportContent );
-
-        writer.println( reportContent.toString() );
-
-        writer.flush();
-
-        writer.close();
-    }
-
     public void testStarting( ReportEntry report )
     {
         super.testStarting( report );
@@ -100,89 +41,5 @@
         writeTimeElapsed( runTime );
 
         reportContent.append( NL );
-    }
-
-    public void testError( ReportEntry report, String stdOut, String stdErr )
-    {
-        super.testError( report, stdOut, stdErr );
-
-        long runTime = this.endTime - this.startTime;
-
-        writeTimeElapsed( runTime );
-
-        reportContent.append( "  <<< ERROR!" ).append( NL );
-
-        writeStdLogs( stdOut, stdErr );
-
-        reportContent.append( getStackTrace( report ) ).append( NL );
-    }
-
-    public void testFailed( ReportEntry report, String stdOut, String stdErr )
-    {
-        super.testFailed( report, stdOut, stdErr );
-
-        long runTime = this.endTime - this.startTime;
-
-        writeTimeElapsed( runTime );
-
-        reportContent.append( "  <<< FAILURE!" ).append( NL );
-
-        writeStdLogs( stdOut, stdErr );
-
-        reportContent.append( getStackTrace( report ) ).append( NL );
-    }
-
-    public void dispose()
-    {
-        errors = 0;
-
-        failures = 0;
-
-        completedCount = 0;
-    }
-
-    private void writeTimeElapsed( long sec )
-    {
-        reportContent.append( "  Time elapsed: " ).append( elapsedTimeAsString( sec ) ).append(
" sec" );
-    }
-
-    private void writeStdLogs( String stdOut, String stdErr )
-    {
-        reportContent.append( NL );
-
-        reportContent.append( "[ stdout ] ---------------------------------------------------------------"
);
-
-        reportContent.append( NL );
-
-        reportContent.append( stdOut ).append( NL );
-
-        reportContent.append( NL );
-
-        reportContent.append( "[ stderr ] ---------------------------------------------------------------"
);
-
-        reportContent.append( NL );
-
-        reportContent.append( stdErr ).append( NL );
-
-        reportContent.append( NL );
-
-        reportContent.append( "[ stacktrace ] -----------------------------------------------------------"
);
-
-        reportContent.append( NL );
-    }
-
-    /**
-     * @param report ReportEntry Object.
-     * @return stacktrace as string.
-     */
-    private String getStackTrace( ReportEntry report )
-    {
-        StringWriter writer = new StringWriter();
-
-        report.getThrowable().printStackTrace( new PrintWriter( writer ) );
-
-        writer.flush();
-
-        return writer.toString();
     }
 }

Modified: maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/ForkingConsoleReporter.java
URL: http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/ForkingConsoleReporter.java?rev=381899&r1=381898&r2=381899&view=diff
==============================================================================
--- maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/ForkingConsoleReporter.java
(original)
+++ maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/ForkingConsoleReporter.java
Tue Feb 28 20:24:17 2006
@@ -21,7 +21,7 @@
 {
     public void println( String message )
     {
-        writer.write( ForkingReport.FORKING_PREFIX_STANDARD );
+        writer.print( ForkingReport.FORKING_PREFIX_STANDARD );
 
         writer.println( message );
 

Modified: maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/SummaryConsoleReporter.java
URL: http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/SummaryConsoleReporter.java?rev=381899&r1=381898&r2=381899&view=diff
==============================================================================
--- maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/SummaryConsoleReporter.java
(original)
+++ maven/surefire/branches/surefire-testng/surefire/src/main/java/org/apache/maven/surefire/report/SummaryConsoleReporter.java
Tue Feb 28 20:24:17 2006
@@ -33,7 +33,7 @@
     {
         if ( failures > 0 || errors > 0 )
         {
-            println( "[surefire] " + report.getName() + " <<<<<<<<
FAILURE !! " );
+            writeMessage( "[surefire] " + report.getName() + " <<<<<<<<
FAILURE !! " );
         }
 
         completedCount = 0;



Mime
View raw message