continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r771177 [2/2] - in /continuum/branches/continuum-1.3.x/continuum-core/src: main/java/org/apache/maven/continuum/ main/java/org/apache/maven/continuum/buildcontroller/ main/java/org/apache/maven/continuum/core/action/ main/java/org/apache/ma...
Date Mon, 04 May 2009 05:02:39 GMT
Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
Mon May  4 05:02:26 2009
@@ -34,6 +34,9 @@
 import org.apache.continuum.utils.ContinuumUtils;
 import org.apache.continuum.utils.ProjectSorter;
 import org.apache.maven.continuum.core.action.AbstractContinuumAction;
+import org.apache.maven.continuum.core.action.CheckWorkingDirectoryAction;
+import org.apache.maven.continuum.core.action.CheckoutProjectContinuumAction;
+import org.apache.maven.continuum.core.action.UpdateWorkingDirectoryFromScmContinuumAction;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
@@ -50,7 +53,6 @@
 import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
 import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.dag.CycleDetectedException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -192,31 +194,31 @@
             {
                 if ( projectScmUrl.contains( projectScmRoot.getScmRootAddress() ) )
                 {
-                    context.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT, projectScmRoot
);
+                    AbstractContinuumAction.setProjectScmRoot( context, projectScmRoot );
                     break;
                 }
             }
 
-            context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, projectGroup.getId()
);
-            context.put( AbstractContinuumAction.KEY_PROJECT_ID, projectId );
-            context.put( AbstractContinuumAction.KEY_PROJECT, project );
-
-            context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION_ID, buildDefinitionId
);
-            context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION,
-                         buildDefinitionDao.getBuildDefinition( buildDefinitionId ) );
+            AbstractContinuumAction.setProjectGroupId( context, projectGroup.getId() );
+            AbstractContinuumAction.setProjectId( context, projectId );
+            AbstractContinuumAction.setProject( context, project );
+
+            AbstractContinuumAction.setBuildDefinitionId( context, buildDefinitionId );
+            AbstractContinuumAction.setBuildDefinition( context,
+                                                        buildDefinitionDao.getBuildDefinition(
buildDefinitionId ) );
 
             BuildResult oldBuildResult =
                 buildResultDao.getLatestBuildResultForBuildDefinition( projectId, buildDefinitionId
);
 
             if ( oldBuildResult != null )
             {
-                context.put( AbstractContinuumAction.KEY_OLD_SCM_RESULT,
-                             getOldScmResults( projectId, oldBuildResult.getBuildNumber(),
-                                               oldBuildResult.getEndTime() ) );
+                AbstractContinuumAction.setOldScmResult( context,
+                                                         getOldScmResults( projectId, oldBuildResult.getBuildNumber(),
+                                                                           oldBuildResult.getEndTime()
) );
             }
             else
             {
-                context.put( AbstractContinuumAction.KEY_OLD_SCM_RESULT, null );
+                AbstractContinuumAction.setOldScmResult( context, null );
             }
         }
         catch ( ContinuumStoreException e )
@@ -238,8 +240,7 @@
     {
         performAction( "check-working-directory", context );
 
-        boolean workingDirectoryExists =
-            AbstractContinuumAction.getBoolean( context, AbstractContinuumAction.KEY_WORKING_DIRECTORY_EXISTS
);
+        boolean workingDirectoryExists = CheckWorkingDirectoryAction.isWorkingDirectoryExist(
context );
 
         ScmResult scmResult;
 
@@ -247,21 +248,21 @@
         {
             performAction( "update-working-directory-from-scm", context );
 
-            scmResult = AbstractContinuumAction.getUpdateScmResult( context );
+            scmResult = UpdateWorkingDirectoryFromScmContinuumAction.getUpdateScmResult(
context );
         }
         else
         {
             Project project = AbstractContinuumAction.getProject( context );
 
-            context.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY,
-                         workingDirectoryService.getWorkingDirectory( project ).getAbsolutePath()
);
+            AbstractContinuumAction.setWorkingDirectory( context, workingDirectoryService.getWorkingDirectory(
+                project ).getAbsolutePath() );
 
             performAction( "checkout-project", context );
 
-            scmResult = AbstractContinuumAction.getCheckoutResult( context, null );
+            scmResult = CheckoutProjectContinuumAction.getCheckoutResult( context, null );
         }
 
-        context.put( AbstractContinuumAction.KEY_SCM_RESULT, scmResult );
+        AbstractContinuumAction.setScmResult( context, scmResult );
     }
 
     private boolean checkProjectScmRoot( Map<String, Object> context )
