}
private void setupDefaultRepository()
throws Exception
{
repository = new LocalRepository();
repository.setName( "DefaultRepo" );
repository.setLocation( getTestFile( "target/default-repo" ).getAbsolutePath() );
repository = repositoryService.addLocalRepository( repository );
ProjectGroup group = getDefaultProjectGroup();
group.setLocalRepository( repository );
getProjectGroupDao().updateProjectGroup( group );
RepositoryPurgeConfiguration repoConfig = new RepositoryPurgeConfiguration();
repoConfig.setRepository( repository );
repoConfig = repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( repoConfig );
List<LocalRepository> repositories = repositoryService.getAllLocalRepositories();
assertEquals( "check # repositories", 1, repositories.size() );
assertTrue( "check if repository was added", repositories.contains( repository ) );
LocalRepository repo = repositoryService.getLocalRepositoryByName( "DefaultRepo" );
assertNotNull( repo );
assertEquals( "check if repository name is the same", repository.getName(), repo.getName() );
repo = repositoryService.getLocalRepositoryByLocation( repository.getLocation() );
assertNotNull( repo );
assertEquals( "check if repository location is the same", repository.getLocation(), repo.getLocation() );
ProjectGroup retrievedGroup = getDefaultProjectGroup();
assertNotNull( retrievedGroup.getLocalRepository() );
assertEquals( "check if repository is the same", repository, retrievedGroup.getLocalRepository() );