Package org.apache.continuum.model.project

Examples of org.apache.continuum.model.project.ProjectScmRoot


    private void createResult( PrepareBuildProjectsTask task, String error )
        throws TaskExecutionException
    {
        try
        {
            ProjectScmRoot scmRoot =
                projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress( task.getProjectGroupId(),
                                                                                    task.getScmRootAddress() );

            if ( scmRoot.getState() == ContinuumProjectState.UPDATING )
            {
                scmRoot.setState( ContinuumProjectState.ERROR );
                scmRoot.setError( error );
                projectScmRootDao.updateProjectScmRoot( scmRoot );
            }
            else
            {
                Map<Integer, Integer> map = task.getProjectsBuildDefinitionsMap();
View Full Code Here


        BuildDefinition buildDefinition = context.getBuildDefinition();

        BuildResult build = context.getBuildResult();

        ProjectScmRoot projectScmRoot = context.getProjectScmRoot();

        boolean isPrepareBuildComplete =
            messageId.equals( ContinuumNotificationDispatcher.MESSAGE_ID_PREPARE_BUILD_COMPLETE );
       
        if ( projectScmRoot == null && isPrepareBuildComplete )
View Full Code Here

            {
                Project project = (Project) j.next();
                if ( !project.getScmUrl().trim().startsWith( url ) )
                {
                    url = project.getScmUrl();
                    ProjectScmRoot projectScmRoot = new ProjectScmRoot();
                    projectScmRoot.setId( id );
                    projectScmRoot.setProjectGroup( projectGroup );
                    projectScmRoot.setScmRootAddress( url );
                    projectScmRoot.setState( project.getState() );

                    projectScmRoot = (ProjectScmRoot) PlexusJdoUtils.addObject( pmf.getPersistenceManager(), projectScmRoot );
                    projectScmRoots.put( Integer.valueOf( projectScmRoot.getId() ), projectScmRoot );
                    id++;
                }
            }
        }
View Full Code Here

        BuildDefinition buildDefinition = context.getBuildDefinition();

        BuildResult build = context.getBuildResult();

        ProjectScmRoot projectScmRoot = context.getProjectScmRoot();

        boolean isPrepareBuildComplete =
            messageId.equals( ContinuumNotificationDispatcher.MESSAGE_ID_PREPARE_BUILD_COMPLETE );

        if ( projectScmRoot == null && isPrepareBuildComplete )
View Full Code Here

    public void testAddProjectScmRoot()
        throws Exception
    {
        ProjectGroup projectGroup = projectGroupDao.getProjectGroup( testProjectGroup2.getId() );
        ProjectScmRoot projectScmRoot = createTestProjectScmRoot( "scmRootAddress", 1, 0, "", projectGroup );
       
        projectScmRoot = projectScmRootDao.addProjectScmRoot( projectScmRoot );
       
        List<ProjectScmRoot> projectScmRoots =
            projectScmRootDao.getProjectScmRootByProjectGroup( projectGroup.getId() );
       
        assertEquals( "check # of project scm root", 2, projectScmRoots.size() );
       
        ProjectScmRoot retrievedProjectScmRoot =
            projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress( projectGroup.getId(), "scmRootAddress" );
       
        assertProjectScmRootEquals( projectScmRoot, retrievedProjectScmRoot );
        assertProjectGroupEquals( projectScmRoot.getProjectGroup(), retrievedProjectScmRoot.getProjectGroup() );
    }
View Full Code Here

        List<ProjectScmRoot> projectScmRoots =
            projectScmRootDao.getProjectScmRootByProjectGroup( projectGroup.getId() );
       
        assertEquals( "check # of project scm root", 1, projectScmRoots.size() );
       
        ProjectScmRoot projectScmRoot = projectScmRoots.get( 0 );
        projectScmRootDao.removeProjectScmRoot( projectScmRoot );
       
        projectScmRoots =
            projectScmRootDao.getProjectScmRootByProjectGroup( projectGroup.getId() );
       
View Full Code Here

        int projectGroupId = ContinuumBuildConstant.getProjectGroupId( context );
        String scmRootAddress = ContinuumBuildConstant.getScmRootAddress( context );
   
        try
        {
            ProjectScmRoot scmRoot =
                projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress( projectGroupId, scmRootAddress );
   
            String error = ContinuumBuildConstant.getScmError( context );
   
            if ( StringUtils.isEmpty( error ) )
            {
                scmRoot.setState( ContinuumProjectState.UPDATED );
            }
            else
            {
                scmRoot.setState( ContinuumProjectState.ERROR );
                scmRoot.setError( error );
            }
   
            projectScmRootDao.updateProjectScmRoot( scmRoot );
   
            notifierDispatcher.prepareBuildComplete( scmRoot );
View Full Code Here

     
        try
        {
            String scmRootAddress = ContinuumBuildConstant.getScmRootAddress( context );
   
            ProjectScmRoot scmRoot =
                projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress( projectGroupId, scmRootAddress );
            scmRoot.setOldState( scmRoot.getState() );
            scmRoot.setState( ContinuumProjectState.UPDATING );
            projectScmRootDao.updateProjectScmRoot( scmRoot );
        }
        catch ( ContinuumStoreException e )
        {
            log.error( "Error while updating project group'" + projectGroupId + "' scm root's state", e );
View Full Code Here

    }

    private boolean checkProjectScmRoot( Map<String, Object> context )
        throws TaskExecutionException
    {
        ProjectScmRoot projectScmRoot = AbstractContinuumAction.getProjectScmRoot( context );

        // check state of scm root
        return projectScmRoot.getState() != ContinuumProjectState.ERROR;

    }
View Full Code Here

    }

    private void startPrepareBuild( Map<String, Object> context )
        throws TaskExecutionException
    {
        ProjectScmRoot projectScmRoot = AbstractContinuumAction.getProjectScmRoot( context );
        if ( projectScmRoot.getState() != ContinuumProjectState.UPDATING )
        {
            try
            {
                projectScmRoot.setOldState( projectScmRoot.getState() );
                projectScmRoot.setState( ContinuumProjectState.UPDATING );
                projectScmRootDao.updateProjectScmRoot( projectScmRoot );
            }
            catch ( ContinuumStoreException e )
            {
                throw new TaskExecutionException( "Error persisting projectScmRoot", e );
View Full Code Here

TOP

Related Classes of org.apache.continuum.model.project.ProjectScmRoot

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.