continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r725959 [2/2] - in /continuum/branches/continuum-parallel-builds: continuum-api/src/main/java/org/apache/continuum/buildmanager/ continuum-api/src/main/java/org/apache/continuum/taskqueue/ continuum-api/src/main/java/org/apache/continuum/ta...
Date Fri, 12 Dec 2008 10:31:39 GMT
Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java?rev=725959&r1=725958&r2=725959&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java
Fri Dec 12 02:31:37 2008
@@ -68,7 +68,7 @@
         assertEquals( "continuum-test-project", queuedTask.getProjectName() );
     }
     
-    public void testAddToPrepareBuildQueue()
+    /*public void testAddToPrepareBuildQueue()
         throws Exception
     {
         Map<Integer, Integer> projectsBuildDefMap = new HashMap<Integer, Integer>();
@@ -80,5 +80,5 @@
         PrepareBuildProjectsTask queuedTask = ( PrepareBuildProjectsTask ) overallQueue.getPrepareBuildQueue().take();
         assertNotNull( queuedTask );
         assertEquals( 1, ( ( Integer )queuedTask.getProjectsBuildDefinitionsMap().get( new
Integer( 1 ) ) ).intValue() );        
-    }
+    }*/
 }

Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java?rev=725959&r1=725958&r2=725959&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
Fri Dec 12 02:31:37 2008
@@ -26,6 +26,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.continuum.buildmanager.BuildsManager;
 import org.apache.continuum.model.release.ContinuumReleaseResult;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.repository.RepositoryService;
@@ -353,7 +354,9 @@
         Continuum continuum = (Continuum) lookup( Continuum.ROLE );
 
         TaskQueueManager taskQueueManager = (TaskQueueManager) lookup( TaskQueueManager.ROLE
);
-
+        
+        BuildsManager parallelBuildsManager = (BuildsManager) lookup( BuildsManager.class,
"parallel" );
+        
         String url = getTestFile( "src/test-projects/project1/pom.xml" ).toURL().toExternalForm();
 
         ContinuumProjectBuildingResult result = continuum.addMavenTwoProject( url );
@@ -368,11 +371,13 @@
 
         Project project = (Project) projects.get( 0 );
 
-        assertTrue( "project missing from the checkout queue",
+        /*assertTrue( "project missing from the checkout queue",
+                    parallelBuildsManager.removeProjectFromCheckoutQueue( project.getId()
) );*/
+        /*assertTrue( "project missing from the checkout queue",
                     taskQueueManager.removeProjectFromCheckoutQueue( project.getId() ) );
 
         assertFalse( "project still exist on the checkout queue",
-                     taskQueueManager.removeProjectFromCheckoutQueue( project.getId() ) );
+                     taskQueueManager.removeProjectFromCheckoutQueue( project.getId() ) );*/
     }
 
     public void testAddAntProjectWithdefaultBuildDef()
@@ -480,6 +485,4 @@
     {
         return (Continuum) lookup( Continuum.ROLE );
     }
-
-
 }

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java?rev=725959&r1=725958&r2=725959&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java
Fri Dec 12 02:31:37 2008
@@ -22,8 +22,7 @@
 import java.util.List;
 
 import org.apache.commons.lang.ArrayUtils;
-import org.apache.continuum.taskqueue.manager.TaskQueueManager;
-import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.continuum.buildmanager.BuildsManager;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.web.action.admin.AbstractBuildQueueAction;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
@@ -77,15 +76,9 @@
             projectsId = ArrayUtils.add( projectsId, projectId );
         }
 
-        TaskQueueManager taskQueueManager = getContinuum().getTaskQueueManager();
-        try
-        {
-            taskQueueManager.removeProjectsFromBuildingQueue( projectsId );
-        }
-        catch ( TaskQueueManagerException e )
-        {
-            throw new ContinuumException( "Unable to remove projects from building queue",
e );
-        }
+        BuildsManager parallelBuildsManager = getContinuum().getBuildsManager();
+        parallelBuildsManager.removeProjectsFromBuildQueue( projectsId );           
+        
         // now we must check if the current build is one of this
         int index = ArrayUtils.indexOf( projectsId, getCurrentProjectIdBuilding() );
         if ( index > 0 )

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?rev=725959&r1=725958&r2=725959&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
Fri Dec 12 02:31:37 2008
@@ -19,10 +19,10 @@
  * under the License.
  */
 
+import org.apache.continuum.buildmanager.BuildManagerException;
+import org.apache.continuum.buildmanager.BuildsManager;
 import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.continuum.model.repository.LocalRepository;
