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

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


        return listeners;
    }

    private String getJavaHomeValue( Profile profile )
    {
        Installation jdk = profile.getJdk();
        if ( jdk == null )
        {
            return null;
        }
        return jdk.getVarValue();
    }
View Full Code Here


        {
            // from expected.xml, continuum-data-management
            testSchedule3.setId( 3 );
        }

        Installation installationJava14 = createTestInstallation( testInstallationJava14 );
        if ( addToStore )
        {
            installationJava14 = installationDao.addInstallation( installationJava14 );
        }
        else
        {
            installationJava14.setInstallationId( 1 );
        }

        Installation installationMaven20a3 = createTestInstallation( testInstallationMaven20a3 );
        if ( addToStore )
        {
            installationMaven20a3 = installationDao.addInstallation( installationMaven20a3 );
        }
        else
        {
            installationMaven20a3.setInstallationId( 2 );
        }

        Installation installationJava13 = createTestInstallation( testInstallationJava13 );
        if ( addToStore )
        {
            installationJava13 = installationDao.addInstallation( installationJava13 );
        }
        else
        {
            installationJava13.setInstallationId( 3 );
        }

        testProfile1 =
            createTestProfile( "name1", "description1", 1, true, true, installationJava13, installationMaven20a3 );
        testProfile2 =
View Full Code Here

        return result;
    }

    protected static Installation createTestInstallation( String name, String type, String varName, String varValue )
    {
        Installation installation = new Installation();
        installation.setName( name );
        installation.setType( type );
        installation.setVarName( varName );
        installation.setVarValue( varValue );
        return installation;
    }
View Full Code Here

        }

        Map<Integer, Installation> installations = new HashMap<Integer, Installation>();
        for ( Iterator i = database.getInstallations().iterator(); i.hasNext(); )
        {
            Installation installation = (Installation) i.next();

            installation = (Installation) PlexusJdoUtils.addObject( pmf.getPersistenceManager(), installation );
            installations.put( Integer.valueOf( installation.getInstallationId() ), installation );
        }

        Map<Integer, Profile> profiles = new HashMap<Integer, Profile>();
        for ( Iterator i = database.getProfiles().iterator(); i.hasNext(); )
        {
View Full Code Here

        {
            throw new AlreadyExistsInstallationException(
                "Installation with name " + installation.getName() + " already exists" );
        }
        // TODO must be done in the same transaction
        Installation storedOne = null;
        try
        {
            String envVarName = this.getEnvVar( installation.getType() );
            // override with the defined var name for defined types
            if ( StringUtils.isNotEmpty( envVarName ) )
            {
                installation.setVarName( envVarName );
            }
            storedOne = installationDao.addInstallation( installation );
        }
        catch ( ContinuumStoreException e )
        {
            throw new InstallationException( e.getMessage(), e );
        }
        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

    public void update( Installation installation )
        throws InstallationException
    {
        try
        {
            Installation stored = getInstallation( installation.getInstallationId() );
            if ( stored == null )
            {
                throw new InstallationException( "installation with name " + installation.getName() + " not exists" );
            }

            stored.setName( installation.getName() );
            stored.setType( installation.getType() );
            String envVarName = this.getEnvVar( installation.getType() );
            // override with the defined var name for defined types
            if ( StringUtils.isNotEmpty( envVarName ) )
            {
                installation.setVarName( envVarName );
            }
            else
            {
                stored.setVarName( installation.getVarName() );
            }
            stored.setVarValue( installation.getVarValue() );
            installationDao.updateInstallation( stored );
        }
        catch ( ContinuumStoreException e )
        {
            throw new InstallationException( e.getMessage(), e );
View Full Code Here

        }*/
    }

    private Installation createDefaultInstallation()
    {
        Installation installation = new Installation();
        installation.setType( "description" );
        installation.setName( DEFAULT_INSTALLATION_NAME );
        installation.setVarName( "varName" );
        installation.setVarValue( "varValue" );
        return installation;
    }
View Full Code Here

    private Installation addInstallation( String name, String varName, String varValue, String type )
        throws Exception
    {

        Installation installation = new Installation();
        installation.setType( InstallationService.JDK_TYPE );
        installation.setName( name );
        installation.setVarName( varName );
        installation.setVarValue( varValue );
        return getInstallationService().add( installation );
    }
View Full Code Here

    }

    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() );
    }
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
        {
            added = this.addInstallation( NEW_INSTALLATION_NAME, null, "bar", InstallationService.JDK_TYPE );
            fail( "not in AlreadyExistsInstallationException" );
        }
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.