Package org.apache.continuum.configuration

Examples of org.apache.continuum.configuration.BuildAgentConfiguration


        }

        List<BuildAgentConfiguration> selectedbuildAgents = new ArrayList<BuildAgentConfiguration>();
        for ( String ids : selectedBuildAgentIds )
        {
            BuildAgentConfiguration buildAgent = getContinuum().getConfiguration().getBuildAgent( ids );
            if ( buildAgent != null )
            {
                selectedbuildAgents.add( buildAgent );
            }
        }
View Full Code Here


   
    public void testGetEnvironmentsDefaultAgentInGroup()
        throws Exception
    {
        BuildAgentGroupConfiguration buildAgentGroup = createBuildAgentGroupConfiguration( true );
        buildAgentGroup.addBuildAgent( new BuildAgentConfiguration( defaultBuildagentUrl, "Default Build Agent", true ) );
       
        continuumMock.expects( atLeastOnce() ).method( "getConfiguration" ).will( returnValue( configurationServiceMock.proxy() ) );
        configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgentGroup" ).will( returnValue( buildAgentGroup ) );
       
        action.getEnvironments();
View Full Code Here

   
    public void testGetEnvironmentsNoEnabledAgentInGroup()
        throws Exception
    {
        BuildAgentGroupConfiguration buildAgentGroup = createBuildAgentGroupConfiguration( false );
        buildAgentGroup.addBuildAgent( new BuildAgentConfiguration( defaultBuildagentUrl, "Default Build Agent", false ) );
       
        continuumMock.expects( atLeastOnce() ).method( "getConfiguration" ).will( returnValue( configurationServiceMock.proxy() ) );
        configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgentGroup" ).will( returnValue( buildAgentGroup ) );
       
        action.getEnvironments();
View Full Code Here

        assertNull( "Build agent should be empty.", buildagent );
    }
   
    private BuildAgentGroupConfiguration createBuildAgentGroupConfiguration( boolean isAgentEnabled )
    {
        BuildAgentConfiguration buildagent1 = new BuildAgentConfiguration( "http://localhost:9191/continuum-buildagent/xmlrpc",
                                                                               "Other Build Agent", isAgentEnabled );
        BuildAgentConfiguration buildagent2 = new BuildAgentConfiguration( "http://localhost:9292/continuum-buildagent/xmlrpc",
                                                                               "Other Build Agent", isAgentEnabled );
       
        List<BuildAgentConfiguration> buildAgents = new ArrayList<BuildAgentConfiguration>();
        buildAgents.add( buildagent1 );
        buildAgents.add( buildagent2 );
View Full Code Here

            PREPARED_RELEASES_FILENAME );
    }

    private boolean checkBuildAgent( String buildAgentUrl )
    {
        BuildAgentConfiguration buildAgent = configurationService.getBuildAgent( buildAgentUrl );

        if ( buildAgent != null && buildAgent.isEnabled() )
        {
            return true;
        }

        log.info( "Build agent: " + buildAgentUrl + " is either disabled or removed" );
View Full Code Here

        init();
    }

    private void init()
    {
        buildAgent1 = new BuildAgentConfiguration();
        buildAgent1.setEnabled( true );
        buildAgent1.setUrl( TEST_BUILD_AGENT1 );

        buildAgent2 = new BuildAgentConfiguration();
        buildAgent2.setEnabled( true );
        buildAgent2.setUrl( TEST_BUILD_AGENT2 );

        List<BuildAgentConfiguration> buildAgents = new ArrayList<BuildAgentConfiguration>();
        buildAgents.add( buildAgent1 );
View Full Code Here

        assertEquals( "check # build agents", 1, service.getBuildAgents().size() );

        service.setUrl( "http://test/zloug" );
        service.setBuildOutputDirectory( new File( "testBuildOutputDir" ) );

        BuildAgentConfiguration buildAgent = new BuildAgentConfiguration( "http://test/xmlrpc", "windows", false );
        service.addBuildAgent( buildAgent );

        service.store();

        String contents = FileUtils.fileRead( conf );
        //assertTrue( contents.indexOf( "http://test/zloug" ) > 0 );

        service.reload();

        assertEquals( "http://test/zloug", service.getUrl() );
        assertEquals( "check # build agents", 2, service.getBuildAgents().size() );
        assertEquals( "http://test/xmlrpc", service.getBuildAgents().get( 1 ).getUrl() );
        assertEquals( "windows", service.getBuildAgents().get( 1 ).getDescription() );
        assertFalse( service.getBuildAgents().get( 1 ).isEnabled() );

        assertEquals( "http://test/xmlrpc", buildAgent.getUrl() );
        service.removeBuildAgent( buildAgent );
        service.store();
        service.reload();

        assertEquals( "check # build agents", 1, service.getBuildAgents().size() );
        assertEquals( "http://buildagent/xmlrpc", service.getBuildAgents().get( 0 ).getUrl() );
        assertEquals( "linux", service.getBuildAgents().get( 0 ).getDescription() );
        assertTrue( service.getBuildAgents().get( 0 ).isEnabled() );

        BuildAgentGroupConfiguration buildAgentGroup = new BuildAgentGroupConfiguration();
        buildAgentGroup.setName( "group-1" );
        buildAgentGroup.addBuildAgent( buildAgent );
        service.addBuildAgentGroup( buildAgentGroup );

        service.store();
        service.reload();
        assertEquals( "check # build agent groups", 1, service.getBuildAgentGroups().size() );
        assertEquals( "group-1", service.getBuildAgentGroups().get( 0 ).getName() );
        assertEquals( "windows", service.getBuildAgentGroups().get( 0 ).getBuildAgents().get( 0 ).getDescription() );

        BuildAgentConfiguration buildAgent2 = new BuildAgentConfiguration( "http://machine-1/xmlrpc", "node-1", true );
        //buildAgentGroup.addBuildAgent( buildAgent2 );
        service.addBuildAgent( buildAgentGroup, buildAgent2 );

        service.store();
        service.reload();
View Full Code Here

            }
        }
        else
        {
            type = "new";
            buildAgent = new BuildAgentConfiguration();
            buildAgent.setEnabled( true );
        }

        return INPUT;
    }
