continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1372260 [13/30] - in /continuum/trunk: ./ continuum-api/ continuum-api/src/main/java/org/apache/continuum/builder/distributed/ continuum-api/src/main/java/org/apache/continuum/builder/distributed/executor/ continuum-api/src/main/java/org/a...
Date Mon, 13 Aug 2012 04:29:28 GMT
Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/manager/spring/NotifierFactoryBean.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/manager/spring/NotifierFactoryBean.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/manager/spring/NotifierFactoryBean.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/manager/spring/NotifierFactoryBean.java Mon Aug 13 04:29:09 2012
@@ -19,9 +19,6 @@ package org.apache.maven.continuum.notif
  * under the License.
  */
 
-import java.util.HashMap;
-import java.util.Map;
-
 import org.apache.maven.continuum.notification.Notifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -32,6 +29,9 @@ import org.springframework.beans.factory
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id$
@@ -48,8 +48,8 @@ public class NotifierFactoryBean
     {
         Map<String, Notifier> notifiers = new HashMap<String, Notifier>();
 
-        Map<String, Notifier> beans =
-            BeanFactoryUtils.beansOfTypeIncludingAncestors( applicationContext, Notifier.class );
+        Map<String, Notifier> beans = BeanFactoryUtils.beansOfTypeIncludingAncestors( applicationContext,
+                                                                                      Notifier.class );
 
         for ( Notifier notifier : beans.values() )
         {

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java Mon Aug 13 04:29:09 2012
@@ -19,17 +19,6 @@ package org.apache.maven.continuum.proje
  * under the License.
  */
 
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.UnknownHostException;
-
 import org.apache.commons.io.IOUtils;
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
@@ -63,6 +52,17 @@ import org.codehaus.plexus.util.StringUt
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.UnknownHostException;
+
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -76,7 +76,7 @@ public abstract class AbstractContinuumP
     protected final Logger log = LoggerFactory.getLogger( getClass() );
 
     private HttpParams params;
-    
+
     private ClientConnectionManager cm;
 
     public void initialize()
@@ -131,7 +131,7 @@ public abstract class AbstractContinuumP
             HttpResponse httpResponse = httpClient.execute( httpGet );
 
             // CONTINUUM-2627
-            if( httpResponse.getStatusLine().getStatusCode() != 200 )
+            if ( httpResponse.getStatusLine().getStatusCode() != 200 )
             {
                 log.debug( "Initial attempt did not return a 200 status code. Trying pre-emptive authentication.." );
 
@@ -141,11 +141,11 @@ public abstract class AbstractContinuumP
                 AuthCache authCache = new BasicAuthCache();
                 // Generate BASIC scheme object and add it to the local auth cache
                 BasicScheme basicAuth = new BasicScheme();
-                authCache.put(targetHost, basicAuth);
+                authCache.put( targetHost, basicAuth );
 
                 // Add AuthCache to the execution context
                 BasicHttpContext localcontext = new BasicHttpContext();
-                localcontext.setAttribute( ClientContext.AUTH_CACHE, authCache);
+                localcontext.setAttribute( ClientContext.AUTH_CACHE, authCache );
 
                 httpResponse = httpClient.execute( targetHost, httpGet, localcontext );
             }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/EasySSLSocketFactory.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/EasySSLSocketFactory.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/EasySSLSocketFactory.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/EasySSLSocketFactory.java Mon Aug 13 04:29:09 2012
@@ -19,24 +19,23 @@ package org.apache.maven.continuum.proje
  * under the License.
  */
 
+import org.apache.http.conn.ConnectTimeoutException;
+import org.apache.http.conn.scheme.LayeredSocketFactory;
+import org.apache.http.conn.scheme.SocketFactory;
+import org.apache.http.params.HttpConnectionParams;
+import org.apache.http.params.HttpParams;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.Socket;
 import java.net.UnknownHostException;
-
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLSocket;
 import javax.net.ssl.TrustManager;
 
-import org.apache.http.conn.ConnectTimeoutException;
-import org.apache.http.conn.scheme.LayeredSocketFactory;
-import org.apache.http.conn.scheme.SocketFactory;
-import org.apache.http.params.HttpConnectionParams;
-import org.apache.http.params.HttpParams;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 /**
  * This socket factory will create ssl socket that accepts self signed certificate
  *

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/EasyX509TrustManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/EasyX509TrustManager.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/EasyX509TrustManager.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/EasyX509TrustManager.java Mon Aug 13 04:29:09 2012
@@ -19,19 +19,18 @@ package org.apache.maven.continuum.proje
  * under the License.
  */
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import java.security.KeyStore;
 import java.security.KeyStoreException;
 import java.security.NoSuchAlgorithmException;
 import java.security.cert.CertificateException;
 import java.security.cert.X509Certificate;
-
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.TrustManagerFactory;
 import javax.net.ssl.X509TrustManager;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 /**
  * @author olamy
  * @version $Id$
@@ -62,7 +61,7 @@ public class EasyX509TrustManager
     }
 
     /**
-     * @see javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[],String authType)
+     * @see javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[], String authType)
      */
     public void checkClientTrusted( X509Certificate[] certificates, String authType )
         throws CertificateException
@@ -71,7 +70,7 @@ public class EasyX509TrustManager
     }
 
     /**
-     * @see javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[],String authType)
+     * @see javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[], String authType)
      */
     public void checkServerTrusted( X509Certificate[] certificates, String authType )
         throws CertificateException

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/DefaultContinuumProjectBuilderManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/DefaultContinuumProjectBuilderManager.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/DefaultContinuumProjectBuilderManager.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/DefaultContinuumProjectBuilderManager.java Mon Aug 13 04:29:09 2012
@@ -19,10 +19,10 @@ package org.apache.maven.continuum.proje
  * under the License.
  */
 
-import java.util.Map;
-
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
 
+import java.util.Map;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java Mon Aug 13 04:29:09 2012
@@ -19,10 +19,6 @@ package org.apache.maven.continuum.proje
  * under the License.
  */
 
-import java.io.File;
-import java.net.URL;
-import java.util.List;
-
 import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionServiceException;
 import org.apache.maven.continuum.execution.maven.m1.MavenOneBuildExecutor;
@@ -38,6 +34,10 @@ import org.apache.maven.continuum.projec
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.codehaus.plexus.util.StringUtils;
 
+import java.io.File;
+import java.net.URL;
+import java.util.List;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -67,17 +67,19 @@ public class MavenOneContinuumProjectBui
     public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password )
         throws ContinuumProjectBuilderException
     {
-    	return buildProjectsFromMetadata( url, username, password, true, false );
+        return buildProjectsFromMetadata( url, username, password, true, false );
     }
 
     public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
