Package org.apache.maven.continuum.model.system

Examples of org.apache.maven.continuum.model.system.Profile


            projects = ProjectSorter.getSortedProjects( projects, log );

            int buildDefinitionId = projectsAndBuildDefinitions.get( projects.get( 0 ).getId() );
            BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );

            Profile profile = buildDefinition.getProfile();

            if ( profile != null && !StringUtils.isEmpty( profile.getBuildAgentGroup() ) )
            {
                String groupName = profile.getBuildAgentGroup();

                BuildAgentGroupConfiguration buildAgentGroup = configurationService.getBuildAgentGroup( groupName );

                return buildAgentGroup;
            }
View Full Code Here


    }

    @Override
    protected Map<String, String> getEnvironments( BuildDefinition buildDefinition )
    {
        Profile profile = buildDefinition.getProfile();
        if ( profile == null )
        {
            return Collections.EMPTY_MAP;
        }
        Map<String, String> envVars = new HashMap<String, String>();
        String javaHome = getJavaHomeValue( buildDefinition );
        if ( !StringUtils.isEmpty( javaHome ) )
        {
            envVars.put( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), javaHome );
        }
        Installation builder = profile.getBuilder();
        if ( builder != null )
        {
            envVars.put( getInstallationService().getEnvVar( InstallationService.MAVEN2_TYPE ), builder.getVarValue() );
        }
        envVars.putAll( getEnvironmentVariables( buildDefinition ) );
View Full Code Here

                                    getEnvironments( buildDefinition ) );
    }

    protected Map<String, String> getEnvironments( BuildDefinition buildDefinition )
    {
        Profile profile = buildDefinition.getProfile();
        if ( profile == null )
        {
            return Collections.EMPTY_MAP;
        }
        Map<String, String> envVars = new HashMap<String, String>();
        String javaHome = getJavaHomeValue( buildDefinition );
        if ( !StringUtils.isEmpty( javaHome ) )
        {
            envVars.put( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), javaHome );
        }
        Installation builder = profile.getBuilder();
        if ( builder != null )
        {
            envVars.put( builder.getVarName(), builder.getVarValue() );
        }
        envVars.putAll( getEnvironmentVariables( buildDefinition ) );
View Full Code Here

        buildAgentGroup.setBuildAgents( buildAgents );
    }
   
    private void setupBuildDefinition()
    {
        Profile buildEnv1 = new Profile();
        buildEnv1.setBuildAgentGroup( TEST_BUILD_AGENT_GROUP1 );

        buildDefinition = new BuildDefinition();
        buildDefinition.setId( 1 );
        buildDefinition.setProfile( buildEnv1 );
    }
View Full Code Here

        throws Exception
    {
        Schedule schedule = null;
        if ( buildDefinition.getProfile() != null )
        {
            Profile profile = getContinuum().getProfileService().getProfile( buildDefinition.getProfile().getId() );
            if ( profile != null )
            {
                buildDefinition.setProfile( profile );
            }
            else
View Full Code Here

        if ( name == null )
        {
            name = project.getArtifactId();
        }

        Profile profile = null;

        if ( profileId != -1 )
        {
            profile = getContinuum().getProfileService().getProfile( profileId );
        }
View Full Code Here

        mvn206.setType( InstallationService.MAVEN2_TYPE );
        mvn206.setVarValue( "/users/maven-2.0.6" );
        mvn206.setName( mvn206Name );
        mvn206 = getInstallationService().add( mvn206 );

        jdk1mvn205 = new Profile();
        jdk1mvn205.setJdk( jdk1 );
        jdk1mvn205.setBuilder( mvn205 );
        jdk1mvn205.setName( jdk1mvn205Name );
        getProfileService().addProfile( jdk1mvn205 );

        jdk2mvn206 = new Profile();
        jdk2mvn206.setJdk( jdk2 );
        jdk2mvn206.setBuilder( mvn206 );
        jdk2mvn206.setName( jdk2mvn206Name );
        getProfileService().addProfile( jdk2mvn206 );
View Full Code Here

    }

    public void testAddProfile()
        throws Exception
    {
        Profile defaultProfile = new Profile();
        String name = "default profile";
        defaultProfile.setName( name );
        Profile getted = getProfileService().addProfile( defaultProfile );
        assertNotNull( getProfileService().getProfile( getted.getId() ) );
        assertEquals( name, getProfileService().getProfile( getted.getId() ).getName() );
        assertEquals( 3, getProfileService().getAllProfiles().size() );
    }
View Full Code Here

    }

    public void testAddDuplicateProfile()
        throws Exception
    {
        Profile defaultProfile = new Profile();
        String name = "default profile";
        defaultProfile.setName( name );
        Profile getted = getProfileService().addProfile( defaultProfile );
        assertNotNull( getProfileService().getProfile( getted.getId() ) );
        assertEquals( name, getProfileService().getProfile( getted.getId() ).getName() );
        assertEquals( 3, getProfileService().getAllProfiles().size() );

        defaultProfile = new Profile();
        defaultProfile.setName( name );
        try
        {
            getProfileService().addProfile( defaultProfile );
            fail( "no AlreadyExistsProfileException with an already exist name " );
View Full Code Here

    }

    public void testDeleteProfile()
        throws Exception
    {
        Profile defaultProfile = new Profile();
        defaultProfile.setName( "default profile" );
        Profile getted = getProfileService().addProfile( defaultProfile );
        int id = getted.getId();
        assertNotNull( getProfileService().getProfile( id ) );
        getProfileService().deleteProfile( id );
        assertNull( getProfileService().getProfile( id ) );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.continuum.model.system.Profile

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.