{
super.setUp();
String appserverBase = System.getProperty( "appserver.base" );
Configuration configuration = archivaConfiguration.getConfiguration();
repoRootFirst = new File( appserverBase, "data/repositories/" + MANAGED_REPO_FIRST );
repoRootLast = new File( appserverBase, "data/repositories/" + MANAGED_REPO_LAST );
configuration.addManagedRepository(
createManagedRepository( MANAGED_REPO_FIRST, "First Test Repo", repoRootFirst, true ) );
configuration.addManagedRepository(
createManagedRepository( MANAGED_REPO_LAST, "Last Test Repo", repoRootLast, true ) );
List<String> managedRepoIds = new ArrayList<String>();
managedRepoIds.add( MANAGED_REPO_FIRST );
managedRepoIds.add( MANAGED_REPO_LAST );
configuration.addRepositoryGroup( createRepositoryGroup( REPO_GROUP_WITH_VALID_REPOS, managedRepoIds ) );
// Create the repository group with an invalid managed repository
repoRootInvalid = new File( appserverBase, "data/repositories/" + MANAGED_REPO_INVALID );
ManagedRepositoryConfiguration managedRepositoryConfiguration =
createManagedRepository( MANAGED_REPO_INVALID, "Invalid Test Repo", repoRootInvalid, true );
configuration.addManagedRepository(
createManagedRepository( MANAGED_REPO_FIRST, "First Test Repo", repoRootFirst, true ) );
configuration.addManagedRepository( managedRepositoryConfiguration );
configuration.addManagedRepository(
createManagedRepository( MANAGED_REPO_LAST, "Last Test Repo", repoRootLast, true ) );
List<String> invalidManagedRepoIds = new ArrayList<String>();
invalidManagedRepoIds.add( MANAGED_REPO_FIRST );
invalidManagedRepoIds.add( MANAGED_REPO_INVALID );
invalidManagedRepoIds.add( MANAGED_REPO_LAST );
configuration.addRepositoryGroup(
createRepositoryGroup( REPO_GROUP_WITH_INVALID_REPOS, invalidManagedRepoIds ) );
configuration.removeManagedRepository( managedRepositoryConfiguration );
FileUtils.deleteDirectory( repoRootInvalid );
saveConfiguration( archivaConfiguration );
}