-    						boolean recursiveProjects, boolean checkoutInSingleDirectory )
+                                                                     boolean recursiveProjects,
+                                                                     boolean checkoutInSingleDirectory )
         throws ContinuumProjectBuilderException
     {
         try
         {
             return buildProjectsFromMetadata( url, username, password, recursiveProjects,
-            				buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate(), false );
+                                              buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate(),
+                                              false );
         }
         catch ( BuildDefinitionServiceException e )
         {
@@ -87,7 +89,8 @@ public class MavenOneContinuumProjectBui
 
     public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
                                                                      boolean recursiveProjects,
-                                                                     BuildDefinitionTemplate buildDefinitionTemplate, boolean checkoutInSingleDirectory )
+                                                                     BuildDefinitionTemplate buildDefinitionTemplate,
+                                                                     boolean checkoutInSingleDirectory )
         throws ContinuumProjectBuilderException
     {
         ContinuumProjectBuildingResult result = new ContinuumProjectBuildingResult();
@@ -105,7 +108,7 @@ public class MavenOneContinuumProjectBui
 
         try
         {
-            metadataHelper.mapMetadata( result, pomFile, project, true);
+            metadataHelper.mapMetadata( result, pomFile, project, true );
 
             if ( result.hasErrors() )
             {

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java Mon Aug 13 04:29:09 2012
@@ -19,12 +19,6 @@ package org.apache.maven.continuum.proje
  * under the License.
  */
 
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.continuum.dao.LocalRepositoryDao;
 import org.apache.continuum.dao.ScheduleDao;
 import org.apache.continuum.model.repository.LocalRepository;
@@ -46,6 +40,12 @@ import org.apache.maven.continuum.store.
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.util.StringUtils;
 
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -83,7 +83,7 @@ public class MavenTwoContinuumProjectBui
      * @plexus.configuration
      */
     private List<String> excludedPackagingTypes = new ArrayList<String>();
-        
+
     private Project rootProject;
 
     // ----------------------------------------------------------------------
@@ -92,18 +92,19 @@ public class MavenTwoContinuumProjectBui
     public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password )
         throws ContinuumProjectBuilderException
     {
-    	return buildProjectsFromMetadata( url, username, password, true, false );
+        return buildProjectsFromMetadata( url, username, password, true, false );
     }
 
     public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
-    				boolean loadRecursiveProjects, boolean checkoutInSingleDirectory )
+                                                                     boolean loadRecursiveProjects,
+                                                                     boolean checkoutInSingleDirectory )
         throws ContinuumProjectBuilderException
     {
         try
         {
             return buildProjectsFromMetadata( url, username, password, loadRecursiveProjects,
-            						buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate(),
-                                    checkoutInSingleDirectory );
+                                              buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate(),
+                                              checkoutInSingleDirectory );
         }
         catch ( BuildDefinitionServiceException e )
         {
@@ -113,7 +114,8 @@ public class MavenTwoContinuumProjectBui
 
     public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
                                                                      boolean loadRecursiveProjects,
-                                                                     BuildDefinitionTemplate buildDefinitionTemplate, boolean checkoutInSingleDirectory )
+                                                                     BuildDefinitionTemplate buildDefinitionTemplate,
+                                                                     boolean checkoutInSingleDirectory )
         throws ContinuumProjectBuilderException
     {
         // ----------------------------------------------------------------------
@@ -124,7 +126,8 @@ public class MavenTwoContinuumProjectBui
 
         try
         {
-        	readModules( url, result, true, username, password, null, loadRecursiveProjects, buildDefinitionTemplate, checkoutInSingleDirectory );
+            readModules( url, result, true, username, password, null, loadRecursiveProjects, buildDefinitionTemplate,
+                         checkoutInSingleDirectory );
         }
         catch ( BuildDefinitionServiceException e )
         {
@@ -182,8 +185,8 @@ public class MavenTwoContinuumProjectBui
             log.debug( "projectGroup != null" + ( projectGroup != null ) );
             if ( projectGroup != null )
             {
-                List<BuildDefinition> buildDefinitions =
-                    getBuildDefinitions( buildDefinitionTemplate, loadRecursiveProjects );
+                List<BuildDefinition> buildDefinitions = getBuildDefinitions( buildDefinitionTemplate,
+                                                                              loadRecursiveProjects );
                 boolean defaultSetted = false;
                 for ( BuildDefinition buildDefinition : buildDefinitions )
                 {
@@ -204,8 +207,8 @@ public class MavenTwoContinuumProjectBui
                     {
                         try
                         {
-                            Schedule schedule =
-                                scheduleDao.getScheduleByName( ConfigurationService.DEFAULT_SCHEDULE_NAME );
+                            Schedule schedule = scheduleDao.getScheduleByName(
+                                ConfigurationService.DEFAULT_SCHEDULE_NAME );
 
                             buildDefinition.setSchedule( schedule );
                         }
@@ -243,11 +246,11 @@ public class MavenTwoContinuumProjectBui
                     continuumProject.setScmPassword( password );
                 }
             }
-            
+
             continuumProject.setCheckedOutInSingleDirectory( checkoutInSingleDirectory );
-            
+
             // New project
-            builderHelper.mapMavenProjectToContinuumProject( result, mavenProject, continuumProject, true);
+            builderHelper.mapMavenProjectToContinuumProject( result, mavenProject, continuumProject, true );
 
             if ( result.hasErrors() )
             {
@@ -293,8 +296,8 @@ public class MavenTwoContinuumProjectBui
                             arguments = arguments.replace( "-N", "" );
                             projectBuildDef.setArguments( arguments );
 
-                            log.info( "Adding default build definition for project '" + continuumProject.getName()
-                                + "' without '--non-recursive' flag." );
+                            log.info( "Adding default build definition for project '" + continuumProject.getName() +
+                                          "' without '--non-recursive' flag." );
 
                             continuumProject.addBuildDefinition( projectBuildDef );
 
@@ -306,11 +309,11 @@ public class MavenTwoContinuumProjectBui
 
             result.addProject( continuumProject, MavenTwoBuildExecutor.ID );
 
-	        if( checkoutInSingleDirectory && rootProject == null )
-	        {
-	            rootProject = continuumProject;
-	            result.setRootProject( rootProject );
-	        }
+            if ( checkoutInSingleDirectory && rootProject == null )
+            {
+                rootProject = continuumProject;
+                result.setRootProject( rootProject );
+            }
         }
 
         List<String> modules = mavenProject.getModules();
@@ -347,7 +350,7 @@ public class MavenTwoContinuumProjectBui
 
                     try
                     {
-                    	urlString = StringUtils.replace( urlString, '\\', '/' );
+                        urlString = StringUtils.replace( urlString, '\\', '/' );
                         moduleUrl = new URL( urlString );
                     }
                     catch ( MalformedURLException e )
@@ -356,34 +359,35 @@ public class MavenTwoContinuumProjectBui
                         result.addError( ContinuumProjectBuildingResult.ERROR_MALFORMED_URL, urlString );
                         continue;
                     }
-                    
-                    String moduleScmUrl = "";                    
-                 
+
+                    String moduleScmUrl = "";
+
                     String modulePath = StringUtils.replace( new String( module ), '\\', '/' );
-                    
+
                     // check if module is relative
-                    if( modulePath.indexOf( "../" ) != -1 )
-                    {   
-                        int depth =
-                            StringUtils.countMatches( StringUtils.substring( modulePath, 0,
-                                                                             modulePath.lastIndexOf( '/' ) + 1 ), "/" );
-                        
+                    if ( modulePath.indexOf( "../" ) != -1 )
+                    {
+                        int depth = StringUtils.countMatches( StringUtils.substring( modulePath, 0,
+                                                                                     modulePath.lastIndexOf( '/' ) +
+                                                                                         1 ), "/" );
+
                         String baseUrl = "";
-                        for( int j = 1; j <= depth; j++ )
+                        for ( int j = 1; j <= depth; j++ )
                         {
                             scmUrl = StringUtils.chompLast( new String( scmUrl ), "/" );
-                            baseUrl = StringUtils.substring( scmUrl, 0, scmUrl.lastIndexOf( '/' ) );                            
+                            baseUrl = StringUtils.substring( scmUrl, 0, scmUrl.lastIndexOf( '/' ) );
                         }
-                        moduleScmUrl = baseUrl + "/" + StringUtils.substring( modulePath, modulePath.lastIndexOf( "../" ) + 3 );
+                        moduleScmUrl = baseUrl + "/" + StringUtils.substring( modulePath, modulePath.lastIndexOf(
+                            "../" ) + 3 );
                     }
                     else
                     {
-                    	scmUrl = StringUtils.chompLast( scmUrl, "/" );
-                    	moduleScmUrl = scmUrl + "/" + modulePath;
+                        scmUrl = StringUtils.chompLast( scmUrl, "/" );
+                        moduleScmUrl = scmUrl + "/" + modulePath;
                     }
                     // we are in recursive loading mode
                     readModules( moduleUrl, result, false, username, password, moduleScmUrl, true,
-                    		buildDefinitionTemplate, checkoutInSingleDirectory );
+                                 buildDefinitionTemplate, checkoutInSingleDirectory );
                 }
             }
         }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumBuildJob.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumBuildJob.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumBuildJob.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumBuildJob.java Mon Aug 13 04:29:09 2012