@@ -385,7 +386,7 @@
         {
             if ( newScmResult == null )
             {
-                context.put( AbstractContinuumAction.KEY_SCM_RESULT, oldScmResult );
+                AbstractContinuumAction.setScmResult( context, oldScmResult );
             }
             else
             {
@@ -432,7 +433,7 @@
 
         result.setException( ContinuumUtils.throwableToString( exception ) );
 
-        context.put( AbstractContinuumAction.KEY_SCM_RESULT, result );
+        AbstractContinuumAction.setScmResult( context, result );
 
         throw exception;
     }
@@ -491,7 +492,7 @@
 
             projectScmRootDao.updateProjectScmRoot( projectScmRoot );
 
-            context.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT, projectScmRoot );
+            AbstractContinuumAction.setProjectScmRoot( context, projectScmRoot );
         }
         catch ( ContinuumStoreException e )
         {
@@ -557,10 +558,10 @@
         try
         {
             Map<String, Object> context = new HashMap<String, Object>();
-            context.put( AbstractContinuumAction.KEY_PROJECTS, projectsToBeBuilt );
-            context.put( AbstractContinuumAction.KEY_PROJECTS_BUILD_DEFINITIONS_MAP, projectsBuildDefinitionsMap
);
-            context.put( AbstractContinuumAction.KEY_TRIGGER, trigger );
-            context.put( AbstractContinuumAction.KEY_SCM_RESULT_MAP, scmResultMap );
+            AbstractContinuumAction.setListOfProjects( context, projectsToBeBuilt );
+            AbstractContinuumAction.setProjectsBuildDefinitionsMap( context, projectsBuildDefinitionsMap
);
+            AbstractContinuumAction.setTrigger( context, trigger );
+            AbstractContinuumAction.setScmResultMap( context, scmResultMap );
 
             log.info( "Performing action create-build-project-task" );
             actionManager.lookup( "create-build-project-task" ).execute( context );

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutorTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutorTest.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutorTest.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutorTest.java
Mon May  4 05:02:26 2009
@@ -227,9 +227,9 @@
 
         Map<String, Object> pgContext = new HashMap<String, Object>();
 
-        pgContext.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, project.getWorkingDirectory()
);
+        AbstractContinuumAction.setWorkingDirectory( pgContext, project.getWorkingDirectory()
);
 
-        pgContext.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT_GROUP, projectGroup
);
+        AbstractContinuumAction.setUnvalidatedProjectGroup( pgContext, projectGroup );
 
         actionManager.lookup( "validate-project-group" ).execute( pgContext );
 

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java
Mon May  4 05:02:26 2009
@@ -91,16 +91,14 @@
         throws Exception
     {
         Map<String, Object> context = new HashMap<String, Object>();
-        context.put( CreateProjectsFromMetadataAction.KEY_URL,
-                     "http://svn.apache.org/repos/asf/maven/continuum/trunk/pom.xml" );
-        context.put( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDER_ID, "id" );
-        context.put( CreateProjectsFromMetadataAction.KEY_LOAD_RECURSIVE_PROJECTS, true );
+        CreateProjectsFromMetadataAction.setUrl( context,
+                                                 "http://svn.apache.org/repos/asf/maven/continuum/trunk/pom.xml"
);
+        CreateProjectsFromMetadataAction.setProjectBuilderId( context, "id" );
+        CreateProjectsFromMetadataAction.setLoadRecursiveProject( context, true );
 
         action.execute( context );
 
-        ContinuumProjectBuildingResult result =
-            (ContinuumProjectBuildingResult) context.get( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDING_RESULT
)
-            ;
+        ContinuumProjectBuildingResult result = CreateProjectsFromMetadataAction.getProjectBuildingResult(
context );
 
         assertFalse(
             "Should not have errors but had " + result.getErrorsAsString() + " (this test
requires internet access)",
@@ -111,16 +109,14 @@
         throws Exception
     {
         Map<String, Object> context = new HashMap<String, Object>();
-        context.put( CreateProjectsFromMetadataAction.KEY_URL,
-                     "http://svn.apache.org/repos/asf/maven/archiva/trunk/pom.xml" );
-        context.put( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDER_ID, "id" );
-        context.put( CreateProjectsFromMetadataAction.KEY_LOAD_RECURSIVE_PROJECTS, false
);
+        CreateProjectsFromMetadataAction.setUrl( context,
+                                                 "http://svn.apache.org/repos/asf/maven/archiva/trunk/pom.xml"
);
+        CreateProjectsFromMetadataAction.setProjectBuilderId( context, "id" );
+        CreateProjectsFromMetadataAction.setLoadRecursiveProject( context, false );
 
         action.execute( context );
 
-        ContinuumProjectBuildingResult result =
-            (ContinuumProjectBuildingResult) context.get( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDING_RESULT
)
-            ;
+        ContinuumProjectBuildingResult result = CreateProjectsFromMetadataAction.getProjectBuildingResult(
context );
 
         assertFalse(
             "Should not have errors but had " + result.getErrorsAsString() + " (this test
requires internet access)",



Mime
View raw message