Package org.apache.continuum.utils.build

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


                one( buildQueue ).remove( with( any( Task.class ) ) );
            }
        } );

        overallQueue.removeProjectFromBuildQueue( 1, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-1",
                                                  1 );
        context.assertIsSatisfied();
    }
View Full Code Here


    }

    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

    public void testAddToPrepareBuildQueue()
        throws Exception
    {
        final PrepareBuildProjectsTask prepareBuildTask = new PrepareBuildProjectsTask( new HashMap<Integer, Integer>(),
                                                                                        new BuildTrigger( 1,
                                                                                                          "test-user" ),
                                                                                        1, "Project Group A",
                                                                                        "http://scmRootAddress", 1 );
        final TaskQueue prepareBuildQueue = context.mock( TaskQueue.class, "prepare-build-queue" );
View Full Code Here

        return getString( context, KEY_USERNAME, "scheduled" );
    }

    public static BuildTrigger getBuildTrigger( Map<String, Object> context )
    {
        return new BuildTrigger( getTrigger( context ), getUsername( context ) );
    }
View Full Code Here

        throws TaskExecutionException
    {
        PrepareBuildProjectsTask prepareTask = (PrepareBuildProjectsTask) task;

        Map<Integer, Integer> projectsBuildDefinitionsMap = prepareTask.getProjectsBuildDefinitionsMap();
        BuildTrigger buildTrigger = prepareTask.getBuildTrigger();
        Set<Integer> projectsId = projectsBuildDefinitionsMap.keySet();
        Map<String, Object> context = new HashMap<String, Object>();
        Map<Integer, ScmResult> scmResultMap = new HashMap<Integer, ScmResult>();
        List<Project> projectList = new ArrayList<Project>();
        int projectGroupId = 0;
View Full Code Here

        {
            addActionError( authzE.getMessage() );
            return REQUIRES_AUTHORIZATION;
        }

        BuildTrigger buildTrigger = new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, getPrincipal() );

        try
        {
            if ( this.getBuildDefinitionId() == -1 )
            {
View Full Code Here

    private void buildProject( int projectId, int trigger )
        throws Exception
    {
        ProjectGroup group = getDefaultProjectGroup();
        buildQueue.put( new BuildProjectTask( projectId, 0, new BuildTrigger( trigger, "" ), null, null, null,
                                              group.getId() ) );
    }
View Full Code Here

        Project project = projectDao.getProject( getProject( context ).getId() );

        BuildDefinition buildDefinition = getBuildDefinition( context );

        BuildTrigger buildTrigger = getBuildTrigger( context );

        ScmResult scmResult = getScmResult( context );

        List<ProjectDependency> updatedDependencies = getUpdatedDependencies( context );

        ContinuumBuildExecutor buildExecutor = buildExecutorManager.getBuildExecutor( project.getExecutorId() );

        // ----------------------------------------------------------------------
        // Make the buildResult
        // ----------------------------------------------------------------------

        BuildResult buildResult = new BuildResult();

        buildResult.setStartTime( new Date().getTime() );

        buildResult.setState( ContinuumProjectState.BUILDING );

        buildResult.setTrigger( buildTrigger.getTrigger() );

        buildResult.setUsername( buildTrigger.getTriggeredBy() );

        buildResult.setScmResult( scmResult );

        buildResult.setModifiedDependencies( updatedDependencies );
View Full Code Here

        catch ( AuthorizationRequiredException e )
        {
            return REQUIRES_AUTHORIZATION;
        }

        BuildTrigger buildTrigger = new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, getPrincipal() );

        try
        {
            if ( projectId > 0 )
            {
                if ( buildDefinitionId > 0 )
                {
                    getContinuum().buildProjectWithBuildDefinition( projectId, buildDefinitionId, buildTrigger );
                }
                else
                {
                    getContinuum().buildProject( projectId, buildTrigger.getTriggeredBy() );
                }
            }
            else
            {
                if ( buildDefinitionId > 0 )
                {
                    getContinuum().buildProjectGroupWithBuildDefinition( projectGroupId, buildDefinitionId,
                                                                         buildTrigger );
                }
                else
                {
                    //TODO: Check if this code is called, I don't think
                    //If it is, it should used the projectId
                    getContinuum().buildProjects( buildTrigger.getTriggeredBy() );
                }
            }
        }
        catch ( NoBuildAgentException e )
        {
View Full Code Here

        {
            addActionError( e.getMessage() );
            return REQUIRES_AUTHENTICATION;
        }

        getContinuum().getBuildsManager().removeProjectFromBuildQueue( projectId, buildDefinitionId, new BuildTrigger(
            trigger, "" ), projectName, projectGroupId );
        Project project = getContinuum().getProject( projectId );
        project.setState( project.getOldState() );
        getContinuum().updateProject( project );
View Full Code Here

TOP

Related Classes of org.apache.continuum.utils.build.BuildTrigger

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.