@@ -23,9 +23,9 @@ import org.apache.maven.continuum.Contin
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.codehaus.plexus.scheduler.AbstractJob;
-import org.slf4j.Logger;
 import org.quartz.JobDetail;
 import org.quartz.JobExecutionContext;
+import org.slf4j.Logger;
 
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumPurgeJob.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumPurgeJob.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumPurgeJob.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumPurgeJob.java Mon Aug 13 04:29:09 2012
@@ -24,9 +24,9 @@ import org.apache.continuum.purge.Contin
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.codehaus.plexus.scheduler.AbstractJob;
-import org.slf4j.Logger;
 import org.quartz.JobDetail;
 import org.quartz.JobExecutionContext;
+import org.slf4j.Logger;
 
 /**
  * @author Maria Catherine Tan
@@ -37,7 +37,7 @@ public class ContinuumPurgeJob
     extends AbstractJob
 {
     public static final String PURGE_GROUP = "PURGE_GROUP";
-	
+
     public void execute( JobExecutionContext context )
     {
         if ( isInterrupted() )
@@ -64,7 +64,7 @@ public class ContinuumPurgeJob
         Continuum continuum = (Continuum) jobDetail.getJobDataMap().get( ContinuumSchedulerConstants.CONTINUUM );
 
         ContinuumPurgeManager purgeManager = continuum.getPurgeManager();
-        
+
         Schedule schedule = (Schedule) jobDetail.getJobDataMap().get( ContinuumSchedulerConstants.SCHEDULE );
 
         try

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java Mon Aug 13 04:29:09 2012
@@ -19,9 +19,6 @@ package org.apache.maven.continuum.scm.q
  * under the License.
  */
 
-import java.util.HashMap;
-import java.util.Map;
-
 import org.apache.continuum.dao.ProjectDao;
 import org.apache.continuum.taskqueue.CheckOutTask;
 import org.apache.maven.continuum.core.action.AbstractContinuumAction;
@@ -35,6 +32,9 @@ import org.codehaus.plexus.taskqueue.exe
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -95,10 +95,11 @@ public class CheckOutTaskExecutor
         CheckoutProjectContinuumAction.setScmUsername( context, task.getScmUserName() );
 
         CheckoutProjectContinuumAction.setScmPassword( context, task.getScmPassword() );
-        
+
         AbstractContinuumAction.setProjectScmRootUrl( context, task.getScmRootUrl() );
