bd.setBuildFile( "pom.xml" );
bd.setType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );
BuildDefinitionService service = (BuildDefinitionService) lookup( BuildDefinitionService.class );
bd = service.addBuildDefinition( bd );
BuildDefinitionTemplate bdt = new BuildDefinitionTemplate();
bdt.setName( "maven2" );
bdt = service.addBuildDefinitionTemplate( bdt );
bdt = service.addBuildDefinitionInTemplate( bdt, bd, false );
assertEquals( 5, service.getAllBuildDefinitionTemplate().size() );
logger.debug( "templates number " + service.getAllBuildDefinitionTemplate().size() );
logger.debug( "projectGroups number " + getProjectGroupDao().getAllProjectGroups().size() );
int all = service.getAllBuildDefinitions().size();
ContinuumProjectBuildingResult result;
result = projectBuilder.buildProjectsFromMetadata( url, null, null, false, bdt );
assertFalse( result.hasErrors() );
assertEquals( 5, service.getAllBuildDefinitionTemplate().size() );
assertEquals( all + 1, service.getAllBuildDefinitions().size() );
assertNotNull( result );
assertNotNull( result.getErrors() );