-import org.apache.continuum.taskqueue.manager.TaskQueueManager;
-import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
@@ -84,7 +84,12 @@
     /**
      * @plexus.requirement
      */
-    private TaskQueueManager taskQueueManager;
+    //private TaskQueueManager taskQueueManager;
+    
+    /**
+     * @plexus.requirement role-hint="parallel"
+     */
+    private BuildsManager parallelBuildsManager;
 
     private int projectGroupId;
 
@@ -347,15 +352,20 @@
                 Project p = (Project) proj.next();
                 try
                 {
-                    if ( taskQueueManager.isInCheckoutQueue( p.getId() ) )
+                    //if ( taskQueueManager.isInCheckoutQueue( p.getId() ) )
+                    if ( parallelBuildsManager.isInAnyCheckoutQueue( p.getId() ) )
                     {
                         projectInCOQueue = true;
                     }
                 }
-                catch ( TaskQueueManagerException e )
+                catch ( BuildManagerException e )
                 {
                     throw new ContinuumException( e.getMessage(), e );
                 }
+                /*catch ( TaskQueueManagerException e )
+                {
+                    throw new ContinuumException( e.getMessage(), e );
+                }*/
                 projects.put( p, new Integer( p.getProjectGroup().getId() ) );
             }
         }

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java?rev=725959&r1=725958&r2=725959&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
Fri Dec 12 02:31:37 2008
@@ -19,8 +19,8 @@
  * under the License.
  */
 
-import org.apache.continuum.taskqueue.manager.TaskQueueManager;
-import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.continuum.buildmanager.BuildManagerException;
+import org.apache.continuum.buildmanager.BuildsManager;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
@@ -58,8 +58,13 @@
     /**
      * @plexus.requirement
      */
-    private TaskQueueManager taskQueueManager;
-
+    //private TaskQueueManager taskQueueManager;
+    
+    /**
+     * @plexus.requirement role-hint="parallel"
+     */
+    private BuildsManager parallelBuildsManager;
+    
     public String execute()
         throws ContinuumException
     {
@@ -111,11 +116,13 @@
 
             try
             {
-                if ( taskQueueManager.isInBuildingQueue( project.getId() ) )
+                //if ( taskQueueManager.isInBuildingQueue( project.getId() ) )
+                if ( parallelBuildsManager.isInAnyBuildQueue( project.getId() ) )
                 {
                     model.setInBuildingQueue( true );
                 }
-                else if ( taskQueueManager.isInCheckoutQueue( project.getId() ) )
+                //else if ( taskQueueManager.isInCheckoutQueue( project.getId() ) )
+                else if ( parallelBuildsManager.isInAnyCheckoutQueue( project.getId() ) )
                 {
                     model.setInCheckoutQueue( true );
                 }
@@ -125,10 +132,14 @@
                     model.setInCheckoutQueue( false );
                 }
             }
-            catch ( TaskQueueManagerException e )
+            catch ( BuildManagerException e )
             {
                 throw new ContinuumException( e.getMessage(), e );
             }
+            /*catch ( TaskQueueManagerException e )
+            {
+                throw new ContinuumException( e.getMessage(), e );
+            }*/
 
             model.setState( project.getState() );
 

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java?rev=725959&r1=725958&r2=725959&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
Fri Dec 12 02:31:37 2008
@@ -22,6 +22,7 @@
 import java.util.List;
 
 import org.apache.commons.lang.ArrayUtils;
+import org.apache.continuum.buildmanager.BuildsManager;
 import org.apache.continuum.taskqueue.manager.TaskQueueManager;
 import org.apache.maven.continuum.buildqueue.BuildProjectTask;
 import org.apache.maven.continuum.model.project.Project;
