Examples of PrepareBuildProjectsTask


Examples of org.apache.continuum.buildagent.taskqueue.PrepareBuildProjectsTask

    public boolean isProjectGroupCurrentlyPreparingBuild( int projectGroupId )
    {
        try
        {
            log.debug( "Checking if project group {} currently preparing build", projectGroupId );
            PrepareBuildProjectsTask currentPrepareBuildTask =
                buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild();

            if ( currentPrepareBuildTask != null && currentPrepareBuildTask.getProjectGroupId() == projectGroupId )
            {
                return true;
            }
        }
        catch ( TaskQueueManagerException e )
View Full Code Here

Examples of org.apache.continuum.buildagent.taskqueue.PrepareBuildProjectsTask

    {
        try
        {
            log.debug( "Checking if projectId={}, buildDefinitionId={} currently preparing build", projectId,
                       buildDefinitionId );
            PrepareBuildProjectsTask currentPrepareBuildTask =
                buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild();

            if ( currentPrepareBuildTask != null )
            {
                for ( BuildContext context : currentPrepareBuildTask.getBuildContexts() )
                {
                    if ( context.getProjectId() == projectId &&
                        ( buildDefinitionId == -1 || context.getBuildDefinitionId() == buildDefinitionId ) )
                    {
                        log.debug( "projectId={}, buildDefinitionId={} is currently preparing build" );
View Full Code Here

Examples of org.apache.continuum.buildagent.taskqueue.PrepareBuildProjectsTask

        throws ContinuumBuildAgentException
    {
        if ( buildContexts != null && buildContexts.size() > 0 )
        {
            BuildContext context = buildContexts.get( 0 );
            return new PrepareBuildProjectsTask( buildContexts, new BuildTrigger( context.getTrigger(),
                                                                                  context.getUsername() ),
                                                 context.getProjectGroupId(), context.getScmRootAddress(),
                                                 context.getScmRootId() );
        }
        else
View Full Code Here

Examples of org.apache.continuum.taskqueue.PrepareBuildProjectsTask

    }

    public void executeTask( Task task )
        throws TaskExecutionException
    {
        PrepareBuildProjectsTask prepareBuildTask = (PrepareBuildProjectsTask) task;

        try
        {
            SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );

            log.info( "initializing buildContext" );
            List<Map<String, Object>> buildContext =
                initializeBuildContext( prepareBuildTask.getProjectsBuildDefinitionsMap(),
                                        prepareBuildTask.getTrigger(), prepareBuildTask.getScmRootAddress(),
                                        prepareBuildTask.getProjectScmRootId() );

            startTime = System.currentTimeMillis();
            client.buildProjects( buildContext );
            endTime = System.currentTimeMillis();
        }
View Full Code Here

Examples of org.apache.continuum.taskqueue.PrepareBuildProjectsTask

    }

    public void testCheckoutPrepareBuildMultiModuleProject()
        throws Exception
    {
        PrepareBuildProjectsTask task = createTask( "src/test-projects/multi-module/pom.xml", false, false );

        this.prepareBuildQueue.put( task );

        List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId() );

        assertEquals( "failed to add all projects", 3, projects.size() );

        Project rootProject = getProjectDao().getProjectByName( "multi-module-parent" );
        Project moduleA = getProjectDao().getProjectByName( "module-A" );
        Project moduleB = getProjectDao().getProjectByName( "module-B" );

        // wait while task finishes prepare build
        while( !prepareBuildQueue.getQueueSnapshot().isEmpty() ||
                        prepareBuildTaskQueueExecutor.getCurrentTask() != null )
        {
            Thread.sleep( 10 );
        }

        ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
        assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );

        File workingDir = configurationService.getWorkingDirectory();

        assertTrue( "checkout directory of project 'multi-module-parent' does not exist.", new File( workingDir, Integer.toString( rootProject.getId() ) ).exists() );
View Full Code Here

Examples of org.apache.continuum.taskqueue.PrepareBuildProjectsTask

    }

    public void testCheckoutPrepareBuildMultiModuleProjectFreshBuild()
        throws Exception
    {
        PrepareBuildProjectsTask task = createTask( "src/test-projects/multi-module/pom.xml", false, true );

        this.prepareBuildQueue.put( task );

        List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId() );

        assertEquals( "failed to add all projects", 3, projects.size() );

        Project rootProject = getProjectDao().getProjectByName( "multi-module-parent" );
        Project moduleA = getProjectDao().getProjectByName( "module-A" );
        Project moduleB = getProjectDao().getProjectByName( "module-B" );

        // wait while task finishes prepare build
        while( !prepareBuildQueue.getQueueSnapshot().isEmpty() ||
                        prepareBuildTaskQueueExecutor.getCurrentTask() != null )
        {
            Thread.sleep( 10 );
        }

        ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
        assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );

        File workingDir = configurationService.getWorkingDirectory();

        assertTrue( "checkout directory of project 'multi-module-parent' does not exist.", new File( workingDir, Integer.toString( rootProject.getId() ) ).exists() );
View Full Code Here

Examples of org.apache.continuum.taskqueue.PrepareBuildProjectsTask

                rootProject = project;
            }
        }

        assertEquals( 3, map.size() );
        PrepareBuildProjectsTask task = new PrepareBuildProjectsTask( map, 1,
                                                                      projectGroupId, projectGroup.getName(),
                                                                      scmRoot.getScmRootAddress(), scmRoot.getId() );

        return task;
    }
