Package org.apache.continuum.model.release

Examples of org.apache.continuum.model.release.ContinuumReleaseResult


    private ContinuumReleaseResult createContinuumReleaseResult( int projectId, String releaseGoals,
                                                                 ReleaseResult result, String releaseBy )
        throws ContinuumException
    {
        ContinuumReleaseResult releaseResult = new ContinuumReleaseResult();
        releaseResult.setStartTime( result.getStartTime() );
        releaseResult.setEndTime( result.getEndTime() );
        releaseResult.setResultCode( result.getResultCode() );

        Project project = getProject( projectId );
        ProjectGroup projectGroup = project.getProjectGroup();
        releaseResult.setProjectGroup( projectGroup );
        releaseResult.setProject( project );
        releaseResult.setReleaseGoal( releaseGoals );
        releaseResult.setUsername( releaseBy );

        String releaseName = "releases-" + result.getStartTime();

        try
        {
View Full Code Here


    }

    public void removeContinuumReleaseResult( int releaseResultId )
        throws ContinuumException
    {
        ContinuumReleaseResult releaseResult = getContinuumReleaseResult( releaseResultId );

        try
        {
            releaseResultDao.removeContinuumReleaseResult( releaseResult );
        }
        catch ( ContinuumStoreException e )
        {
            throw new ContinuumException( "Error while deleting continuumReleaseResult: " + releaseResultId, e );
        }

        try
        {
            int projectGroupId = releaseResult.getProjectGroup().getId();

            String name = "releases-" + releaseResult.getStartTime();

            File releaseFile = getConfiguration().getReleaseOutputFile( projectGroupId, name );

            if ( releaseFile.exists() )
            {
View Full Code Here

    }

    public String getReleaseOutput( int releaseResultId )
        throws ContinuumException
    {
        ContinuumReleaseResult releaseResult = getContinuumReleaseResult( releaseResultId );

        ProjectGroup projectGroup = releaseResult.getProjectGroup();

        try
        {
            return configurationService.getReleaseOutput( projectGroup.getId(),
                                                          "releases-" + releaseResult.getStartTime() );
        }
        catch ( ConfigurationException e )
        {
            throw new ContinuumException( "Error while retrieving release output for release: " + releaseResultId );
        }
View Full Code Here

        throws Exception
    {
        Project project = projectDao.getProject( testProject1.getId() );
        ProjectGroup group = project.getProjectGroup();

        ContinuumReleaseResult releaseResult = createTestContinuumReleaseResult( group, project, "releaseGoal", 0, 0,
                                                                                 0 );
        releaseResult = releaseResultDao.addContinuumReleaseResult( releaseResult );

        List<ContinuumReleaseResult> releaseResults = releaseResultDao.getAllContinuumReleaseResults();
        assertEquals( "check size of continuum release results", 2, releaseResults.size() );

        ContinuumReleaseResult retrievedResult = releaseResults.get( 1 );
        assertReleaseResultEquals( releaseResult, retrievedResult );
        assertProjectGroupEquals( group, retrievedResult.getProjectGroup() );
        assertProjectEquals( project, retrievedResult.getProject() );

        releaseResultDao.removeContinuumReleaseResult( releaseResult );
        projectDao.removeProject( project );
        assertFalse( projectDao.getProjectsInGroup( group.getId() ).contains( project ) );
View Full Code Here

        {
            testProjectScmRoot.setId( 1 );
        }

        testContinuumReleaseResult = createTestContinuumReleaseResult( group, null, "releaseGoal", 0, 0, 0 );
        ContinuumReleaseResult releaseResult = createTestContinuumReleaseResult( testContinuumReleaseResult );

        if ( addToStore )
        {
            releaseResult = releaseResultDao.addContinuumReleaseResult( releaseResult );
            testContinuumReleaseResult.setId( releaseResult.getId() );
        }
        else
        {
            testContinuumReleaseResult.setId( 1 );
        }
View Full Code Here

    protected static ContinuumReleaseResult createTestContinuumReleaseResult( ProjectGroup group, Project project,
                                                                              String releaseGoal, int resultCode,
                                                                              long startTime, long endTime )
    {
        ContinuumReleaseResult releaseResult = new ContinuumReleaseResult();
        releaseResult.setProjectGroup( group );
        releaseResult.setProject( project );
        releaseResult.setReleaseGoal( releaseGoal );
        releaseResult.setResultCode( resultCode );
        releaseResult.setStartTime( startTime );
        releaseResult.setEndTime( endTime );

        return releaseResult;
    }
View Full Code Here

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

        ContinuumReleaseResult releaseResult = getContinuum().getContinuumReleaseResult( releaseResultId );

        result = new ReleaseResult();
        result.setStartTime( releaseResult.getStartTime() );
        result.setEndTime( releaseResult.getEndTime() );
        result.setResultCode( releaseResult.getResultCode() );

        releaseGoal = releaseResult.getReleaseGoal();
        projectName = releaseResult.getProject().getName();
        username = releaseResult.getUsername();

        try
        {
            File releaseOutputFile = getContinuum().getConfiguration().getReleaseOutputFile( projectGroupId,
                                                                                             "releases-" +
                                                                                                 releaseResult.getStartTime() );

            if ( releaseOutputFile.exists() )
            {
                String str = StringEscapeUtils.escapeHtml( FileUtils.fileRead( releaseOutputFile ) );
                result.appendOutput( str );
View Full Code Here

                {
                    ReleaseResult result = releaseManager.getReleaseResult( releaseId );
   
                    if ( result != null && getContinuum().getContinuumReleaseResult( projectId, releaseGoal, result.getStartTime(), result.getEndTime() ) == null )
                    {
                        ContinuumReleaseResult releaseResult = createContinuumReleaseResult( result );
                        getContinuum().addContinuumReleaseResult( releaseResult );
                    }
                }

                listenerSummary.setPhases( DistributedReleaseUtil.getReleasePhases( map ) );
                listenerSummary.setCompletedPhases( DistributedReleaseUtil.getCompletedReleasePhases( map ) );
                listenerSummary.setInProgress( DistributedReleaseUtil.getReleaseInProgress( map ) );
                listenerSummary.setError( DistributedReleaseUtil.getReleaseError( map ) );
            }
            else
            {
                throw new Exception( "There is no on-going or finished release operation with id " + releaseId );
            }
        }
        else
        {
            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
   
            listener = (ContinuumReleaseManagerListener) releaseManager.getListeners().get( releaseId );
   
            if ( listener != null )
            {
                if ( listener.getState() == ContinuumReleaseManagerListener.LISTENING )
                {
                    status = "inProgress";
                }
                else if ( listener.getState() == ContinuumReleaseManagerListener.FINISHED )
                {
                    status = SUCCESS;
                }
                else
                {
                    status = "initialized";
                }

                listenerSummary.setPhases( listener.getPhases() );
                listenerSummary.setCompletedPhases( listener.getCompletedPhases() );
                listenerSummary.setInProgress( listener.getInProgress() );
                listenerSummary.setError( listener.getError() );
            }
            else
            {
                throw new Exception( "There is no on-going or finished release operation with id " + releaseId );
            }

            if ( status.equals( SUCCESS ) )
            {
                ReleaseResult result = (ReleaseResult) releaseManager.getReleaseResults().get( releaseId );

                if ( result != null && getContinuum().getContinuumReleaseResult( projectId, releaseGoal, result.getStartTime(), result.getEndTime() ) == null )
                {
                    ContinuumReleaseResult releaseResult = createContinuumReleaseResult( result );
                    getContinuum().addContinuumReleaseResult( releaseResult );
                }
            }
        }
View Full Code Here

    }

    private ContinuumReleaseResult createContinuumReleaseResult( ReleaseResult result )
        throws ContinuumException
    {
        ContinuumReleaseResult releaseResult = new ContinuumReleaseResult();
        releaseResult.setStartTime( result.getStartTime() );
        releaseResult.setEndTime( result.getEndTime() );
        releaseResult.setResultCode( result.getResultCode() );

        Project project = getContinuum().getProject( projectId );
        ProjectGroup projectGroup = project.getProjectGroup();
        releaseResult.setProjectGroup( projectGroup );
        releaseResult.setProject( project );
        releaseResult.setReleaseGoal( releaseGoal );

        String releaseName = "releases-" + result.getStartTime();

        try
        {
View Full Code Here

    }

    public void removeContinuumReleaseResult( int releaseResultId )
        throws ContinuumException
    {
        ContinuumReleaseResult releaseResult = getContinuumReleaseResult( releaseResultId );

        try
        {
            releaseResultDao.removeContinuumReleaseResult( releaseResult );
        }
        catch ( ContinuumStoreException e )
        {
            throw new ContinuumException( "Error while deleting continuumReleaseResult: " + releaseResultId, e );
        }

        try
        {
            int projectGroupId = releaseResult.getProjectGroup().getId();

            String name = "releases-" + releaseResult.getStartTime();

            File releaseFile = getConfiguration().getReleaseOutputFile( projectGroupId, name );

            if ( releaseFile.exists() )
            {
View Full Code Here

TOP

Related Classes of org.apache.continuum.model.release.ContinuumReleaseResult

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.