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

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


        bd.setType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );

        BuildDefinitionService service = (BuildDefinitionService) lookup( BuildDefinitionService.class );

        bd = service.addBuildDefinition( bd );
        BuildDefinitionTemplate bdt = new BuildDefinitionTemplate();
        bdt.setName( "maven2" );
        bdt = service.addBuildDefinitionTemplate( bdt );
        bdt = service.addBuildDefinitionInTemplate( bdt, bd, false );
        assertEquals( 5, service.getAllBuildDefinitionTemplate().size() );
        logger.debug( "templates number " + service.getAllBuildDefinitionTemplate().size() );
View Full Code Here


    public void execute( Map context )
        throws Exception
    {
        int projectGroupId = getProjectGroupId( context );
        ProjectGroup projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
        BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate( context );
        if ( buildDefinitionTemplate != null )
        {
            for ( BuildDefinition buildDefinition : (List<BuildDefinition>) buildDefinitionTemplate.getBuildDefinitions() )
            {
                resolveDefaultBuildDefinitionsForProjectGroup( buildDefinition, projectGroup );

                projectGroup.addBuildDefinition( buildDefinition );
            }
View Full Code Here

        int all = buildDefinitionDao.getAllBuildDefinitions().size();
        BuildDefinition buildDefinition = new BuildDefinition();
        buildDefinition.setBuildFile( "pom.xml" );
        buildDefinition.setGoals( "clean" );
        buildDefinition.setTemplate( true );
        BuildDefinitionTemplate template = new BuildDefinitionTemplate();
        template.setName( "test" );
        template.setContinuumDefault( true );
        template.setType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );
        template = buildDefinitionTemplateDao.addBuildDefinitionTemplate( template );
        buildDefinition = buildDefinitionDao.addBuildDefinition( buildDefinition );

        template.addBuildDefinition( buildDefinition );

        template = buildDefinitionTemplateDao.updateBuildDefinitionTemplate( template );

        assertEquals( "test", template.getName() );
        assertTrue( template.isContinuumDefault() );
        assertEquals( 1, template.getBuildDefinitions().size() );
        assertEquals( all + 1, buildDefinitionDao.getAllBuildDefinitions().size() );
        assertEquals( 2, buildDefinitionTemplateDao.getAllBuildDefinitionTemplate().size() );

        template = buildDefinitionTemplateDao.getContinuumBuildDefinitionTemplateWithType(
            ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );

        assertNotNull( template );
        assertEquals( 1, template.getBuildDefinitions().size() );

        assertEquals( 2, buildDefinitionTemplateDao.getAllBuildDefinitionTemplate().size() );
    }
View Full Code Here

                                                                          false );
        BuildDefinition testBuildDefinition5 = createTestBuildDefinition( "arguments14", "buildFile14", "goals14",
                                                                          profile1, schedule1, false, false );
        testBuildDefinition5.setTemplate( true );

        BuildDefinitionTemplate testBuildDefinitionTemplate1 = createTestBuildDefinitionTemplate( "template2", "type2",
                                                                                                  false );
        testBuildDefinitionTemplate1.addBuildDefinition( testBuildDefinition5 );

        if ( addToStore )
        {
            buildDefinitionTemplateDao.addBuildDefinitionTemplate( testBuildDefinitionTemplate1 );
        }
View Full Code Here

    }

    protected static BuildDefinitionTemplate createTestBuildDefinitionTemplate( String name, String type,
                                                                                boolean continuumDefault )
    {
        BuildDefinitionTemplate template = new BuildDefinitionTemplate();
        template.setName( name );
        template.setType( type );
        template.setContinuumDefault( continuumDefault );

        return template;
    }