-        
-        AbstractContinuumAction.setListOfProjectsInGroupWithCommonScmRoot( context, task.getProjectsWithCommonScmRoot() );
+
+        AbstractContinuumAction.setListOfProjectsInGroupWithCommonScmRoot( context,
+                                                                           task.getProjectsWithCommonScmRoot() );
 
         try
         {

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java Mon Aug 13 04:29:09 2012
@@ -19,13 +19,6 @@ package org.apache.maven.continuum.scm.q
  * under the License.
  */
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.io.File;
-
 import org.apache.continuum.dao.BuildDefinitionDao;
 import org.apache.continuum.dao.BuildResultDao;
 import org.apache.continuum.dao.ProjectDao;
@@ -59,6 +52,13 @@ import org.codehaus.plexus.util.StringUt
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 /**
  * @author <a href="mailto:ctan@apache.org">Maria Catherine Tan</a>
  * @version $Id$
@@ -125,9 +125,9 @@ public class PrepareBuildProjectsTaskExe
 
         try
         {
-        	if ( !projectsId.isEmpty() )
+            if ( !projectsId.isEmpty() )
             {
-        	    int projectId = projectsId.iterator().next();
+                int projectId = projectsId.iterator().next();
                 Project project = projectDao.getProject( projectId );
                 ProjectGroup projectGroup = project.getProjectGroup();
                 projectGroupId = projectGroup.getId();
@@ -140,7 +140,7 @@ public class PrepareBuildProjectsTaskExe
 
             for ( Project project : projectList )
             {
-	            if ( rootProject == null )
+                if ( rootProject == null )
                 {
                     // first project is the root project.
                     rootProject = project;
@@ -155,14 +155,14 @@ public class PrepareBuildProjectsTaskExe
 
                     log.info( "Initializing prepare build" );
                     context = initializeContext( project, buildDefinitionId, prepareTask.getBuildTrigger() );
-    
-                    log.info(
-                        "Starting prepare build of project: " + AbstractContinuumAction.getProject( context ).getName() );
+
+                    log.info( "Starting prepare build of project: " + AbstractContinuumAction.getProject(
+                        context ).getName() );
                     startPrepareBuild( context );
-    
+
                     if ( !checkProjectScmRoot( context ) )
                     {
-                    	break;
+                        break;
                     }
 
                     try
@@ -172,7 +172,7 @@ public class PrepareBuildProjectsTaskExe
                             log.info( "Purging existing working copy" );
                             cleanWorkingDirectory( context );
                         }
-    
+
                         // ----------------------------------------------------------------------
                         // TODO: Centralize the error handling from the SCM related actions.
                         // ContinuumScmResult should return a ContinuumScmResult from all
@@ -180,7 +180,7 @@ public class PrepareBuildProjectsTaskExe
                         // ----------------------------------------------------------------------
                         log.info( "Updating working dir" );
                         updateWorkingDirectory( context, rootProject );
-    
+
                         log.info( "Merging SCM results" );
                         //CONTINUUM-1393
                         if ( !AbstractContinuumAction.getBuildDefinition( context ).isBuildFresh() )
@@ -190,8 +190,8 @@ public class PrepareBuildProjectsTaskExe
                     }
                     finally
                     {
-                        log.info(
-                            "Ending prepare build of project: " + AbstractContinuumAction.getProject( context ).getName() );
+                        log.info( "Ending prepare build of project: " + AbstractContinuumAction.getProject(
+                            context ).getName() );
                         scmResultMap.put( AbstractContinuumAction.getProjectId( context ),
                                           AbstractContinuumAction.getScmResult( context, null ) );
                         endProjectPrepareBuild( context );
@@ -231,8 +231,8 @@ public class PrepareBuildProjectsTaskExe
 
             for ( ProjectScmRoot projectScmRoot : scmRoots )
             {
-            	projectScmRootAddress = projectScmRoot.getScmRootAddress();
-            	
+                projectScmRootAddress = projectScmRoot.getScmRootAddress();
+
                 if ( projectScmUrl.startsWith( projectScmRoot.getScmRootAddress() ) )
                 {
                     AbstractContinuumAction.setProjectScmRoot( context, projectScmRoot );
@@ -247,32 +247,32 @@ public class PrepareBuildProjectsTaskExe
             AbstractContinuumAction.setBuildTrigger( context, buildTrigger );
 
             AbstractContinuumAction.setBuildDefinitionId( context, buildDefinitionId );
-            AbstractContinuumAction.setBuildDefinition( context,
-                                                        buildDefinitionDao.getBuildDefinition( buildDefinitionId ) );
+            AbstractContinuumAction.setBuildDefinition( context, buildDefinitionDao.getBuildDefinition(
+                buildDefinitionId ) );
 
-             if( project.isCheckedOutInSingleDirectory() )
-             {
-                 List<Project> projectsInGroup =
-                     projectGroupDao.getProjectGroupWithProjects( projectGroup.getId() ).getProjects(); 
-                 List<Project> projectsWithCommonScmRoot = new ArrayList<Project>();            
-                 for( Project projectInGroup : projectsInGroup )
-                 {
-                     if( projectInGroup.getScmUrl().startsWith( projectScmRootAddress ) )
-                     {
-                         projectsWithCommonScmRoot.add( projectInGroup );
-                     }
-                 }            
-                 AbstractContinuumAction.setListOfProjectsInGroupWithCommonScmRoot( context, projectsWithCommonScmRoot );
-             }
-            
-            BuildResult oldBuildResult =
-            	buildResultDao.getLatestBuildResultForBuildDefinition( project.getId(), buildDefinitionId );
+            if ( project.isCheckedOutInSingleDirectory() )
+            {
+                List<Project> projectsInGroup = projectGroupDao.getProjectGroupWithProjects(
+                    projectGroup.getId() ).getProjects();
+                List<Project> projectsWithCommonScmRoot = new ArrayList<Project>();
+                for ( Project projectInGroup : projectsInGroup )
+                {
+                    if ( projectInGroup.getScmUrl().startsWith( projectScmRootAddress ) )
+                    {
+                        projectsWithCommonScmRoot.add( projectInGroup );
+                    }
+                }
+                AbstractContinuumAction.setListOfProjectsInGroupWithCommonScmRoot( context, projectsWithCommonScmRoot );
+            }
+
+            BuildResult oldBuildResult = buildResultDao.getLatestBuildResultForBuildDefinition( project.getId(),
+                                                                                                buildDefinitionId );
 
             if ( oldBuildResult != null )
             {
-                AbstractContinuumAction.setOldScmResult( context,
-                										getOldScmResults( project.getId(), oldBuildResult.getBuildNumber(),
-                                                                           oldBuildResult.getEndTime() ) );
+                AbstractContinuumAction.setOldScmResult( context, getOldScmResults( project.getId(),
+                                                                                    oldBuildResult.getBuildNumber(),
+                                                                                    oldBuildResult.getEndTime() ) );
             }
             else
             {
@@ -295,7 +295,7 @@ public class PrepareBuildProjectsTaskExe
 
     private void updateWorkingDirectory( Map<String, Object> context, Project rootProject )
         throws TaskExecutionException
-    {   
+    {
         performAction( "check-working-directory", context );
 
         boolean workingDirectoryExists = CheckWorkingDirectoryAction.isWorkingDirectoryExists( context );
@@ -314,8 +314,9 @@ public class PrepareBuildProjectsTaskExe
 
             AbstractContinuumAction.setWorkingDirectory( context, workingDirectoryService.getWorkingDirectory(
                 project ).getAbsolutePath() );
-            
-            List<Project> projectsWithCommonScmRoot = AbstractContinuumAction.getListOfProjectsInGroupWithCommonScmRoot( context );           
+
+            List<Project> projectsWithCommonScmRoot = AbstractContinuumAction.getListOfProjectsInGroupWithCommonScmRoot(
+                context );
             String projectScmRootUrl = AbstractContinuumAction.getProjectScmRootUrl( context, project.getScmUrl() );
             String workingDir = null;
 
@@ -341,13 +342,14 @@ public class PrepareBuildProjectsTaskExe
 
             if ( workingDir == null || new File( workingDir ).exists() )
             {
-                workingDir = workingDirectoryService.getWorkingDirectory( 
-                    project, projectScmRootUrl, projectsWithCommonScmRoot ).getAbsolutePath();
+                workingDir = workingDirectoryService.getWorkingDirectory( project, projectScmRootUrl,
+                                                                          projectsWithCommonScmRoot ).getAbsolutePath();
             }
 
             AbstractContinuumAction.setWorkingDirectory( context, workingDir );
 
-            if ( rootProject.getId() != project.getId() || ( rootProject.getId() == project.getId() && !isRootDirectory( workingDir, rootProject ) ) )
+            if ( rootProject.getId() != project.getId() || ( rootProject.getId() == project.getId() && !isRootDirectory(
+                workingDir, rootProject ) ) )
             {
                 AbstractContinuumAction.setRootDirectory( context, false );
             }
@@ -602,10 +604,11 @@ public class PrepareBuildProjectsTaskExe
         }
     }
 
-    private void buildProjects( int projectGroupId, List<Project> projectList, Map<Integer, Integer> projectsAndBuildDefinitionsMap, BuildTrigger buildTrigger,
-    		Map<Integer, ScmResult> scmResultMap )
+    private void buildProjects( int projectGroupId, List<Project> projectList,
+                                Map<Integer, Integer> projectsAndBuildDefinitionsMap, BuildTrigger buildTrigger,
+                                Map<Integer, ScmResult> scmResultMap )
         throws TaskExecutionException
-    {   
+    {
         List<Project> projectsToBeBuilt = new ArrayList<Project>();
         Map<Integer, BuildDefinition> projectsBuildDefinitionsMap = new HashMap<Integer, BuildDefinition>();
 
@@ -654,10 +657,10 @@ public class PrepareBuildProjectsTaskExe
             throw new TaskExecutionException( "Error executing action 'build-project'", e );
         }
     }
-    
+
     private boolean isRootDirectory( String workingDir, Project rootProject )
     {
-        return workingDir.endsWith( Integer.toString( rootProject.getId() ) + System.getProperty( "line.separator" ) )
-            || workingDir.endsWith( Integer.toString( rootProject.getId() ) );
+        return workingDir.endsWith( Integer.toString( rootProject.getId() ) + System.getProperty(
+            "line.separator" ) ) || workingDir.endsWith( Integer.toString( rootProject.getId() ) );
     }
 }

Modified: continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components-fragment.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components-fragment.xml?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components-fragment.xml (original)
+++ continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components-fragment.xml Mon Aug 13 04:29:09 2012
@@ -19,12 +19,12 @@
 
 <component-set>
   <components>
-    
+
     <!--
-     |
-     | Build Project Task Queue
-     |
-     |-->
+    |
+    | Build Project Task Queue
+    |
+    |-->
 
     <component>
       <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
@@ -48,7 +48,8 @@
       <role-hint>build-project</role-hint>
       <instantiation-strategy>per-lookup</instantiation-strategy>
       <implementation>
-        org.apache.maven.continuum.buildqueue.evaluator.BuildProjectTaskViabilityEvaluator</implementation>
+        org.apache.maven.continuum.buildqueue.evaluator.BuildProjectTaskViabilityEvaluator
+      </implementation>
       <configuration>
         <required-buildInterval>1000</required-buildInterval>
       </configuration>
@@ -75,7 +76,7 @@
       <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
       <role-hint>build-project</role-hint>
       <instantiation-strategy>per-lookup</instantiation-strategy>
-      <implementation>org.apache.continuum.taskqueueexecutor.ParallelBuildsThreadedTaskQueueExecutor</implementation>      
+      <implementation>org.apache.continuum.taskqueueexecutor.ParallelBuildsThreadedTaskQueueExecutor</implementation>
       <requirements>
         <requirement>
           <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
@@ -132,7 +133,7 @@
      | Prepare Build Project Task Queue
      |
      |-->
-     
+
     <component>
       <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
       <role-hint>prepare-build-project</role-hint>
@@ -140,7 +141,7 @@
       <lifecycle-handler>plexus-configurable</lifecycle-handler>
       <instantiation-strategy>per-lookup</instantiation-strategy>
     </component>
-    
+
     <component>
       <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
       <role-hint>prepare-build-project</role-hint>
@@ -160,7 +161,7 @@
         <name>prepare-build-project</name>
       </configuration>
     </component>
-    
-    
+
+
   </components>
 </component-set>

Modified: continuum/trunk/continuum-core/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/resources/META-INF/spring-context.xml?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/resources/META-INF/spring-context.xml (original)
+++ continuum/trunk/continuum-core/src/main/resources/META-INF/spring-context.xml Mon Aug 13 04:29:09 2012
@@ -1,52 +1,48 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xmlns:aop="http://www.springframework.org/schema/aop"
-	xmlns:util="http://www.springframework.org/schema/util"
-	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
-		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
-		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
 
   <bean name="continuumBuildExecutor#maven2"
-         class="org.apache.maven.continuum.execution.maven.m2.MavenTwoBuildExecutor" autowire="byName">
+        class="org.apache.maven.continuum.execution.maven.m2.MavenTwoBuildExecutor" autowire="byName">
     <property name="defaultExecutable" value="mvn"/>
     <property name="builderHelper" ref="mavenBuilderHelper"/>
     <property name="projectHelper" ref="mavenProjectHelper"/>
   </bean>
   <bean name="continuumBuildExecutor#maven-1"
-         class="org.apache.maven.continuum.execution.maven.m1.MavenOneBuildExecutor" autowire="byName">
+        class="org.apache.maven.continuum.execution.maven.m1.MavenOneBuildExecutor" autowire="byName">
     <property name="defaultExecutable" value="maven"/>
     <property name="metadataHelper" ref="mavenOneMetadataHelper"/>
   </bean>
   <bean name="continuumBuildExecutor#ant"
-         class="org.apache.maven.continuum.execution.ant.AntBuildExecutor" autowire="byName">
+        class="org.apache.maven.continuum.execution.ant.AntBuildExecutor" autowire="byName">
     <property name="defaultExecutable" value="ant"/>
   </bean>
   <bean name="continuumBuildExecutor#shell"
-         class="org.apache.maven.continuum.execution.shell.ShellBuildExecutor" autowire="byName">
+        class="org.apache.maven.continuum.execution.shell.ShellBuildExecutor" autowire="byName">
   </bean>
 
   <bean id="notifierManager"
-    class="org.apache.maven.continuum.notification.manager.DefaultNotifierManager">
+        class="org.apache.maven.continuum.notification.manager.DefaultNotifierManager">
     <property name="notifiers">
       <bean class="org.apache.maven.continuum.notification.manager.spring.NotifierFactoryBean"/>
     </property>
   </bean>
-  
-  <bean name="buildsManager#parallel" 
-  		class="org.apache.continuum.buildmanager.ParallelBuildsManager" autowire="byName"/>
-    
-  <bean name="overallBuildQueue" 
-  		class="org.apache.continuum.taskqueue.DefaultOverallBuildQueue" scope="prototype" autowire="byName">
-     <property name="buildTaskQueueExecutor" ref="taskQueueExecutor#build-project"/>
-     <property name="checkoutTaskQueueExecutor" ref="taskQueueExecutor#check-out-project"/>
-     <property name="prepareBuildTaskQueueExecutor" ref="taskQueueExecutor#prepare-build-project"/>
+
+  <bean name="buildsManager#parallel"
+        class="org.apache.continuum.buildmanager.ParallelBuildsManager" autowire="byName"/>
+
+  <bean name="overallBuildQueue"
+        class="org.apache.continuum.taskqueue.DefaultOverallBuildQueue" scope="prototype" autowire="byName">
+    <property name="buildTaskQueueExecutor" ref="taskQueueExecutor#build-project"/>
+    <property name="checkoutTaskQueueExecutor" ref="taskQueueExecutor#check-out-project"/>
+    <property name="prepareBuildTaskQueueExecutor" ref="taskQueueExecutor#prepare-build-project"/>
   </bean>
-  
+
   <!-- jobs -->
   <bean name="continuumBuildJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
-    <property name="targetObject" ref="continuumWorker" />
-    <property name="targetMethod" value="work" />
-    <property name="concurrent" value="false" />
+    <property name="targetObject" ref="continuumWorker"/>
+    <property name="targetMethod" value="work"/>
+    <property name="concurrent" value="false"/>
   </bean>
 </beans>

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/continuum/AbstractAddProjectTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/continuum/AbstractAddProjectTest.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/continuum/AbstractAddProjectTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/continuum/AbstractAddProjectTest.java Mon Aug 13 04:29:09 2012
@@ -48,8 +48,8 @@ public abstract class AbstractAddProject
         File localRepo = new File( repo.getBasedir() );
         mkdirs( localRepo );
 
-        File artifact =
-            new File( localRepo, "org/apache/maven/continuum/continuum-parent/1.0.3/continuum-parent-1.0.3.pom" );
+        File artifact = new File( localRepo,
+                                  "org/apache/maven/continuum/continuum-parent/1.0.3/continuum-parent-1.0.3.pom" );
         mkdirs( artifact.getParentFile() );
 
         FileUtils.copyFile( getTestFile( "src/test/resources/projects/continuum/pom.xml" ), artifact );

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java Mon Aug 13 04:29:09 2012
@@ -19,15 +19,7 @@ package org.apache.continuum.builder.dis
  * under the License.
  */
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
 import org.apache.continuum.builder.distributed.executor.ThreadedDistributedBuildTaskQueueExecutor;
-import org.apache.continuum.builder.distributed.stubs.SlaveBuildAgentTransportClientStub;
 import org.apache.continuum.builder.distributed.stubs.DefaultDistributedBuildManagerStub;
 import org.apache.continuum.configuration.BuildAgentConfiguration;
 import org.apache.continuum.configuration.BuildAgentGroupConfiguration;
@@ -35,7 +27,6 @@ import org.apache.continuum.dao.BuildDef
 import org.apache.continuum.dao.BuildResultDao;
 import org.apache.continuum.dao.ProjectDao;
 import org.apache.continuum.dao.ProjectScmRootDao;
-import org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportService;
 import org.apache.continuum.model.project.ProjectRunSummary;
 import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.continuum.taskqueue.BuildProjectTask;
@@ -57,13 +48,20 @@ import org.jmock.Mockery;
 import org.jmock.integration.junit3.JUnit3Mockery;
 import org.jmock.lib.legacy.ClassImposteriser;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
 public class DefaultDistributedBuildManagerTest
     extends PlexusInSpringTestCase
 {
     private final String TEST_BUILD_AGENT1 = "http://sampleagent";
 
     private final String TEST_BUILD_AGENT2 = "http://testagent";
-    
+
     private final String TEST_BUILD_AGENT_GROUP1 = "buildAgentGroup1";
 
     private DefaultDistributedBuildManager distributedBuildManager;
@@ -140,7 +138,8 @@ public class DefaultDistributedBuildMana
         distributedBuildManager.setConfigurationService( configurationService );
         distributedBuildManagerStub.setConfigurationService( configurationService );
 
-        distributedBuildTaskQueueExecutor = (ThreadedDistributedBuildTaskQueueExecutor) context.mock( ThreadedDistributedBuildTaskQueueExecutor.class, "distributed-build-project" );
+        distributedBuildTaskQueueExecutor = (ThreadedDistributedBuildTaskQueueExecutor) context.mock(
+            ThreadedDistributedBuildTaskQueueExecutor.class, "distributed-build-project" );
 
         distributedBuildQueue = context.mock( TaskQueue.class, "distributed-build-queue" );
 
@@ -163,7 +162,7 @@ public class DefaultDistributedBuildMana
         List<BuildAgentConfiguration> buildAgents = new ArrayList<BuildAgentConfiguration>();
         buildAgents.add( buildAgent1 );
         buildAgents.add( buildAgent2 );
-        
+
         setUpBuildAgentGroup( buildAgents );
         setupBuildDefinition();
 
@@ -193,9 +192,11 @@ public class DefaultDistributedBuildMana
 
         recordViewQueuesAfterBuildAgentIsLost();
 
-        Map<String, List<PrepareBuildProjectsTask>> prepareBuildQueues = distributedBuildManager.getProjectsInPrepareBuildQueue();
+        Map<String, List<PrepareBuildProjectsTask>> prepareBuildQueues =
+            distributedBuildManager.getProjectsInPrepareBuildQueue();
         Map<String, List<BuildProjectTask>> buildQueues = distributedBuildManager.getProjectsInBuildQueue();
-        Map<String, PrepareBuildProjectsTask> currentPrepareBuild = distributedBuildManager.getProjectsCurrentlyPreparingBuild();
+        Map<String, PrepareBuildProjectsTask> currentPrepareBuild =
+            distributedBuildManager.getProjectsCurrentlyPreparingBuild();
         Map<String, BuildProjectTask> currentBuild = distributedBuildManager.getProjectsCurrentlyBuilding();
 
         assertEquals( prepareBuildQueues.size(), 0 );
@@ -210,11 +211,11 @@ public class DefaultDistributedBuildMana
         throws Exception
     {
         distributedBuildManager.setOverallDistributedBuildQueues( getMockOverallDistributedBuildQueues( 1 ) );
-        
+
         recordDisableOfBuildAgent();
 
         distributedBuildManager.isAgentAvailable( TEST_BUILD_AGENT1 );
-        
+
         context.assertIsSatisfied();
     }
 
@@ -225,9 +226,11 @@ public class DefaultDistributedBuildMana
 
         recordViewQueuesAfter2BuildAgentsAreLost();
 
-        Map<String, List<PrepareBuildProjectsTask>> prepareBuildQueues = distributedBuildManager.getProjectsInPrepareBuildQueue();
+        Map<String, List<PrepareBuildProjectsTask>> prepareBuildQueues =
+            distributedBuildManager.getProjectsInPrepareBuildQueue();
         Map<String, List<BuildProjectTask>> buildQueues = distributedBuildManager.getProjectsInBuildQueue();
-        Map<String, PrepareBuildProjectsTask> currentPrepareBuild = distributedBuildManager.getProjectsCurrentlyPreparingBuild();
+        Map<String, PrepareBuildProjectsTask> currentPrepareBuild =
+            distributedBuildManager.getProjectsCurrentlyPreparingBuild();
         Map<String, BuildProjectTask> currentBuild = distributedBuildManager.getProjectsCurrentlyBuilding();
 
         assertEquals( prepareBuildQueues.size(), 0 );
@@ -235,7 +238,7 @@ public class DefaultDistributedBuildMana
         assertEquals( currentPrepareBuild.size(), 0 );
         assertEquals( currentBuild.size(), 0 );
 
-        context.assertIsSatisfied();        
+        context.assertIsSatisfied();
     }
 
     public void testBuildProjectWithBuildAgentGroupWithNoCurrentBuilds()
@@ -264,7 +267,8 @@ public class DefaultDistributedBuildMana
         scmRoot.setScmRootAddress( "scmRootAddress2" );
         scmRoots.add( scmRoot );
 
-        distributedBuildManagerStub.prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, 1, "sample", "scmRootAddress1", 1, scmRoots );
+        distributedBuildManagerStub.prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, 1, "sample",
+                                                          "scmRootAddress1", 1, scmRoots );
 
         context.assertIsSatisfied();
     }
