maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r682222 - in /maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter: ForkConfiguration.java ForkingWriterStreamConsumer.java SurefireBooter.java output/ForkingStreamConsumer.java
Date Sun, 03 Aug 2008 21:44:16 GMT
Author: hboutemy
Date: Sun Aug  3 14:44:16 2008
New Revision: 682222

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

Modified:
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkConfiguration.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkingWriterStreamConsumer.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/output/ForkingStreamConsumer.java

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkConfiguration.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkConfiguration.java?rev=682222&r1=682221&r2=682222&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkConfiguration.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkConfiguration.java
Sun Aug  3 14:44:16 2008
@@ -226,7 +226,8 @@
         throws IOException
     {
         File file = File.createTempFile( "surefirebooter", ".jar" );
-        if ( !debug ) {
+        if ( !debug )
+        {
             file.deleteOnExit();
         }
         FileOutputStream fos = new FileOutputStream( file );
@@ -247,11 +248,11 @@
             cp += UrlUtils.getURL( new File( el ) ).toExternalForm() + " ";
         }
 
-        man.getMainAttributes().putValue("Manifest-Version", "1.0");
-        man.getMainAttributes().putValue("Class-Path", cp.trim());
-        man.getMainAttributes().putValue("Main-Class", SurefireBooter.class.getName());
+        man.getMainAttributes().putValue( "Manifest-Version", "1.0" );
+        man.getMainAttributes().putValue( "Class-Path", cp.trim() );
+        man.getMainAttributes().putValue( "Main-Class", SurefireBooter.class.getName() );
 
-        man.write(jos);
+        man.write( jos );
         jos.close();
 
         return file;

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkingWriterStreamConsumer.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkingWriterStreamConsumer.java?rev=682222&r1=682221&r2=682222&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkingWriterStreamConsumer.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkingWriterStreamConsumer.java
Sun Aug  3 14:44:16 2008
@@ -19,7 +19,6 @@
  * under the License.
  */
 
-import org.apache.maven.surefire.booter.output.ForkingStreamConsumer;
 import org.apache.maven.surefire.report.ForkingConsoleReporter;
 import org.codehaus.plexus.util.cli.StreamConsumer;
 
@@ -29,7 +28,7 @@
 /**
  * @author Jason van Zyl
  * @version $Revision$
- * @deprecated use {@link ForkingStreamConsumer}
+ * @deprecated use {@link org.apache.maven.surefire.booter.output.ForkingStreamConsumer}
  */
 public class ForkingWriterStreamConsumer
     implements StreamConsumer

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java?rev=682222&r1=682221&r2=682222&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
Sun Aug  3 14:44:16 2008
@@ -227,7 +227,8 @@
         this.forkConfiguration = forkConfiguration;
     }
     
