public void testAddProjectToExistingGroupDefaultBuildDef()
throws Exception
{
ProjectGroup pg = new ProjectGroup();
pg.setName( "foo" );
pg.setDescription( "foo pg" );
getContinuum().addProjectGroup( pg );
pg = getContinuum().getAllProjectGroups().get( 1 );
assertEquals( 2, getContinuum().getAllProjectGroups().size() );
File rootPom = getTestFile( "src/test/resources/projects/continuum/continuum-core/pom.xml" );
assertTrue( rootPom.exists() );
//String url = getTestFile( "src/test-projects/project1/pom.xml" ).toURL().toExternalForm();
ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
rootPom.toURI().toURL()
.toExternalForm(), pg.getId(),
true, false, false, -1 );
assertNotNull( result );
assertEquals( 1, result.getProjects().size() );
Project project = result.getProjects().get( 0 );
project = getContinuum().getProjectWithBuildDetails( project.getId() );
assertNotNull( project );
pg = getContinuum().getProjectGroupWithBuildDetails( pg.getId() );
log.info( "project buildDef list size : " + project.getBuildDefinitions().size() );
assertEquals( 0, project.getBuildDefinitions().size() );
pg = result.getProjectGroups().get( 0 );
pg = getContinuum().getProjectGroupWithBuildDetails( pg.getId() );
assertEquals( "clean install", ( (BuildDefinition) pg.getBuildDefinitions().get( 0 ) ).getGoals() );
}