@@ -294,7 +298,8 @@ public class DefaultDistributedBuildMana
         scmRoot.setScmRootAddress( "scmRootAddress1" );
         scmRoots.add( scmRoot );
 
-        distributedBuildManagerStub.prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, 1, "sample", "scmRootAddress1", 1, scmRoots );
+        distributedBuildManagerStub.prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, 1, "sample",
+                                                          "scmRootAddress1", 1, scmRoots );
 
         context.assertIsSatisfied();
     }
@@ -304,10 +309,10 @@ public class DefaultDistributedBuildMana
         throws Exception
     {
         distributedBuildManagerStub.setOverallDistributedBuildQueues( getMockOverallDistributedBuildQueues( 2 ) );
-        
-        List<BuildAgentConfiguration> buildAgents = new ArrayList<BuildAgentConfiguration>();        
+
+        List<BuildAgentConfiguration> buildAgents = new ArrayList<BuildAgentConfiguration>();
         buildAgents.add( buildAgent2 );
-        
+
         setUpBuildAgentGroup( buildAgents );
         setupBuildDefinition();
 
@@ -325,9 +330,10 @@ public class DefaultDistributedBuildMana
         scmRoot.setScmRootAddress( "scmRootAddress1" );
         scmRoots.add( scmRoot );
 
-        distributedBuildManagerStub.prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, 1, "sample", "scmRootAddress", 1, scmRoots );
+        distributedBuildManagerStub.prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, 1, "sample",
+                                                          "scmRootAddress", 1, scmRoots );
     }
