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

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


    }

    public void testAddInstallation()
        throws Exception
    {
        Installation added = this.addInstallation( NEW_INSTALLATION_NAME, null, "bar", InstallationService.JDK_TYPE );
        Installation getted = getInstallationService().getInstallation( added.getInstallationId() );
        assertNotNull( getted );
        assertEquals( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), getted.getVarName() );
        assertEquals( "bar", getted.getVarValue() );
        assertEquals( 1, getInstallationService().getAllInstallations().size() );
        assertNotNull( getInstallationService().getInstallation( NEW_INSTALLATION_NAME ) );
    }
View Full Code Here


    }

    public void testAddDuplicateInstallation()
        throws Exception
    {
        Installation added = this.addInstallation( NEW_INSTALLATION_NAME, null, "bar", InstallationService.JDK_TYPE );
        Installation getted = getInstallationService().getInstallation( added.getInstallationId() );
        assertNotNull( getted );
        assertEquals( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), getted.getVarName() );
        assertEquals( "bar", getted.getVarValue() );
        try
        {
            this.addInstallation( NEW_INSTALLATION_NAME, null, "bar", InstallationService.JDK_TYPE );
            fail( "not in AlreadyExistsInstallationException" );
        }
View Full Code Here

    public void testRemove()
        throws Exception
    {
        String name = "toremove";
        Installation added = this.addInstallation( name, "foo", "bar", InstallationService.JDK_TYPE );
        Installation getted = getInstallationService().getInstallation( added.getInstallationId() );
        assertNotNull( getted );
        getInstallationService().delete( getted );
        getted = getInstallationService().getInstallation( added.getInstallationId() );
        assertNull( getted );
View Full Code Here

    public void testUpdate()
        throws Exception
    {
        String name = "toupdate";
        Installation added = this.addInstallation( name, "foo", "bar", InstallationService.JDK_TYPE );
        Installation getted = getInstallationService().getInstallation( added.getInstallationId() );
        assertNotNull( getted );
        assertEquals( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), getted.getVarName() );
        assertEquals( "bar", getted.getVarValue() );
        getted.setVarName( "updatefoo" );
        getted.setVarValue( "updatedbar" );
        getInstallationService().update( getted );
        getted = getInstallationService().getInstallation( added.getInstallationId() );
        assertNotNull( getted );
        assertEquals( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), getted.getVarName() );
        assertEquals( "updatedbar", getted.getVarValue() );
    }
View Full Code Here

        String javaHome = System.getenv( "JAVA_HOME" );
        if ( StringUtils.isEmpty( javaHome ) )
        {
            javaHome = System.getProperty( "java.home" );
        }
        Installation installation = new Installation();
        installation.setName( "test" );
        installation.setType( InstallationService.JDK_TYPE );
        installation.setVarValue( javaHome );

        List<String> infos = installationService.getJdkInformations( installation );
        assertNotNull( infos );
    }
View Full Code Here

    public void testAddInstallationAutomaticProfile()
        throws Exception
    {

        Installation installation = new Installation();
        installation.setType( InstallationService.JDK_TYPE );
        installation.setName( "automaticJdk" );
        installation.setVarName( "automaticvarName" );
        installation.setVarValue( "automaticvarValue" );
        getInstallationService().add( installation, true );
        ProfileService profileService = (ProfileService) lookup( ProfileService.ROLE, "default" );
        List<Profile> profiles = profileService.getAllProfiles();
        assertEquals( 1, profiles.size() );
        Profile profile = profiles.get( 0 );
        assertEquals( "automaticJdk", profile.getName() );
        Installation jdk = profile.getJdk();
        assertNotNull( jdk );
        assertEquals( "automaticJdk", jdk.getName() );
    }
View Full Code Here

    }

    public void testUpdateName()
        throws Exception
    {
        Installation installation = new Installation();
        installation.setType( InstallationService.JDK_TYPE );
        installation.setName( "automatic" );
        installation.setVarName( "automaticvarName" );
        installation.setVarValue( "automaticvarValue" );
        installation = getInstallationService().add( installation, true );

        installation.setName( "new name here" );
        getInstallationService().update( installation );

        Installation getted = getInstallationService().getInstallation( installation.getInstallationId() );
        assertEquals( "new name here", getted.getName() );


    }
View Full Code Here

    }

    public String addInstallation()
        throws Exception
    {
        Installation installation = installationService.getInstallation( this.getInstallationId() );
        if ( installation != null )
        {
            profileService.addInstallationInProfile( profile, installation );
            // read again
            this.profile = profileService.getProfile( profile.getId() );
View Full Code Here

    public String removeInstallation()
        throws Exception
    {

        Installation installation = installationService.getInstallation( this.getInstallationId() );
        profileService.removeInstallationFromProfile( profile, installation );
        this.profile = profileService.getProfile( profile.getId() );
        return SUCCESS;
    }
View Full Code Here

    public String input()
        throws Exception
    {
        if ( InstallationService.ENVVAR_TYPE.equalsIgnoreCase( this.getInstallationType() ) )
        {
            this.installation = new Installation();
            this.installation.setType( InstallationService.ENVVAR_TYPE );
            this.setDisplayTypes( false );
            this.setVarNameUpdatable( true );
            this.setVarNameDisplayable( true );
        }
View Full Code Here

TOP

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

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.