-    public boolean isForking() {
+    public boolean isForking()
+    {
         return forkConfiguration.isForking();
     }
 
@@ -321,12 +322,16 @@
             ClassLoader testsClassLoader;
             String testClassPath = getTestClassPathAsString();
             System.setProperty( "surefire.test.class.path", testClassPath );
-            if (useManifestOnlyJar()) {
+            if ( useManifestOnlyJar() )
+            {
                 testsClassLoader = getClass().getClassLoader(); // ClassLoader.getSystemClassLoader()
-                // SUREFIRE-459, trick the app under test into thinking its classpath was
conventional (instead of a single manifest-only jar) 
-                System.setProperty( "surefire.real.class.path", System.getProperty( "java.class.path"
));
+                // SUREFIRE-459, trick the app under test into thinking its classpath was
conventional
+                // (instead of a single manifest-only jar) 
+                System.setProperty( "surefire.real.class.path", System.getProperty( "java.class.path"
) );
                 System.setProperty( "java.class.path", testClassPath );
-            } else {
+            }
+            else
+            {
                 testsClassLoader = createClassLoader( classPathUrls, null, childDelegation
);
             }
             
@@ -367,7 +372,8 @@
     private String getTestClassPathAsString()
     {
         StringBuffer sb = new StringBuffer();
-        for (int i = 0; i < classPathUrls.size(); i++) {
+        for ( int i = 0; i < classPathUrls.size(); i++ )
+        {
             sb.append( classPathUrls.get( i ) ).append( File.pathSeparatorChar );
         }
         return sb.toString();
@@ -443,8 +449,8 @@
         }
         catch ( NoSuchMethodException e )
         {
-            throw new SurefireBooterForkException( "Unable to find appropriate constructor
for test suite '" +
-                className + "': " + e.getMessage(), e );
+            throw new SurefireBooterForkException( "Unable to find appropriate constructor
for test suite '"
+                + className + "': " + e.getMessage(), e );
         }
 
         Map testSets;
@@ -485,9 +491,9 @@
     {
         setForkProperties( Collections.singletonList( testSuite ), properties );
 
-        if (testSet instanceof String)
+        if ( testSet instanceof String )
         {
-            properties.setProperty( "testSet", (String) testSet);
+            properties.setProperty( "testSet", (String) testSet );
         }
 
         return fork( properties, showHeading, showFooter );
@@ -583,7 +589,9 @@
         {
             File[] files = (File[]) param;
             return "[" + StringUtils.join( files, "," ) + "]";
-        } else if ( param instanceof Properties ) {
+        }
+        else if ( param instanceof Properties )
+        {
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
             try
             {
@@ -601,12 +609,12 @@
         }
     }
 
-    private final boolean useSystemClassLoader()
+    private boolean useSystemClassLoader()
     {
         return forkConfiguration.isUseSystemClassLoader() && ( isForked || forkConfiguration.isForking()
);
     }
     
-    private final boolean useManifestOnlyJar()
+    private boolean useManifestOnlyJar()
     {
         return forkConfiguration.isUseSystemClassLoader() && forkConfiguration.isUseManifestOnlyJar();
     }
@@ -828,13 +836,11 @@
         {
             // bit of a glitch that it need sto be done twice to do an odd number of vertical
bars (eg |||, |||||).
             String[] params =
-                StringUtils.split(
-                                   StringUtils.replace( StringUtils.replace( paramProperty,
"||", "| |" ), "||", "| |" ),
-                                   "|" );
+                StringUtils.split( StringUtils.replace( StringUtils.replace( paramProperty,
"||", "| |" ),
+                                                        "||", "| |" ), "|" );
             String[] types =
-                StringUtils.split(
-                                   StringUtils.replace( StringUtils.replace( typeProperty,
"||", "| |" ), "||", "| |" ),
-                                   "|" );
+                StringUtils.split( StringUtils.replace( StringUtils.replace( typeProperty,
"||", "| |" ),
+                                                        "||", "| |" ), "|" );
 
             paramObjects = new Object[params.length];
 
@@ -874,7 +880,8 @@
                 {
                     paramObjects[i] = Integer.valueOf( params[i] );
                 }
-                else if (types[i].equals(Properties.class.getName())) {
+                else if ( types[i].equals( Properties.class.getName() ) )
+                {
                     final Properties result = new Properties();
                     final String value = params[i];
                     try
@@ -932,7 +939,8 @@
             {
                 String name = (String) e.nextElement();
 
-                if ( name.startsWith( REPORT_PROPERTY_PREFIX ) && !name.endsWith(
PARAMS_SUFIX ) && !name.endsWith( TYPES_SUFIX ) )
+                if ( name.startsWith( REPORT_PROPERTY_PREFIX ) && !name.endsWith(
PARAMS_SUFIX )
+                                && !name.endsWith( TYPES_SUFIX ) )
                 {
                     String className = p.getProperty( name );
 
@@ -940,7 +948,8 @@
                     String types = p.getProperty( name + TYPES_SUFIX );
                     surefireBooter.addReport( className, constructParamObjects( params, types
) );
                 }
-                else if ( name.startsWith( TEST_SUITE_PROPERTY_PREFIX ) && !name.endsWith(
PARAMS_SUFIX ) && !name.endsWith( TYPES_SUFIX ) )
+                else if ( name.startsWith( TEST_SUITE_PROPERTY_PREFIX ) && !name.endsWith(
PARAMS_SUFIX )
+                                && !name.endsWith( TYPES_SUFIX ) )
                 {
                     String className = p.getProperty( name );
 
@@ -950,11 +959,13 @@
                 }
                 else if ( name.startsWith( "classPathUrl." ) )
                 {
-                    classPathUrls.put(Integer.valueOf(name.substring(name.indexOf('.') +
1)), p.getProperty( name ));
+                    classPathUrls.put( Integer.valueOf( name.substring( name.indexOf( '.'
) + 1 ) ),
+                                       p.getProperty( name ) );
                 }
                 else if ( name.startsWith( "surefireClassPathUrl." ) )
                 {
-                    surefireClassPathUrls.put(Integer.valueOf(name.substring(name.indexOf('.')
+ 1)), p.getProperty( name ));
+                    surefireClassPathUrls.put( Integer.valueOf( name.substring( name.indexOf(
'.' ) + 1 ) ),
+                                               p.getProperty( name ) );
                 }
                 else if ( name.startsWith( "surefireBootClassPathUrl." ) )
                 {
@@ -972,30 +983,31 @@
                 }
                 else if ( "useSystemClassLoader".equals( name ) )
                 {
-                    surefireBooter.forkConfiguration.setUseSystemClassLoader( Boolean.valueOf(
-                                                                                        
      p.getProperty( "useSystemClassLoader" ) ).booleanValue() );
+                    boolean value = Boolean.valueOf( p.getProperty( "useSystemClassLoader"
) ).booleanValue();
+                    surefireBooter.forkConfiguration.setUseSystemClassLoader( value );
                 }
                 else if ( "useManifestOnlyJar".equals( name ) )
                 {
-                    surefireBooter.forkConfiguration.setUseManifestOnlyJar( Boolean.valueOf(
-                                                                                        
      p.getProperty( "useManifestOnlyJar" ) ).booleanValue() );
+                    boolean value = Boolean.valueOf( p.getProperty( "useManifestOnlyJar"
) ).booleanValue();
+                    surefireBooter.forkConfiguration.setUseManifestOnlyJar( value );
                 }
                 else if ( "failIfNoTests".equals( name ) )
                 {
-                    surefireBooter.setFailIfNoTests( Boolean.valueOf( p.getProperty( "failIfNoTests"
) ).booleanValue() );
+                    boolean value = Boolean.valueOf( p.getProperty( "failIfNoTests" ) ).booleanValue();
+                    surefireBooter.setFailIfNoTests( value );
                 }
             }
 
-            for (Iterator cpi = classPathUrls.keySet().iterator(); cpi.hasNext();)
+            for ( Iterator cpi = classPathUrls.keySet().iterator(); cpi.hasNext(); )
             {
-                String url = (String) classPathUrls.get(cpi.next());
-                surefireBooter.addClassPathUrl(url);
+                String url = (String) classPathUrls.get( cpi.next() );
+                surefireBooter.addClassPathUrl( url );
             }
 
-            for (Iterator scpi = surefireClassPathUrls.keySet().iterator(); scpi.hasNext();)
+            for ( Iterator scpi = surefireClassPathUrls.keySet().iterator(); scpi.hasNext();
)
             {
-                String url = (String) surefireClassPathUrls.get(scpi.next());
-                surefireBooter.addSurefireClassPathUrl(url);
+                String url = (String) surefireClassPathUrls.get( scpi.next() );
+                surefireBooter.addSurefireClassPathUrl( url );
             }
 
             String testSet = p.getProperty( "testSet" );

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/output/ForkingStreamConsumer.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/output/ForkingStreamConsumer.java?rev=682222&r1=682221&r2=682222&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/output/ForkingStreamConsumer.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/output/ForkingStreamConsumer.java
Sun Aug  3 14:44:16 2008
@@ -33,11 +33,11 @@
 public class ForkingStreamConsumer
     implements StreamConsumer
 {
-    private static int STANDARD_PREFIX_LENGTH = ForkingConsoleReporter.FORKING_PREFIX_STANDARD.length();
+    private final static int STANDARD_PREFIX_LENGTH = ForkingConsoleReporter.FORKING_PREFIX_STANDARD.length();
 
-    private static int HEADING_PREFIX_LENGTH = ForkingConsoleReporter.FORKING_PREFIX_HEADING.length();
+    private final static int HEADING_PREFIX_LENGTH = ForkingConsoleReporter.FORKING_PREFIX_HEADING.length();
 
-    private static int FOOTER_PREFIX_LENGTH = ForkingConsoleReporter.FORKING_PREFIX_FOOTER.length();
+    private final static int FOOTER_PREFIX_LENGTH = ForkingConsoleReporter.FORKING_PREFIX_FOOTER.length();
 
     private OutputConsumer outputConsumer;
 



Mime
View raw message