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

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


                throw new AlreadyExistsProfileException( "profile with name " + profile.getName() + " already exists" );
            }
        }
        try
        {
            Profile stored = getProfile( profile.getId() );
            stored.setActive( profile.isActive() );
            stored.setBuilder( profile.getBuilder() );
            stored.setBuildWithoutChanges( profile.isBuildWithoutChanges() );
            stored.setDescription( profile.getDescription() );
            stored.setJdk( profile.getJdk() );
            stored.setName( profile.getName() );
            stored.setEnvironmentVariables( profile.getEnvironmentVariables() );
            profileDao.updateProfile( stored );
        }
        catch ( ContinuumStoreException e )
        {
            throw new ProfileException( e.getMessage(), e );
View Full Code Here


     * @see org.apache.maven.continuum.profile.ProfileService#setBuilderInProfile(org.apache.maven.continuum.model.system.Profile,org.apache.maven.continuum.model.system.Installation)
     */
    public void setBuilderInProfile( Profile profile, Installation builder )
        throws ProfileException
    {
        Profile stored = getProfile( profile.getId() );
        stored.setBuilder( builder );
        try
        {
            profileDao.updateProfile( stored );
        }
        catch ( ContinuumStoreException e )
View Full Code Here

     * @see org.apache.maven.continuum.profile.ProfileService#setJdkInProfile(org.apache.maven.continuum.model.system.Profile,org.apache.maven.continuum.model.system.Installation)
     */
    public void setJdkInProfile( Profile profile, Installation jdk )
        throws ProfileException
    {
        Profile stored = getProfile( profile.getId() );
        stored.setJdk( jdk );
        try
        {
            profileDao.updateProfile( stored );
        }
        catch ( ContinuumStoreException e )
View Full Code Here

     * @see org.apache.maven.continuum.profile.ProfileService#addEnvVarInProfile(org.apache.maven.continuum.model.system.Profile,org.apache.maven.continuum.model.system.Installation)
     */
    public void addEnvVarInProfile( Profile profile, Installation envVar )
        throws ProfileException
    {
        Profile stored = getProfile( profile.getId() );
        stored.addEnvironmentVariable( envVar );
        try
        {
            profileDao.updateProfile( stored );
        }
        catch ( ContinuumStoreException e )
View Full Code Here

    }

    public void removeInstallationFromProfile( Profile profile, Installation installation )
        throws ProfileException
    {
        Profile stored = getProfile( profile.getId() );
        if ( InstallationService.JDK_TYPE.equals( installation.getType() ) )
        {
            stored.setJdk( null );
        }
        else if ( InstallationService.MAVEN1_TYPE.equals( installation.getType() ) ||
            InstallationService.MAVEN2_TYPE.equals( installation.getType() ) ||
            InstallationService.ANT_TYPE.equals( installation.getType() ) )
        {
            stored.setBuilder( null );
        }
        else
        {
            // remove one
            List<Installation> storedEnvVars = stored.getEnvironmentVariables();
            List<Installation> newEnvVars = new ArrayList<Installation>();
            for ( Installation storedInstallation : storedEnvVars )
            {
                if ( !StringUtils.equals( storedInstallation.getName(), installation.getName() ) )
                {
                    newEnvVars.add( storedInstallation );
                }
            }
            stored.setEnvironmentVariables( newEnvVars );
        }
        try
        {
            updateProfileCheckDuplicateName( stored, false );
        }
View Full Code Here

        }
        try
        {
            if ( automaticProfile )
            {
                Profile profile = new Profile();
                profile.setName( storedOne.getName() );
                profile = profileService.addProfile( profile );
                profileService.addInstallationInProfile( profile, storedOne );
            }
        }
        catch ( ProfileException e )
View Full Code Here

        installation.setVarValue( "automaticvarValue" );
        installation = getInstallationService().add( installation, true );
        ProfileService profileService = (ProfileService) lookup( ProfileService.ROLE, "default" );
        List<Profile> profiles = profileService.getAllProfiles();
        assertEquals( 1, profiles.size() );
        Profile profile = (Profile) profiles.get( 0 );
        assertEquals( "automaticJdk", profile.getName() );
        Installation jdk = profile.getJdk();
        assertNotNull( jdk );
        assertEquals( "automaticJdk", jdk.getName() );
    }
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
        {
            getted = getProfileService().addProfile( defaultProfile );
            fail( "no AlreadyExistsProfileException with an already exist name " );
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.