maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r682220 - in /maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire: ./ report/ suite/ testset/ util/
Date Sun, 03 Aug 2008 21:29:12 GMT
Author: hboutemy
Date: Sun Aug  3 14:29:12 2008
New Revision: 682220

URL: http://svn.apache.org/viewvc?rev=682220&view=rev
Log:
fixed errors reported by Checkstyle

Modified:
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/Surefire.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/PojoStackTraceWriter.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReportEntry.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReporterManager.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/XMLReporter.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/suite/AbstractDirectoryTestSuite.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/PojoTestSet.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedCheckedException.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/PrettyPrintXMLWriter.java

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/Surefire.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/Surefire.java?rev=682220&r1=682219&r2=682220&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/Surefire.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/Surefire.java
Sun Aug  3 14:29:12 2008
@@ -50,7 +50,7 @@
 
     // DGF backwards compatibility
     public boolean run( List reportDefinitions, Object[] testSuiteDefinition, String testSetName,
-                    ClassLoader surefireClassLoader, ClassLoader testsClassLoader)
+                    ClassLoader surefireClassLoader, ClassLoader testsClassLoader )
         throws ReporterException, TestSetFailedException
     {
         return run( reportDefinitions, testSuiteDefinition, testSetName, surefireClassLoader,
testsClassLoader, null,
@@ -61,7 +61,8 @@
                         ClassLoader surefireClassLoader, ClassLoader testsClassLoader, Boolean
failIfNoTests )
         throws ReporterException, TestSetFailedException
     {
-        return run( reportDefinitions, testSuiteDefinition, testSetName, surefireClassLoader,
testsClassLoader, null, failIfNoTests );
+        return run( reportDefinitions, testSuiteDefinition, testSetName, surefireClassLoader,
testsClassLoader, null,
+                    failIfNoTests );
     }
 
     // DGF backwards compatibility
@@ -74,7 +75,8 @@
     }
     
     public int run( List reportDefinitions, Object[] testSuiteDefinition, String testSetName,
-                        ClassLoader surefireClassLoader, ClassLoader testsClassLoader, Properties
results, Boolean failIfNoTests )
+                    ClassLoader surefireClassLoader, ClassLoader testsClassLoader, Properties
results,
+                    Boolean failIfNoTests )
         throws ReporterException, TestSetFailedException
     {
         ReporterManager reporterManager =
@@ -137,7 +139,8 @@
                         ClassLoader testsClassLoader )
         throws ReporterException, TestSetFailedException
     {
-        return run ( reportDefinitions, testSuiteDefinitions, surefireClassLoader, testsClassLoader,
Boolean.FALSE ) == 0;
+        return run ( reportDefinitions, testSuiteDefinitions, surefireClassLoader, testsClassLoader,
Boolean.FALSE )
+               == 0;
     }
     public int run( List reportDefinitions, List testSuiteDefinitions, ClassLoader surefireClassLoader,
                         ClassLoader testsClassLoader, Boolean failIfNoTests )

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=682220&r1=682219&r2=682220&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
Sun Aug  3 14:29:12 2008
@@ -235,7 +235,10 @@
     protected String getStackTrace( ReportEntry report )
     {
         StackTraceWriter writer = report.getStackTraceWriter();
-        if (writer == null) return null;
+        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/PojoStackTraceWriter.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/PojoStackTraceWriter.java?rev=682220&r1=682219&r2=682220&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/PojoStackTraceWriter.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/PojoStackTraceWriter.java
Sun Aug  3 14:29:12 2008
@@ -72,7 +72,8 @@
             if ( line.startsWith( marker ) )
             {
                 lastLine = i;
-            } else if ( line.startsWith( "Caused by" ) )
+            }
+            else if ( line.startsWith( "Caused by" ) )
             {
                 causedByLine = i;
                 break;

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReportEntry.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReportEntry.java?rev=682220&r1=682219&r2=682220&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReportEntry.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReportEntry.java
Sun Aug  3 14:29:12 2008
@@ -160,7 +160,7 @@
 
     public boolean equals( Object obj )
     {
-        if ( obj instanceof ReportEntry == false )
+        if ( !(obj instanceof ReportEntry ) )
         {
             return false;
         }

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReporterManager.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReporterManager.java?rev=682220&r1=682219&r2=682220&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReporterManager.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReporterManager.java
Sun Aug  3 14:29:12 2008
@@ -190,8 +190,8 @@
             }
             writeFooter( "" );
         }
