Package org.apache.maven.continuum.model.project

Examples of org.apache.maven.continuum.model.project.BuildResult


        Date latestUpdateDate = null;

        try
        {
            BuildResult buildResult = buildResultDao.getLatestBuildResultForProject( project.getId() );

            latestUpdateDate = new Date( buildResult.getStartTime() );
        }
        catch ( Exception e )
        {
        }
View Full Code Here


    {
        Project project = context.getProject();

        List<ProjectNotifier> notifiers = context.getNotifiers();

        BuildResult build = context.getBuildResult();

        BuildDefinition buildDefinition = context.getBuildDefinition();

        // ----------------------------------------------------------------------
        // If there wasn't any building done, don't notify
View Full Code Here

    private void endBuild( BuildContext buildContext )
        throws TaskExecutionException
    {
        // return build result to master
        BuildResult buildResult = buildContext.getBuildResult();

        Map<String, Object> result = new HashMap<String, Object>();
        result.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, new Integer( buildContext.getProjectId() ) );
        result.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, new Integer( buildContext.getBuildDefinitionId() ) );
        result.put( ContinuumBuildAgentUtil.KEY_TRIGGER, new Integer( buildContext.getTrigger() ) );
        result.put( ContinuumBuildAgentUtil.KEY_BUILD_STATE, new Integer( buildResult.getState() ) );
        result.put( ContinuumBuildAgentUtil.KEY_BUILD_START, new Long( buildResult.getStartTime() ).toString() );
        result.put( ContinuumBuildAgentUtil.KEY_BUILD_END, new Long( buildResult.getEndTime() ).toString() );
        result.put( ContinuumBuildAgentUtil.KEY_BUILD_EXIT_CODE, new Integer( buildResult.getExitCode() ) );
       
        String buildOutput = getBuildOutputText( buildContext.getProjectId() );
        if ( buildOutput == null )
        {
            result.put( ContinuumBuildAgentUtil.KEY_BUILD_OUTPUT, "" );
        }
        else
        {
            result.put( ContinuumBuildAgentUtil.KEY_BUILD_OUTPUT, buildOutput );
        }

        if ( buildResult.getError() != null )
        {
            result.put( ContinuumBuildAgentUtil.KEY_BUILD_ERROR, buildResult.getError() );
        }
        else
        {
            result.put( ContinuumBuildAgentUtil.KEY_BUILD_ERROR, "" );
        }
View Full Code Here

    {
        context.setBuildResult( ContinuumBuildAgentUtil.getBuildResult( context.getActionContext(), null ) );
       
        if ( context.getBuildResult() == null )
        {
            BuildResult build = new BuildResult();

            build.setState( ContinuumProjectState.ERROR );

            build.setTrigger( context.getTrigger() );

            build.setStartTime( context.getBuildStartTime() );

            build.setEndTime( System.currentTimeMillis() );

            build.setBuildDefinition( BuildContextToBuildDefinition.getBuildDefinition( context ) );

            if ( error != null )
            {
                build.setError( error );
            }

            context.setBuildResult( build );
        }
    }
View Full Code Here

                {
                    String s = (String) context.getActionContext().get( AbstractContinuumAction.KEY_BUILD_ID );

                    if ( s != null )
                    {
                        BuildResult buildResult = buildResultDao.getBuildResult( Integer.valueOf( s ) );
                        project.setState( buildResult.getState() );
                    }
                    else
                    {
                        project.setState( ContinuumProjectState.ERROR );
                    }
View Full Code Here

    }

    private void updateBuildResult( BuildContext context, String error )
        throws TaskExecutionException
    {
        BuildResult build = context.getBuildResult();

        if ( build == null )
        {
            build = makeAndStoreBuildResult( context, error );
        }
        else
        {
            updateBuildResult( build, context );

            build.setError( error );

            try
            {
                buildResultDao.updateBuildResult( build );

                build = buildResultDao.getBuildResult( build.getId() );

                context.setBuildResult( build );
            }
            catch ( ContinuumStoreException e )
            {
                throw new TaskExecutionException( "Error updating build result", e );
            }
        }

        context.getProject().setState( build.getState() );

        try
        {
            projectDao.updateProject( context.getProject() );
        }
View Full Code Here

            BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );

            context.setBuildDefinition( buildDefinition );

            BuildResult oldBuildResult =
                buildResultDao.getLatestBuildResultForBuildDefinition( projectId, buildDefinitionId );

            context.setOldBuildResult( oldBuildResult );

        context.setScmResult( project.getScmResult() );
View Full Code Here

        throws TaskExecutionException
    {
        // Project project, ScmResult scmResult, long startTime, int trigger )
        // project, scmResult, startTime, trigger );

        BuildResult build = new BuildResult();

        build.setState( ContinuumProjectState.ERROR );

        build.setTrigger( context.getTrigger() );

        build.setStartTime( context.getStartTime() );

        build.setEndTime( System.currentTimeMillis() );

        updateBuildResult( build, context );

        build.setBuildDefinition( context.getBuildDefinition() );

        if ( error != null )
        {
            build.setError( error );
        }

        try
        {
            buildResultDao.addBuildResult( context.getProject(), build );

            build = buildResultDao.getBuildResult( build.getId() );

            context.setBuildResult( build );

            return build;
        }
View Full Code Here

    public void sendMessage( String messageId, MessageContext context )
        throws NotificationException
    {
        Project project = context.getProject();

        BuildResult build = context.getBuildResult();

        ProjectScmRoot projectScmRoot = context.getProjectScmRoot();

        if ( messageId.equals( ContinuumNotificationDispatcher.MESSAGE_ID_BUILD_STARTED ) )
        {
View Full Code Here

    public void sendMessage( String messageId, MessageContext context )
        throws NotificationException
    {
        Project project = context.getProject();
        List<ProjectNotifier> notifiers = context.getNotifiers();
        BuildResult build = context.getBuildResult();
        String buildOutput = getBuildOutput( project, build );
        BuildDefinition buildDefinition = context.getBuildDefinition();
        ProjectScmRoot projectScmRoot = context.getProjectScmRoot();
       
        boolean isPrepareBuildComplete =
View Full Code Here

TOP

Related Classes of org.apache.maven.continuum.model.project.BuildResult

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.