View Full Code Here

Examples of org.apache.continuum.taskqueue.PrepareBuildProjectsTask

    }

    public void testCheckoutPrepareBuildMultiModuleProject()
        throws Exception
    {
        PrepareBuildProjectsTask task = createTask( "src/test-projects/multi-module/pom.xml", false, false );

        this.prepareBuildQueue.put( task );

        List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId() );

        assertEquals( "failed to add all projects", 3, projects.size() );

        Project rootProject = getProjectDao().getProjectByName( "multi-module-parent" );
        Project moduleA = getProjectDao().getProjectByName( "module-A" );
        Project moduleB = getProjectDao().getProjectByName( "module-B" );

        // wait while task finishes prepare build
        while( !prepareBuildQueue.getQueueSnapshot().isEmpty() ||
                        prepareBuildTaskQueueExecutor.getCurrentTask() != null )
        {
            Thread.sleep( 10 );
        }

        ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
        assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );

        File workingDir = configurationService.getWorkingDirectory();

        assertTrue( "checkout directory of project 'multi-module-parent' does not exist.", new File( workingDir, Integer.toString( rootProject.getId() ) ).exists() );
View Full Code Here

Examples of org.apache.continuum.taskqueue.PrepareBuildProjectsTask

    }

    public void testCheckoutPrepareBuildMultiModuleProjectFreshBuild()
        throws Exception
    {
        PrepareBuildProjectsTask task = createTask( "src/test-projects/multi-module/pom.xml", false, true );

        this.prepareBuildQueue.put( task );

        List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId() );

        assertEquals( "failed to add all projects", 3, projects.size() );

        Project rootProject = getProjectDao().getProjectByName( "multi-module-parent" );
        Project moduleA = getProjectDao().getProjectByName( "module-A" );
        Project moduleB = getProjectDao().getProjectByName( "module-B" );

        // wait while task finishes prepare build
        while( !prepareBuildQueue.getQueueSnapshot().isEmpty() ||
                        prepareBuildTaskQueueExecutor.getCurrentTask() != null )
        {
            Thread.sleep( 10 );
        }

        ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
        assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );

        File workingDir = configurationService.getWorkingDirectory();

        assertTrue( "checkout directory of project 'multi-module-parent' does not exist.", new File( workingDir, Integer.toString( rootProject.getId() ) ).exists() );
View Full Code Here

Examples of org.apache.continuum.taskqueue.PrepareBuildProjectsTask

                rootProject = project;
            }
        }

        assertEquals( 3, map.size() );
        PrepareBuildProjectsTask task = new PrepareBuildProjectsTask( map, 1,
                                                                      projectGroupId, projectGroup.getName(),
                                                                      scmRoot.getScmRootAddress(), scmRoot.getId() );

        return task;
    }
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.