View Full Code Here

        }

        List<BuildAgentConfiguration> selectedbuildAgents = new ArrayList<BuildAgentConfiguration>();
        for ( String ids : selectedBuildAgentIds )
        {
            BuildAgentConfiguration buildAgent = getContinuum().getConfiguration().getBuildAgent( ids );
            if ( buildAgent != null )
            {
                selectedbuildAgents.add( buildAgent );
            }
        }
View Full Code Here

        assertEquals( "check # build agents", 1, service.getBuildAgents().size() );
       
        service.setUrl( "http://test/zloug" );
        service.setBuildOutputDirectory( new File( "testBuildOutputDir" ) );

        BuildAgentConfiguration buildAgent = new BuildAgentConfiguration( "http://test/xmlrpc", "windows", false );
        service.addBuildAgent( buildAgent );

        service.store();

        String contents = FileUtils.fileRead( conf );
        //assertTrue( contents.indexOf( "http://test/zloug" ) > 0 );

        service.reload();

        assertEquals( "http://test/zloug", service.getUrl() );
        assertEquals( "check # build agents", 2, service.getBuildAgents().size() );       
        assertEquals( "http://test/xmlrpc", service.getBuildAgents().get( 1 ).getUrl() );
        assertEquals( "windows", service.getBuildAgents().get( 1 ).getDescription() );
        assertFalse( service.getBuildAgents().get( 1 ).isEnabled() );

        assertEquals( "http://test/xmlrpc", buildAgent.getUrl() );
        service.removeBuildAgent( buildAgent );
        service.store();
        service.reload();

        assertEquals( "check # build agents", 1, service.getBuildAgents().size() );
View Full Code Here

TOP

Related Classes of org.apache.continuum.configuration.BuildAgentConfiguration

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.