You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by ct...@apache.org on 2009/05/17 20:00:52 UTC
svn commit: r775726 - in /continuum/branches/continuum-1.3.x:
continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/
continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/
continuum-core/sr...
Author: ctan
Date: Sun May 17 18:00:52 2009
New Revision: 775726
URL: http://svn.apache.org/viewvc?rev=775726&view=rev
Log:
[CONTINUUM-2218] fixed parallel builds manager test
Modified:
continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java
Modified: continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java?rev=775726&r1=775725&r2=775726&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java Sun May 17 18:00:52 2009
@@ -587,10 +587,7 @@
size = size + buildAgentTaskQueueManager.getProjectsInBuildQueue().size();
- for ( PrepareBuildProjectsTask task : buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue() )
- {
- size = size + task.getBuildContexts().size();
- }
+ size = size + buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue().size();
}
catch ( TaskQueueManagerException e )
{
Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java?rev=775726&r1=775725&r2=775726&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java Sun May 17 18:00:52 2009
@@ -894,8 +894,6 @@
{
whereToBeQueued = distributedBuildQueue;
size = agentBuildSize;
-
-
}
if ( agentBuildSize < size )
Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java?rev=775726&r1=775725&r2=775726&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java Sun May 17 18:00:52 2009
@@ -1176,11 +1176,7 @@
if ( tempSize < size )
{
whereToBeQueued = overallBuildQueue;
- size = taskQueue.getQueueSnapshot().size();
- if ( taskQueueExecutor.getCurrentTask() != null )
- {
- size++;
- }
+ size = tempSize;
}
idx++;
Modified: continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java?rev=775726&r1=775725&r2=775726&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java Sun May 17 18:00:52 2009
@@ -75,6 +75,10 @@
private List<Project> projects;
+ private TaskQueueExecutor buildTaskQueueExecutor;
+
+ private TaskQueueExecutor checkoutTaskQueueExecutor;
+
@Override
public void setUp()
throws Exception
@@ -109,6 +113,10 @@
projectDao = context.mock( ProjectDao.class );
buildsManager.setProjectDao( projectDao );
+
+ buildTaskQueueExecutor = context.mock( TaskQueueExecutor.class, "build-task-queue" );
+
+ checkoutTaskQueueExecutor = context.mock( TaskQueueExecutor.class, "checkout-task-queue" );
}
@Override
@@ -186,6 +194,9 @@
exactly( 2 ).of( overallBuildQueue ).getBuildQueue();
will( returnValue( buildQueue ) );
+
+ exactly( 2 ).of( overallBuildQueue ).getBuildTaskQueueExecutor();
+ will( returnValue( buildTaskQueueExecutor ) );
}} );
}
@@ -199,8 +210,11 @@
context.checking( new Expectations()
{
{
- exactly( 3 ).of( buildQueue ).getQueueSnapshot();
+ exactly( 2 ).of( buildQueue ).getQueueSnapshot();
will( returnValue( tasks ) );
+
+ exactly( 2 ).of( buildTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_2" ) );
@@ -234,6 +248,9 @@
exactly( 2 ).of( overallBuildQueue ).getCheckoutQueue();
will( returnValue( checkoutQueue ) );
+
+ exactly( 2 ).of( overallBuildQueue ).getCheckoutTaskQueueExecutor();
+ will( returnValue( checkoutTaskQueueExecutor ) );
}} );
}
@@ -247,9 +264,12 @@
context.checking( new Expectations()
{
{
- exactly( 3 ).of( checkoutQueue ).getQueueSnapshot();
+ exactly( 2 ).of( checkoutQueue ).getQueueSnapshot();
will( returnValue( tasks ) );
+ exactly( 2 ).of( checkoutTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_2" ) );
}} );
@@ -320,13 +340,16 @@
context.checking( new Expectations()
{
{
- exactly( 2 ).of( buildQueue ).getQueueSnapshot();
+ one( buildQueue ).getQueueSnapshot();
will( returnValue( tasksOfFirstBuildQueue ) );
// the second build queue has no tasks queued, so it should return 0
- exactly( 2 ).of( buildQueue ).getQueueSnapshot();
+ one( buildQueue ).getQueueSnapshot();
will( returnValue( tasks ) );
+ exactly( 2 ).of( buildTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_3" ) );
}} );
@@ -343,9 +366,12 @@
context.checking( new Expectations()
{
{
- exactly( 3 ).of( buildQueue ).getQueueSnapshot();
+ exactly( 2 ).of( buildQueue ).getQueueSnapshot();
will( returnValue( tasksOfFirstBuildQueue ) );
+ exactly( 2 ).of( buildTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_2" ) );
}} );
@@ -440,12 +466,15 @@
context.checking( new Expectations()
{
{
- exactly( 2 ).of( checkoutQueue ).getQueueSnapshot();
+ one( checkoutQueue ).getQueueSnapshot();
will( returnValue( tasksInFirstCheckoutQueue ) );
- exactly( 2 ).of( checkoutQueue ).getQueueSnapshot();
+ one( checkoutQueue ).getQueueSnapshot();
will( returnValue( tasks ) );
+ exactly( 2 ).of( checkoutTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_3" ) );
}} );
@@ -463,9 +492,12 @@
context.checking( new Expectations()
{
{
- exactly( 3 ).of( checkoutQueue ).getQueueSnapshot();
+ exactly( 2 ).of( checkoutQueue ).getQueueSnapshot();
will( returnValue( tasksInFirstCheckoutQueue ) );
+ exactly( 2 ).of( checkoutTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_2" ) );
}} );
@@ -649,9 +681,15 @@
exactly( 2 ).of( overallBuildQueue ).getBuildQueue();
will( returnValue( buildQueue ) );
- exactly( 3 ).of( buildQueue ).getQueueSnapshot();
+ exactly( 2 ).of( overallBuildQueue ).getBuildTaskQueueExecutor();
+ will( returnValue( buildQueueExecutor ) );
+
+ exactly( 2 ).of( buildQueue ).getQueueSnapshot();
will( returnValue( tasks ) );
+ exactly( 2 ).of( buildQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_2" ) );
@@ -671,9 +709,15 @@
exactly( 2 ).of( overallBuildQueue ).getCheckoutQueue();
will( returnValue( checkoutQueue ) );
- exactly( 3 ).of( checkoutQueue ).getQueueSnapshot();
+ exactly( 2 ).of( overallBuildQueue ).getCheckoutTaskQueueExecutor();
+ will( returnValue( checkoutQueueExecutor ) );
+
+ exactly( 2 ).of( checkoutQueue ).getQueueSnapshot();
will( returnValue( tasks ) );
+ exactly( 2 ).of( checkoutQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_2" ) );