assertEquals( TEST_TARGET_ID, connector.getTargetRepoId() );
}
private Configuration createInitialConfiguration()
{
Configuration config = new Configuration();
ManagedRepositoryConfiguration managedRepo = new ManagedRepositoryConfiguration();
managedRepo.setId( TEST_SOURCE_ID );
managedRepo.setLayout( "${java.io.tmpdir}/archiva-test/managed-repo" );
managedRepo.setReleases( true );
config.addManagedRepository( managedRepo );
RemoteRepositoryConfiguration remoteRepo = new RemoteRepositoryConfiguration();
remoteRepo.setId( TEST_TARGET_ID );
remoteRepo.setUrl( "http://repo1.maven.org/maven2/" );
config.addRemoteRepository( remoteRepo );
ProxyConnectorConfiguration connector = new ProxyConnectorConfiguration();
connector.setSourceRepoId( TEST_SOURCE_ID );
connector.setTargetRepoId( TEST_TARGET_ID );
// TODO: Set these options programatically via list of available policies.
connector.getPolicies().put( "releases", new ReleasesPolicy().getDefaultOption() );
connector.getPolicies().put( "snapshots", new SnapshotsPolicy().getDefaultOption() );
connector.getPolicies().put( "checksum", new ChecksumPolicy().getDefaultOption() );
connector.getPolicies().put( "cache-failures", new CachedFailuresPolicy().getDefaultOption() );
config.addProxyConnector( connector );
return config;
}