Package org.apache.continuum.taskqueue

Examples of org.apache.continuum.taskqueue.BuildProjectTask


    public void testIsInBuildQueue()
        throws Exception
    {
        final TaskQueue buildQueue = context.mock( TaskQueue.class, "build-queue" );
        final List<Task> tasks = new ArrayList<Task>();
        tasks.add( new BuildProjectTask( 2, 1, 1, "continuum-project-test-2", "BUILD_DEF" ) );

        context.checking( new Expectations()
        {
            {
                one( buildTaskQueueExecutor ).getQueue();
View Full Code Here


    }

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

        context.checking( new Expectations()
        {
            {
                one( buildTaskQueueExecutor ).getCurrentTask();
View Full Code Here

    }

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

        context.checking( new Expectations()
        {
            {
                one( buildTaskQueueExecutor ).getCurrentTask();
View Full Code Here

    }

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

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

    // ----------------------------------------------------------------------

    private void buildProject( int projectId, int trigger )
        throws Exception
    {
        buildQueue.put( new BuildProjectTask( projectId, 0, trigger, null, null ) );
    }
View Full Code Here

    {
        Task task = buildQueue.take();

        assertEquals( BuildProjectTask.class.getName(), task.getClass().getName() );

        BuildProjectTask buildProjectTask = (BuildProjectTask) task;

        assertEquals( "Didn't get the expected project id.", expectedProjectId, buildProjectTask.getProjectId() );
    }
View Full Code Here

    {
        Map<String, Task> currentBuilds = getContinuum().getBuildsManager().getCurrentBuilds();
        Set<String> keySet = currentBuilds.keySet();
        for( String key : keySet )
        {
            BuildProjectTask buildProjectTask = (BuildProjectTask) currentBuilds.get( key );
            if ( buildProjectTask != null && buildResult != null )
            {
                return !( buildResult.getState() == ContinuumProjectState.BUILDING && ( buildProjectTask
                    .getBuildDefinitionId() == buildResult.getBuildDefinition().getId() && buildProjectTask.getProjectId() == this.getProjectId() ) );
            }
        }
        return true;
    }
View Full Code Here

        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, 1, "continuum-project-test-2", buildDef.getDescription() ) );       
        context.checking( new Expectations()
        {
            {
                exactly(2).of( buildQueue ).getQueueSnapshot();
                will( returnValue( tasksOfFirstBuildQueue ) );
View Full Code Here

        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 BuildProjectTask2, 1, 1, "continuum-project-test-2", "BUILD_DEF" ) );
       
        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

        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, 1, "continuum-project-test-1", "BUILD_DEF" );

        final List<Task> buildTasks = new ArrayList<Task>();
        buildTasks.add( new BuildProjectTask2, 1, 1, "continuum-project-test-2", "BUILD_DEF" ) );
       
        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

TOP

Related Classes of org.apache.continuum.taskqueue.BuildProjectTask

Copyright © 2018 www.massapicom. 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.