-        writeFooter( "Tests run: " + completedCount + ", Failures: " + failures + ", Errors:
" + errors +
-            ", Skipped: " + skipped );
+        writeFooter( "Tests run: " + completedCount + ", Failures: " + failures + ", Errors:
" + errors
+            + ", Skipped: " + skipped );
         writeFooter( "" );
     }
 

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=682220&r1=682219&r2=682220&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
Sun Aug  3 14:29:12 2008
@@ -208,7 +208,7 @@
         String stackTrace = getStackTrace( report );
 
         Throwable t = null;
-        if (report.getStackTraceWriter() != null)
+        if ( report.getStackTraceWriter() != null )
         {
             t = report.getStackTraceWriter().getThrowable();
         }
@@ -222,10 +222,9 @@
             {
                 element.setAttribute( "message", message );
 
-                element.setAttribute( "type", ( stackTrace.indexOf( ":" ) > -1 ? stackTrace.substring(
0,
-                                                                                        
              stackTrace.indexOf(
-                                                                                        
                  ":" ) )
-                    : stackTrace ) );
+                element.setAttribute( "type", ( stackTrace.indexOf( ":" ) > -1
+                                                ? stackTrace.substring( 0, stackTrace.indexOf(
":" ) )
+                                                : stackTrace ) );
             }
             else
             {
@@ -233,7 +232,7 @@
             }
         }
 
-        if (stackTrace != null)
+        if ( stackTrace != null )
         {
             element.setValue( stackTrace );
         }

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/suite/AbstractDirectoryTestSuite.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/suite/AbstractDirectoryTestSuite.java?rev=682220&r1=682219&r2=682220&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/suite/AbstractDirectoryTestSuite.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/suite/AbstractDirectoryTestSuite.java
Sun Aug  3 14:29:12 2008
@@ -95,7 +95,10 @@
             {
                 SurefireTestSet testSet = createTestSet( testClass, classLoader );
                 
-                if ( testSet == null ) continue;
+                if ( testSet == null )
+                {
+                    continue;
+                }
 
                 if ( testSets.containsKey( testSet.getName() ) )
                 {

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/PojoTestSet.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/PojoTestSet.java?rev=682220&r1=682219&r2=682220&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/PojoTestSet.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/PojoTestSet.java
Sun Aug  3 14:29:12 2008
@@ -114,7 +114,8 @@
 
         userFriendlyMethodName += ')';
 
-        ReportEntry report = new ReportEntry( testObject.getClass().getName(), getTestName(
userFriendlyMethodName ), getName() );
+        ReportEntry report = new ReportEntry( testObject.getClass().getName(), getTestName(
userFriendlyMethodName ),
+                                              getName() );
 
         reportManager.testStarting( report );
 
@@ -133,9 +134,9 @@
 
             String stringToPrint = msgFmt.format( stringArgs );
 
-            report = new ReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName
), stringToPrint,
-                                      new PojoStackTraceWriter( testObject.getClass().getName(),
method.getName(),
-                                                                e ) );
+            report = new ReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName
),
+                                      stringToPrint, new PojoStackTraceWriter( testObject.getClass().getName(),
+                                                                               method.getName(),
e ) );
 
             reportManager.testFailed( report );
 
@@ -152,7 +153,8 @@
         {
             method.invoke( testObject, args );
 
-            report = new ReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName
), getName() );
+            report = new ReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName
),
+                                      getName() );
 
             reportManager.testSucceeded( report );
         }
@@ -167,8 +169,8 @@
                 msg = t.toString();
             }
 
-            report = new ReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName
), msg, new PojoStackTraceWriter(
-                testObject.getClass().getName(), method.getName(), t ) );
+            report = new ReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName
), msg,
+                new PojoStackTraceWriter( testObject.getClass().getName(), method.getName(),
t ) );
 
             reportManager.testFailed( report );
             // Don't return  here, because tearDownFixture should be called even
@@ -183,8 +185,8 @@
                 msg = t.toString();
             }
 
-            report = new ReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName
), msg, new PojoStackTraceWriter(
-                testObject.getClass().getName(), method.getName(), t ) );
+            report = new ReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName
), msg,
+                new PojoStackTraceWriter( testObject.getClass().getName(), method.getName(),
t ) );
 
             reportManager.testFailed( report );
             // Don't return  here, because tearDownFixture should be called even
@@ -206,9 +208,9 @@
 
             String stringToPrint = msgFmt.format( stringArgs );
 
