assertMetadata( buf.toString(), testRepo, reference );
}
private void createProxyConnector( String sourceRepoId, String targetRepoId )
{
ProxyConnectorConfiguration connectorConfig = new ProxyConnectorConfiguration();
connectorConfig.setSourceRepoId( sourceRepoId );
connectorConfig.setTargetRepoId( targetRepoId );
connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CHECKSUM, ChecksumPolicy.IGNORE );
connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, ReleasesPolicy.ALWAYS );
connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, SnapshotsPolicy.ALWAYS );
connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CACHE_FAILURES, CachedFailuresPolicy.NO );
int count = config.getConfiguration().getProxyConnectors().size();
config.getConfiguration().addProxyConnector( connectorConfig );
// Proper Triggering ...
String prefix = "proxyConnectors.proxyConnector(" + count + ")";
config.triggerChange( prefix + ".sourceRepoId", connectorConfig.getSourceRepoId() );
config.triggerChange( prefix + ".targetRepoId", connectorConfig.getTargetRepoId() );
config.triggerChange( prefix + ".proxyId", connectorConfig.getProxyId() );
config.triggerChange( prefix + ".policies.releases", connectorConfig.getPolicy( "releases", "" ) );
config.triggerChange( prefix + ".policies.checksum", connectorConfig.getPolicy( "checksum", "" ) );
config.triggerChange( prefix + ".policies.snapshots", connectorConfig.getPolicy( "snapshots", "" ) );
config.triggerChange( prefix + ".policies.cache-failures", connectorConfig.getPolicy( "cache-failures", "" ) );
}