public void testBuildProjectProjectsAreAlreadyQueuedInOverallBuildQueues()
throws Exception
{
setupMockOverallBuildQueues();
BuildDefinition buildDef = new BuildDefinition();
buildDef.setId( 1 );
buildDef.setSchedule( getSchedule( 1, 1, 2 ) );
recordBuildProjectBuildQueuesAreEmpty();
buildsManager.buildProject( 1, buildDef, "continuum-project-test-1", new BuildTrigger( 1, "test-user" ), null, 1 );
context.assertIsSatisfied();
//queue second project - 1st queue is not empty, 2nd queue is empty
recordStartOfBuildProjectSequence();
// the first build queue already has a task queued
final List<Task> tasks = new ArrayList<Task>();
final List<Task> tasksOfFirstBuildQueue = new ArrayList<Task>();
tasksOfFirstBuildQueue.add(
new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", buildDef.getDescription(), null, 2 ) );
context.checking( new Expectations()
{
{
one( buildQueue ).getQueueSnapshot();
will( returnValue( tasksOfFirstBuildQueue ) );