-    
+
     public void testGetBuildAgentPlatform()
         throws Exception
     {
@@ -346,7 +352,7 @@ public class DefaultDistributedBuildMana
 
                 exactly( 2 ).of( overallDistributedBuildQueue1 ).getDistributedBuildTaskQueueExecutor();
                 will( returnValue( distributedBuildTaskQueueExecutor ) );
-                
+
                 one( distributedBuildTaskQueueExecutor ).getCurrentTask();
                 will( returnValue( null ) );
 
@@ -384,7 +390,7 @@ public class DefaultDistributedBuildMana
         throws Exception
     {
         distributedBuildManagerStub.setCurrentRuns( getCurrentRuns() );
-        
+
         recordOfStuckScm();
 
         distributedBuildManagerStub.cancelBuild( 1 );
@@ -425,7 +431,7 @@ public class DefaultDistributedBuildMana
                 one( projectDao ).getProject( 2 );
                 will( returnValue( getProject( 2, ContinuumProjectState.OK ) ) );
             }
-        });
+        } );
     }
 
     private void recordOfStuckScm()
@@ -446,9 +452,9 @@ public class DefaultDistributedBuildMana
                 one( projectScmRootDao ).getProjectScmRoot( 1 );
                 will( returnValue( getScmRoot( ContinuumProjectState.ERROR ) ) );
             }
