Package org.apache.continuum.taskqueue

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


    }

    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

    }

    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

                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

    }

    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

    }

    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

                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

    private ContinuumNotificationDispatcher notifierDispatcher;

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

        Map<Integer, Integer> projectsBuildDefinitionsMap = prepareTask.getProjectsBuildDefinitionsMap();
        int trigger = prepareTask.getTrigger();
        Set<Integer> projectsId = projectsBuildDefinitionsMap.keySet();
        Map<String, Object> context = new HashMap<String, Object>();
        Map<Integer, ScmResult> scmResultMap = new HashMap<Integer, ScmResult>();

        try
View Full Code Here

    }

    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

    }

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

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

            log.info( "initializing buildContext for projectGroupId=" + prepareBuildTask.getProjectGroupId() );
            List<Map<String, Object>> buildContext =
                initializeBuildContext( prepareBuildTask.getProjectsBuildDefinitionsMap(),
                                    prepareBuildTask.getBuildTrigger(), prepareBuildTask.getScmRootAddress(),
                                        prepareBuildTask.getProjectScmRootId() );

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

TOP

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

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.