-            report = new ReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName
), stringToPrint,
-                                      new PojoStackTraceWriter( testObject.getClass().getName(),
method.getName(),
-                                                                t ) );
+            report = new ReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName
),
+                                      stringToPrint, new PojoStackTraceWriter( testObject.getClass().getName(),
+                                                                               method.getName(),
t ) );
 
             reportManager.testFailed( report );
 

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedCheckedException.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedCheckedException.java?rev=682220&r1=682219&r2=682220&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedCheckedException.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedCheckedException.java
Sun Aug  3 14:29:12 2008
@@ -39,7 +39,7 @@
 import java.io.PrintWriter;
 
 /**
- * <p>Copied from Spring framework to keep Java 1.3 compatability.</p>
+ * <p>Copied from Spring framework to keep Java 1.3 compatibility.</p>
  * <p/>
  * <p>Handy class for wrapping checked Exceptions with a root cause.</p>
  * <p/>
@@ -57,8 +57,8 @@
  * (ah, the inflexibility of concrete inheritance!).
  * <p/>
  * <p>As discussed in
- * <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0764543857/">Expert One-On-One
J2EE Design and Development</a>,
- * runtime exceptions are often a better alternative to checked exceptions.
+ * <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0764543857/">Expert One-On-One
J2EE Design and
+ * Development</a>, runtime exceptions are often a better alternative to checked exceptions.
  * However, all exceptions should preserve their stack trace, if caused by a
  * lower-level exception.
  *
@@ -143,8 +143,8 @@
         }
         else
         {
-            return super.getMessage() + "; nested exception is " + getCause().getClass().getName()
+ ": " +
-                getCause().getMessage();
+            return super.getMessage() + "; nested exception is " + getCause().getClass().getName()
+ ": "
+                + getCause().getMessage();
         }
     }
 

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java?rev=682220&r1=682219&r2=682220&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java
Sun Aug  3 14:29:12 2008
@@ -57,8 +57,8 @@
  * (ah, the inflexibility of concrete inheritance!).
  * <p/>
  * <p>As discussed in
- * <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0764543857/">Expert One-On-One
J2EE Design and Development</a>,
- * runtime exceptions are often a better alternative to checked exceptions.
+ * <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0764543857/">Expert One-On-One
J2EE Design and
+ * Development</a>, runtime exceptions are often a better alternative to checked exceptions.
  * However, all exceptions should preserve their stack trace, if caused by a
  * lower-level exception.
  *
@@ -147,8 +147,8 @@
         }
         else
         {
-            return super.getMessage() + "; nested exception is " + getCause().getClass().getName()
+ ": " +
-                getCause().getMessage();
+            return super.getMessage() + "; nested exception is " + getCause().getClass().getName()
+ ": "
+                + getCause().getMessage();
         }
     }
 

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/PrettyPrintXMLWriter.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/PrettyPrintXMLWriter.java?rev=682220&r1=682219&r2=682220&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/PrettyPrintXMLWriter.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/PrettyPrintXMLWriter.java
Sun Aug  3 14:29:12 2008
@@ -19,7 +19,6 @@
  * under the License.
  */
 
-import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.XMLWriter;
 
 import java.io.PrintWriter;
@@ -148,12 +147,16 @@
     private static String escapeXml( String text )
     {
         StringBuffer sb = new StringBuffer ( text.length() * 2 );
-        for (int i = 0; i < text.length(); i++ ) {
+        for ( int i = 0; i < text.length(); i++ ) {
             char c = text.charAt( i );
-            if ( c < 32 ) {
-                if ( c == '\n' || c == '\r' || c == '\t') {
+            if ( c < 32 )
+            {
+                if ( c == '\n' || c == '\r' || c == '\t')
+                {
                     sb.append( c );
-                } else {
+                }
+                else
+                {
                     // uh-oh!  This character is illegal in XML 1.0!
                     // http://www.w3.org/TR/1998/REC-xml-19980210#charsets
                     // we're going to deliberately doubly-XML escape it...
@@ -161,17 +164,29 @@
                     // SUREFIRE-456
                     sb.append( "&amp;#" ).append( (int) c).append( ';' );
                 }
-            } else if ( c == '<') {
+            }
+            else if ( c == '<')
+            {
                 sb.append( "&lt;" );
-            } else if ( c == '>') {
+            }
+            else if ( c == '>')
+            {
                 sb.append( "&gt;" );
-            } else if (c == '&') {
+            }
+            else if (c == '&')
+            {
                 sb.append("&amp;");
-            } else if (c == '"') {
+            }
+            else if (c == '"')
+            {
                 sb.append("&quot;");
-            } else if (c == '\'') {
+            }
+            else if (c == '\'')
+            {
                 sb.append("&apos;");
-            } else {
+            }
+            else
+            {
                 sb.append( c );
             }
         }



Mime
View raw message