Examples of BuildTrigger


Examples of org.apache.continuum.utils.build.BuildTrigger

    }

    public void testRemoveProjectFromBuildQueue()
        throws Exception
    {
      final Task buildTask = new BuildProjectTask( 1, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 1 );

        final TaskQueue buildQueue = context.mock( TaskQueue.class, "build-queue" );
        final List<Task> tasks = new ArrayList<Task>();
        tasks.add( buildTask );
View Full Code Here

Examples of org.apache.continuum.utils.build.BuildTrigger

                will( returnValue( true ) );
            }} );

        try
        {
          continuum.buildProjectGroup( 1, new BuildTrigger( 1, "test-user" ) );
            fail( "An exception should have been thrown." );
        }
        catch ( ContinuumException e )
        {
            assertEquals( "Cannot build project group. Project (id=1) in group is currently in release stage.",
View Full Code Here

Examples of org.apache.continuum.utils.build.BuildTrigger

        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();
    }
View Full Code Here

Examples of org.apache.continuum.utils.build.BuildTrigger

        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 ) );

                // the second build queue has no tasks queued, so it should return 0
                one( buildQueue ).getQueueSnapshot();
                will( returnValue( tasks ) );

                exactly( 2 ).of( buildTaskQueueExecutor ).getCurrentTask();
                will( returnValue( null ) );

                one( overallBuildQueue ).getName();
                will( returnValue( "BUILD_QUEUE_3" ) );
            }} );

        recordAddToBuildQueue();

        buildsManager.buildProject( 2, buildDef, "continuum-project-test-2", new BuildTrigger( 1, "test-user" ), null, 2 );
        context.assertIsSatisfied();

        // queue third project - both queues have 1 task queued each
        recordStartOfBuildProjectSequence();

        // both queues have 1 task each       
        context.checking( new Expectations()
        {
            {
                exactly( 2 ).of( buildQueue ).getQueueSnapshot();
                will( returnValue( tasksOfFirstBuildQueue ) );

                exactly( 2 ).of( buildTaskQueueExecutor ).getCurrentTask();
                will( returnValue( null ) );
               
                one( overallBuildQueue ).getName();
                will( returnValue( "BUILD_QUEUE_2" ) );
            }} );

        recordAddToBuildQueue();

        buildsManager.buildProject( 3, buildDef, "continuum-project-test-3", new BuildTrigger( 1, "test-user" ), null, 3 );
        context.assertIsSatisfied();
    }
View Full Code Here

Examples of org.apache.continuum.utils.build.BuildTrigger

        final TaskQueueExecutor buildQueueExecutor = context.mock( TaskQueueExecutor.class, "build-queue-executor" );
        final TaskQueueExecutor checkoutQueueExecutor =
            context.mock( TaskQueueExecutor.class, "checkout-queue-executor" );

        final List<Task> buildTasks = new ArrayList<Task>();
        buildTasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 ) );

        final List<CheckOutTask> checkoutTasks = new ArrayList<CheckOutTask>();
        checkoutTasks.add(
            new CheckOutTask( 2, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-2",
                              "dummy", "dummypass" ) );
View Full Code Here

Examples of org.apache.continuum.utils.build.BuildTrigger

        final BuildDefinition buildDef = new BuildDefinition();
        buildDef.setId( 1 );
        buildDef.setSchedule( getSchedule( 1, 1, 2 ) );

        final TaskQueueExecutor buildQueueExecutor = context.mock( TaskQueueExecutor.class, "build-queue-executor" );
        final Task buildTask = new BuildProjectTask( 1, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-1", "BUILD_DEF", null, 1 );

        final List<BuildProjectTask> buildTasks = new ArrayList<BuildProjectTask>();
        buildTasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 ) );

        final List<CheckOutTask> checkoutTasks = new ArrayList<CheckOutTask>();
        checkoutTasks.add(
            new CheckOutTask( 2, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-2",
                              "dummy", "dummypass" ) );
View Full Code Here

Examples of org.apache.continuum.utils.build.BuildTrigger

                will( returnValue( ConfigurationService.DEFAULT_BUILD_QUEUE_NAME ) );

                one( overallBuildQueue ).addToBuildQueue( with( any( BuildProjectTask.class ) ) );
            }} );

        buildsManager.buildProject( 1, buildDef, "continuum-project-test-1", new BuildTrigger( 1, "test-user" ), null, 1 );
        context.assertIsSatisfied();
    }
View Full Code Here

Examples of org.apache.continuum.utils.build.BuildTrigger

        throws Exception
    {
        setupMockOverallBuildQueues();

        final List<Task> tasks = new ArrayList<Task>();
        tasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, ) );

        context.checking( new Expectations()
        {
            {
                exactly( 5 ).of( overallBuildQueue ).getName();
View Full Code Here

Examples of org.apache.continuum.utils.build.BuildTrigger

        List<Project> projects = AbstractContinuumAction.getListOfProjects( context );
        Map<Integer, BuildDefinition> projectsBuildDefinitionsMap =
            AbstractContinuumAction.getProjectsBuildDefinitionsMap( context );
        Map<Integer, ScmResult> scmResultMap = AbstractContinuumAction.getScmResultMap( context );
        List<Project> projectsToBeBuilt = new ArrayList<Project>();
        BuildTrigger buildTrigger = AbstractContinuumAction.getBuildTrigger( context );
        int projectGroupId = AbstractContinuumAction.getProjectGroupId( context );

        // update state of each project first
        for ( Project project : projects )
        {
View Full Code Here

Examples of org.apache.continuum.utils.build.BuildTrigger

        throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
    {
        ProjectSummary ps = getProjectSummary( projectId );
        checkBuildProjectInGroupAuthorization( ps.getProjectGroup().getName() );

        continuum.buildProject( projectId, new BuildTrigger( ContinuumProjectState.TRIGGER_SCHEDULED, "" ) );
        return 0;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.