Package org.apache.maven.continuum.builddefinition

Examples of org.apache.maven.continuum.builddefinition.BuildDefinitionService


                                              defaultProjectGroup.getId() );
        assertEquals( 1, continuum.getProjectGroupWithProjects( defaultProjectGroup.getId() ).getProjects().size() );
        project = continuum.getProjectWithAllDetails( projectId );
        assertNotNull( project );

        BuildDefinitionService service = (BuildDefinitionService) lookup( BuildDefinitionService.class );
        assertEquals( 4, service.getAllBuildDefinitionTemplate().size() );
        assertEquals( 5, service.getAllBuildDefinitions().size() );

        BuildDefinition buildDef =
            (BuildDefinition) service.getDefaultAntBuildDefinitionTemplate().getBuildDefinitions().get( 0 );
        buildDef = service.cloneBuildDefinition( buildDef );
        buildDef.setTemplate( false );
        continuum.addBuildDefinitionToProject( project.getId(), buildDef );
        project = continuum.getProjectWithAllDetails( project.getId() );
        assertEquals( 2, project.getBuildDefinitions().size() );
        assertEquals( 4, service.getAllBuildDefinitionTemplate().size() );
        assertEquals( 6, service.getAllBuildDefinitions().size() );
    }
View Full Code Here


                                              defaultProjectGroup.getId() );
        assertEquals( 1, continuum.getProjectGroupWithProjects( defaultProjectGroup.getId() ).getProjects().size() );
        project = continuum.getProjectWithAllDetails( projectId );
        assertNotNull( project );

        BuildDefinitionService service = (BuildDefinitionService) lookup( BuildDefinitionService.class );
        assertEquals( 4, service.getAllBuildDefinitionTemplate().size() );
        assertEquals( 5, service.getAllBuildDefinitions().size() );

        BuildDefinition buildDef =
            (BuildDefinition) service.getDefaultAntBuildDefinitionTemplate().getBuildDefinitions().get( 0 );
        buildDef = service.cloneBuildDefinition( buildDef );
        buildDef.setTemplate( false );
        continuum.addBuildDefinitionToProject( project.getId(), buildDef );
        project = continuum.getProjectWithAllDetails( project.getId() );
        assertEquals( 2, project.getBuildDefinitions().size() );
        assertEquals( 4, service.getAllBuildDefinitionTemplate().size() );
        assertEquals( 6, service.getAllBuildDefinitions().size() );
    }
View Full Code Here

        bd = new BuildDefinition();
        bd.setGoals( "clean deploy" );
        bd.setBuildFile( "pom.xml" );
        bd.setDescription( "my foo" );
        bd.setTemplate( true );
        BuildDefinitionService bds = (BuildDefinitionService) lookup( BuildDefinitionService.class.getName(), "default" );
        bd = bds.addBuildDefinition( bd );
       
       
        assertEquals( 5, bds.getAllBuildDefinitions().size() );

        bdt = new BuildDefinitionTemplate();
        bdt.setName( "bdt foo" );
       
        bdt = bds.addBuildDefinitionTemplate( bdt );
       
        bdt = bds.addBuildDefinitionInTemplate( bdt, bd, false );       
    }   
View Full Code Here

        bd.setBuildFile( "pom.xml" );

        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() );

        logger.debug( "projectGroups number " + getProjectGroupDao().getAllProjectGroups().size() );

        int all = service.getAllBuildDefinitions().size();

        ContinuumProjectBuildingResult result;

        result = projectBuilder.buildProjectsFromMetadata( url, null, null, false, bdt );
        assertFalse( result.hasErrors() );

        assertEquals( 5, service.getAllBuildDefinitionTemplate().size() );

        assertEquals( all + 1, service.getAllBuildDefinitions().size() );

        assertNotNull( result );

        assertNotNull( result.getErrors() );
View Full Code Here

        project.setScmUsername( SCM_USERNAME );
        project.setScmPassword( SCM_PASSWORD );
        project.setScmUrl( scmUrl );       
        project.setScmUseCache( true );
       
        BuildDefinitionService bdService = ( BuildDefinitionService )lookup( BuildDefinitionService.class.getName() );
       
        int projectId =
            continuum.addProject( project, ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR,
                                  getDefaultProjectGroup().getId(),
                                  bdService.getDefaultAntBuildDefinitionTemplate().getId() );
               
        // read the project from store
        Project retrievedProject = continuum.getProject( projectId );
        assertNullretrievedProject.getScmUsername() );
        assertNull( retrievedProject.getScmPassword() );
View Full Code Here

        project.setScmUsername( SCM_USERNAME );
        project.setScmPassword( SCM_PASSWORD );
        project.setScmUrl( scmUrl );       
        project.setScmUseCache( false );
       
        BuildDefinitionService bdService = ( BuildDefinitionService )lookup( BuildDefinitionService.class.getName() );
       
        int projectId =
            continuum.addProject( project, ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR,
                                  getDefaultProjectGroup().getId(),
                                  bdService.getDefaultAntBuildDefinitionTemplate().getId() );
              
        // read the project from store
        Project retrievedProject = continuum.getProject( projectId );
        assertEquals( SCM_USERNAME, retrievedProject.getScmUsername() );
        assertEquals( SCM_PASSWORD, retrievedProject.getScmPassword() );
View Full Code Here

        bd.setType( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR );

        bd.setTemplate( true );

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

        BuildDefinitionTemplate bdt = new BuildDefinitionTemplate();
        bdt.setName( "maven1" );
        bd = service.addBuildDefinition( bd );
        bdt = service.addBuildDefinitionTemplate( bdt );
        bdt = service.addBuildDefinitionInTemplate( bdt, bd, false );

        ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
            getTestFile( "src/test/resources/projects/maven-1.pom.xml" ).toURL(), null, null, false, bdt );

        assertOnResult( result );
View Full Code Here

        throws Exception
    {
        ContinuumProjectBuilder projectBuilder =
            (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenOneContinuumProjectBuilder.ID );

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

        ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
            getTestFile( "src/test/resources/projects/maven-1.pom.xml" ).toURL(), null, null, false,
            service.getDefaultMavenOneBuildDefinitionTemplate() );

        assertOnResult( result );

    }
View Full Code Here

        bd.setBuildFile( "pom.xml" );

        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() );

        logger.debug( "projectGroups number " + getProjectGroupDao().getAllProjectGroups().size() );

        int all = service.getAllBuildDefinitions().size();

        ContinuumProjectBuildingResult result;

        result = projectBuilder.buildProjectsFromMetadata( url, null, null, false, bdt );

        assertEquals( 5, service.getAllBuildDefinitionTemplate().size() );

        assertEquals( all + 1, service.getAllBuildDefinitions().size() );

        assertNotNull( result );

        assertNotNull( result.getErrors() );
View Full Code Here

        bd.setType( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR );
       
        bd.setTemplate( true );
       
        BuildDefinitionService service = (BuildDefinitionService) lookup( BuildDefinitionService.class );
       
        BuildDefinitionTemplate bdt = new BuildDefinitionTemplate();
        bdt.setName( "maven1" );
        bd = service.addBuildDefinition( bd );
        bdt = service.addBuildDefinitionTemplate( bdt );
        bdt = service.addBuildDefinitionInTemplate( bdt, bd, false );
       
        ContinuumProjectBuildingResult result = projectBuilder
            .buildProjectsFromMetadata( getTestFile( "src/test/resources/projects/maven-1.pom.xml" ).toURL(), null,
                                        null, false, bdt );
View Full Code Here

TOP

Related Classes of org.apache.maven.continuum.builddefinition.BuildDefinitionService

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.