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

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


    }

    public void testupdateProfile()
        throws Exception
    {
        Profile profile = getProfileService().getProfile( jdk1mvn205.getId() );
        assertEquals( jdk1mvn205Name, profile.getName() );
        String newName = "new name";
        profile.setName( newName );
        getProfileService().updateProfile( profile );

        Profile getted = getProfileService().getProfile( jdk1mvn205.getId() );
        assertNotNull( getted );
        assertEquals( newName, getted.getName() );
    }
View Full Code Here


    public void testupdateProfileDuplicateName()
        throws Exception
    {
        int profileId = jdk1mvn205.getId();
        Profile profile = getProfileService().getProfile( profileId );
        assertEquals( jdk1mvn205Name, profile.getName() );
        profile.setName( jdk2mvn206Name );

        try
        {
            getProfileService().updateProfile( profile );
           
            fail( "no AlreadyExistsProfileException with duplicate name" );
        }
        catch ( AlreadyExistsProfileException e )
        {
            // we must be here
        }
        Profile getted = getProfileService().getProfile( profileId );
        assertNotNull( getted );
        assertEquals( jdk1mvn205Name, getted.getName() );
    }
View Full Code Here

    }

    public void testsetJdkInProfile()
        throws Exception
    {
        Profile profile = getProfileService().getProfile( jdk1mvn205.getId() );
        getProfileService().setJdkInProfile( profile, jdk2 );

        profile = getProfileService().getProfile( jdk1mvn205.getId() );
        assertEquals( jdk2.getName(), profile.getJdk().getName() );
        assertEquals( jdk2.getVarValue(), profile.getJdk().getVarValue() );
    }
View Full Code Here

    }

    public void testsetBuilderInProfile()
        throws Exception
    {
        Profile profile = getProfileService().getProfile( jdk1mvn205.getId() );
        getProfileService().setBuilderInProfile( profile, mvn206 );
        profile = getProfileService().getProfile( jdk1mvn205.getId() );
        assertEquals( mvn206.getName(), profile.getBuilder().getName() );
        assertEquals( mvn206.getVarValue(), profile.getBuilder().getVarValue() );

    }
View Full Code Here

    }

    public void testaddEnvVarInProfile()
        throws Exception
    {
        Profile profile = getProfileService().getProfile( jdk1mvn205.getId() );
        getProfileService().setBuilderInProfile( profile, mvn206 );
        getProfileService().addEnvVarInProfile( profile, mvnOpts1 );
        profile = getProfileService().getProfile( jdk1mvn205.getId() );
        assertFalse( profile.getEnvironmentVariables().isEmpty() );
        assertEquals( 1, profile.getEnvironmentVariables().size() );
    }
View Full Code Here

    }

    public void testRemoveInstallationLinkedToAProfile()
        throws Exception
    {
        Profile profile = getProfileService().getProfile( jdk1mvn205.getId() );
        getProfileService().setJdkInProfile( profile, jdk2 );

        getProfileService().getProfile( jdk1mvn205.getId() );
        InstallationService installationService = (InstallationService) lookup( InstallationService.ROLE, "default" );
        installationService.delete( jdk2 );
View Full Code Here

    }

    public void testRemoveEnvVarFromProfile()
        throws Exception
    {
        Profile profile = getProfileService().getProfile( jdk1mvn205.getId() );
        getProfileService().setJdkInProfile( profile, jdk2 );
        getProfileService().addEnvVarInProfile( profile, mvnOpts1 );
        getProfileService().addEnvVarInProfile( profile, mvnOpts2 );

        profile = getProfileService().getProfile( jdk1mvn205.getId() );
        assertNotNull( profile.getJdk() );
        assertEquals( 2, profile.getEnvironmentVariables().size() );

        getProfileService().removeInstallationFromProfile( profile, mvnOpts1 );

        profile = getProfileService().getProfile( jdk1mvn205.getId() );
        assertNotNull( profile.getJdk() );
        assertEquals( 1, profile.getEnvironmentVariables().size() );

        getProfileService().removeInstallationFromProfile( profile, jdk2 );

        profile = getProfileService().getProfile( jdk1mvn205.getId() );
        assertNull( profile.getJdk() );
        assertEquals( 1, profile.getEnvironmentVariables().size() );

        getProfileService().removeInstallationFromProfile( profile, mvnOpts2 );
        profile = getProfileService().getProfile( jdk1mvn205.getId() );
        assertNull( profile.getJdk() );
        assertEquals( 0, profile.getEnvironmentVariables().size() );
    }
View Full Code Here

            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() );
            stored.setBuildAgentGroup( profile.getBuildAgentGroup() );
            profileDao.updateProfile( stored );
        }
        catch ( ContinuumStoreException e )
        {
            throw new ProfileException( e.getMessage(), e );
View Full Code Here

                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() );
            stored.setBuildAgentGroup( profile.getBuildAgentGroup() );
            profileDao.updateProfile( stored );
        }
        catch ( ContinuumStoreException e )
        {
            throw new ProfileException( e.getMessage(), e );
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

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.