-        });
+        } );
     }
-    
+
     private List<ProjectRunSummary> getCurrentRuns()
     {
         List<ProjectRunSummary> runs = new ArrayList<ProjectRunSummary>();
@@ -493,30 +499,30 @@ public class DefaultDistributedBuildMana
 
     private Map<String, OverallDistributedBuildQueue> getMockOverallDistributedBuildQueues( int size )
     {
-        Map<String, OverallDistributedBuildQueue> overallDistributedBuildQueues =
-            Collections.synchronizedMap( new LinkedHashMap<String, OverallDistributedBuildQueue>() );
+        Map<String, OverallDistributedBuildQueue> overallDistributedBuildQueues = Collections.synchronizedMap(
+            new LinkedHashMap<String, OverallDistributedBuildQueue>() );
 
         buildAgents = new ArrayList<BuildAgentConfiguration>();
         buildAgents.add( buildAgent1 );
 
         overallDistributedBuildQueues.put( TEST_BUILD_AGENT1, overallDistributedBuildQueue1 );
 
-        if( size == 2 )
+        if ( size == 2 )
         {
             buildAgents.add( buildAgent2 );
             overallDistributedBuildQueues.put( TEST_BUILD_AGENT2, overallDistributedBuildQueue2 );
         }
-                
+
         return overallDistributedBuildQueues;
     }
-    
+
     private void setUpBuildAgentGroup( List<BuildAgentConfiguration> buildAgents )
     {
         buildAgentGroup = new BuildAgentGroupConfiguration();
         buildAgentGroup.setName( TEST_BUILD_AGENT_GROUP1 );
         buildAgentGroup.setBuildAgents( buildAgents );
     }
-    
+
     private void setupBuildDefinition()
     {
         Profile buildEnv1 = new Profile();
@@ -556,7 +562,7 @@ public class DefaultDistributedBuildMana
 
                 one( configurationService ).getSharedSecretPassword();
                 will( returnValue( null ) );
-                
+
                 one( configurationService ).updateBuildAgent( buildAgent1 );
                 one( configurationService ).store();
 
@@ -633,7 +639,7 @@ public class DefaultDistributedBuildMana
                 will( returnValue( project ) );
 
                 exactly( 3 ).of( projectDao ).getProjectWithDependencies( 2 );
-                will( returnValue( project2) );
+                will( returnValue( project2 ) );
 
                 exactly( 3 ).of( buildDefinitionDao ).getBuildDefinition( 1 );
                 will( returnValue( buildDefinition ) );

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java Mon Aug 13 04:29:09 2012
@@ -19,12 +19,12 @@ package org.apache.continuum.builder.dis
  * under the License.
  */
 
+import org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportService;
+
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
-import org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportService;
-
 public class SlaveBuildAgentTransportClientStub
     implements SlaveBuildAgentTransportService
 {
@@ -298,7 +298,7 @@ public class SlaveBuildAgentTransportCli
         throws Exception
     {
         // TODO Auto-generated method stub
-        
+
     }
 
 }

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/work/DefaultContinuumWorkerTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/work/DefaultContinuumWorkerTest.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/work/DefaultContinuumWorkerTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/work/DefaultContinuumWorkerTest.java Mon Aug 13 04:29:09 2012
@@ -1,8 +1,5 @@
 package org.apache.continuum.builder.distributed.work;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
 import org.apache.continuum.dao.BuildDefinitionDao;
 import org.apache.continuum.dao.BuildResultDao;
@@ -21,6 +18,9 @@ import org.jmock.Mockery;
 import org.jmock.integration.junit3.JUnit3Mockery;
 import org.jmock.lib.legacy.ClassImposteriser;
 
+import java.util.ArrayList;
+import java.util.List;
+
 public class DefaultContinuumWorkerTest
     extends PlexusInSpringTestCase
 {
@@ -115,7 +115,7 @@ public class DefaultContinuumWorkerTest
                 one( projectDao ).getProject( 2 );
                 will( returnValue( getProject( 2, ContinuumProjectState.OK ) ) );
             }
-        });
+        } );
     }
 
     private void recordOfStuckScm()
@@ -142,7 +142,7 @@ public class DefaultContinuumWorkerTest
                 one( projectScmRootDao ).getProjectScmRoot( 1 );
                 will( returnValue( getScmRoot( ContinuumProjectState.ERROR ) ) );
             }
-        });
+        } );
     }
 
     private List<ProjectRunSummary> getCurrentRuns()



Mime
View raw message