View Full Code Here

    public String save()
        throws Exception
    {
        List<BuildDefinition> selectedBuildDefinitions = getBuildDefinitionsFromSelectedBuildDefinitions();

        BuildDefinitionTemplate result;

        AuditLog event = new AuditLog( buildDefinitionTemplate.getName(), AuditLogConstants.ADD_TEMPLATE );
        event.setCategory( AuditLogConstants.TEMPLATE );
        event.setCurrentUser( getPrincipal() );
View Full Code Here

    public BuildDefinitionTemplate getBuildDefinitionTemplate()
    {
        if ( buildDefinitionTemplate == null )
        {
            this.buildDefinitionTemplate = new BuildDefinitionTemplate();
        }
        return buildDefinitionTemplate;
    }
View Full Code Here

        int all = buildDefinitionDao.getAllBuildDefinitions().size();
        BuildDefinition buildDefinition = new BuildDefinition();
        buildDefinition.setBuildFile( "pom.xml" );
        buildDefinition.setGoals( "clean" );
        buildDefinition.setTemplate( true );
        BuildDefinitionTemplate template = new BuildDefinitionTemplate();
        template.setName( "test" );
        template.setContinuumDefault( true );
        template.setType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );
        template = buildDefinitionTemplateDao.addBuildDefinitionTemplate( template );
        buildDefinition = buildDefinitionDao.addBuildDefinition( buildDefinition );

        template.addBuildDefinition( buildDefinition );

        template = buildDefinitionTemplateDao.updateBuildDefinitionTemplate( template );

        assertEquals( "test", template.getName() );
        assertTrue( template.isContinuumDefault() );
        assertEquals( 1, template.getBuildDefinitions().size() );
        assertEquals( all + 1, buildDefinitionDao.getAllBuildDefinitions().size() );
        assertEquals( 2, buildDefinitionTemplateDao.getAllBuildDefinitionTemplate().size() );

        template = buildDefinitionTemplateDao
            .getContinuumBuildDefinitionTemplateWithType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );

        assertNotNull( template );
        assertEquals( 1, template.getBuildDefinitions().size() );

        assertEquals( 2, buildDefinitionTemplateDao.getAllBuildDefinitionTemplate().size() );
    }
View Full Code Here

        executeAction( "store-project", context );

        try
        {
            BuildDefinitionTemplate bdt;

            if ( executorId.equalsIgnoreCase( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR ) )
            {
                if ( buildDefinitionTemplateId <= 0 )
                {
                    bdt = buildDefinitionService.getDefaultAntBuildDefinitionTemplate();
                }
                else
                {
                    bdt = buildDefinitionService.getBuildDefinitionTemplate( buildDefinitionTemplateId );
                }
            }
            else
            {
                //shell default
                if ( buildDefinitionTemplateId <= 0 )
                {
                    bdt = buildDefinitionService.getDefaultShellBuildDefinitionTemplate();
                }
                else
                {
                    bdt = buildDefinitionService.getBuildDefinitionTemplate( buildDefinitionTemplateId );
                }
            }

            buildDefinitionService.addTemplateInProject( bdt.getId(), getProject(
                AbstractContinuumAction.getProjectId( context ) ) );
        }
        catch ( BuildDefinitionServiceException e )
        {
            throw new ContinuumException( e.getMessage(), e );
View Full Code Here

                // olamy  : read again the project to have values because store.updateProjectGroup( projectGroup );
                // remove object data -> we don't display the project name in the build queue
                AbstractContinuumAction.setProject( context, projectDao.getProject( project.getId() ) );

                BuildDefinition defaultBuildDefinition = null;
                BuildDefinitionTemplate template = null;
                if ( projectBuilderId.equals( MavenTwoContinuumProjectBuilder.ID ) )
                {
                    template = buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate();

                    if( template != null && template.getBuildDefinitions().size() > 0 )
                    {
                        defaultBuildDefinition = template.getBuildDefinitions().get( 0 );
                    }
                }
                else if ( projectBuilderId.equals( MavenOneContinuumProjectBuilder.ID ) )
                {
                    template = buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate();

                    if ( template != null && template.getBuildDefinitions().size() > 0 )
                    {
                        defaultBuildDefinition = template.getBuildDefinitions().get( 0 );
                    }
                }

                if ( defaultBuildDefinition == null )
                {
View Full Code Here

TOP

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

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.