@@ -48,6 +49,9 @@
     implements SecureAction, LogEnabled
 {
     
+    // TODO: deng - parallel builds
+    // see TODO comments below!!!
+    
     /**
      * @plexus.requirement role-hint='build-project'
      */
@@ -82,6 +86,11 @@
      * @plexus.requirement
      */
     private TaskQueueManager taskQueueManager;
+    
+    /**
+     * @plexus.requirement role-hint="parallel"
+     */
+    private BuildsManager parallelBuildsManager;
 
     // -----------------------------------------------------
     //  webwork
@@ -155,8 +164,13 @@
     public String display()
         throws Exception
     {
+        // TODO: deng parallel builds
+        // - need to get all the build queues and their current tasks
+        // - need to get all the build queues and their queued tasks
+                
         this.setCurrentBuildProjectTask( (BuildProjectTask) taskQueueExecutor.getCurrentTask()
);        
         this.setBuildProjectTasks( taskQueueManager.getProjectsInBuildQueue() );
+        
         this.setCurrentCheckOutTask( (CheckOutTask) checkoutTaskQueueExecutor.getCurrentTask()
);
         this.setCurrentCheckOutTasks( taskQueueManager.getCheckOutTasksInQueue() );
         return SUCCESS;
@@ -180,7 +194,8 @@
             return REQUIRES_AUTHENTICATION;
         }
         
-        taskQueueManager.removeFromBuildingQueue( projectId, buildDefinitionId, trigger,
projectName );
+        //taskQueueManager.removeFromBuildingQueue( projectId, buildDefinitionId, trigger,
projectName );
+        parallelBuildsManager.removeProjectFromBuildQueue( projectId, buildDefinitionId,
trigger, projectName );
         Project project = getContinuum().getProject( projectId );
         project.setState( project.getOldState() );
         getContinuum().updateProject( project );
@@ -206,6 +221,8 @@
             return REQUIRES_AUTHENTICATION;
         }
         
+        // TODO: deng parallel builds
+        // - implement delete with hashcodes in parallel builds manager! how to do this???
         taskQueueManager.removeProjectsFromBuildingQueueWithHashCodes( listToIntArray(this.getSelectedBuildTaskHashCodes())
);
         return SUCCESS;
     }
@@ -228,6 +245,8 @@
             return REQUIRES_AUTHENTICATION;
         }
         
+     // TODO: deng parallel builds
+        // - implement delete with hashcodes in parallel builds manager! how to do this???
         taskQueueManager
             .removeTasksFromCheckoutQueueWithHashCodes( listToIntArray( this.getSelectedCheckOutTaskHashCodes()
) );
         return SUCCESS;

Modified: continuum/branches/continuum-parallel-builds/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java?rev=725959&r1=725958&r2=725959&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
Fri Dec 12 02:31:37 2008
@@ -21,6 +21,9 @@
 
 import net.sf.dozer.util.mapping.DozerBeanMapperSingletonWrapper;
 import net.sf.dozer.util.mapping.MapperIF;
+
+import org.apache.continuum.buildmanager.BuildManagerException;
+import org.apache.continuum.buildmanager.BuildsManager;
 import org.apache.continuum.dao.SystemConfigurationDao;
 import org.apache.continuum.purge.ContinuumPurgeManagerException;
 import org.apache.continuum.purge.PurgeConfigurationServiceException;
@@ -98,6 +101,11 @@
      * @plexus.requirement
      */
     private TaskQueueManager taskQueueManager;
+    
+    /**
+     * @plexus.requirement role-hint="parallel"
+     */
+    private BuildsManager parallelBuildsManager;
 
     public boolean ping()
         throws ContinuumException
@@ -1045,12 +1053,17 @@
     {
         try
         {
-            return taskQueueManager.isInBuildingQueue( projectId );
+            return parallelBuildsManager.isInAnyBuildQueue( projectId );
+            //return taskQueueManager.isInBuildingQueue( projectId );
         }
-        catch ( TaskQueueManagerException e )
+        catch ( BuildManagerException e )
         {
             throw new ContinuumException( e.getMessage(), e );
         }
+        /*catch ( TaskQueueManagerException e )
+        {
+            throw new ContinuumException( e.getMessage(), e );
+        }*/
     }
 
     public List<BuildProjectTask> getProjectsInBuildQueue()
@@ -1058,6 +1071,8 @@
     {
         try
         {
+            //TODO: deng parallel builds
+            // implement this!
             return populateBuildProjectTaskList( taskQueueManager.getProjectsInBuildQueue()
);
         }
         catch ( TaskQueueManagerException e )
@@ -1070,14 +1085,10 @@
         throws ContinuumException
     {
         checkManageQueuesAuthorization();
-        try
-        {
-            taskQueueManager.removeProjectsFromBuildingQueue( projectsId );
-        }
-        catch ( TaskQueueManagerException e )
-        {
-            throw new ContinuumException( e.getMessage(), e );
-        }
+        
+        parallelBuildsManager.removeProjectsFromBuildQueue( projectsId );
+        //taskQueueManager.removeProjectsFromBuildingQueue( projectsId );
+        
         return 0;
     }
 
@@ -1087,6 +1098,8 @@
         checkManageQueuesAuthorization();
         try
         {
+            // TODO: deng parallel builds
+            // - implement this in BuildsManager!
             return taskQueueManager.cancelCurrentBuild();
         }
         catch ( TaskQueueManagerException e )



Mime
View raw message