throws Exception
{
Continuum continuum = getContinuum();
RepositoryService service = (RepositoryService) lookup( RepositoryService.ROLE );
LocalRepository repository = new LocalRepository();
repository.setName( "defaultRepo" );
repository.setLocation( getTestFile( "target/default-repository" ).getAbsolutePath() );
repository = service.addLocalRepository( repository );
ProjectGroup group = new ProjectGroup();
group.setGroupId( "testGroup" );
group.setName( "testGroup" );
group.setLocalRepository( repository );
continuum.addProjectGroup( group );
ProjectGroup retrievedDefaultProjectGroup = continuum.getProjectGroupByGroupId( "testGroup" );
assertNotNull( retrievedDefaultProjectGroup.getLocalRepository() );
continuum.removeProjectGroup( retrievedDefaultProjectGroup.getId() );
try
{
continuum.getProjectGroupByGroupId( "testGroup" );
fail( "project group was not deleted" );
}
catch ( Exception e )
{
// should fail. do nothing.
}
LocalRepository retrievedRepository = service.getLocalRepository( repository.getId() );
assertNotNull( retrievedRepository );
assertEquals( repository, retrievedRepository );
}