ContinuumProjectBuilder projectBuilder =
(ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID );
URL url = getClass().getClassLoader().getResource( "projects/continuum/pom_ci.xml" );
ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata( url, null, null );
assertNotNull( result );
// ----------------------------------------------------------------------
// Assert the warnings
// ----------------------------------------------------------------------
assertNotNull( result.getErrors() );
assertEquals( 1, result.getErrors().size() );
assertEquals( ContinuumProjectBuildingResult.ERROR_POM_NOT_FOUND, result.getErrors().get( 0 ) );
// ----------------------------------------------------------------------
// Assert the project group built
// ----------------------------------------------------------------------
assertNotNull( result.getProjectGroups() );
assertEquals( 1, result.getProjectGroups().size() );
ProjectGroup projectGroup = result.getProjectGroups().iterator().next();
assertEquals( "projectGroup.groupId", "org.apache.maven.continuum", projectGroup.getGroupId() );
assertEquals( "projectGroup.name", "Continuum Parent Project", projectGroup.getName() );
assertEquals( "projectGroup.description", "Continuum Project Description", projectGroup.getDescription() );
// assertEquals( "projectGroup.url", "http://cvs.continuum.codehaus.org/", projectGroup.getUrl() );
// ----------------------------------------------------------------------
// Assert the projects built
// ----------------------------------------------------------------------
assertNotNull( result.getProjects() );
assertEquals( 9, result.getProjects().size() );
Map<String, Project> projects = new HashMap<String, Project>();
for ( Project project : result.getProjects() )
{
assertNotNull( project.getName() );
projects.put( project.getName(), project );
}