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();