diff options
author | Olivier Lamy <olamy@apache.org> | 2012-02-29 14:05:26 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-02-29 14:05:26 +0000 |
commit | ddca454de928cb5fca7bca934fa1b4c189e43464 (patch) | |
tree | c32ce6332bc902ce7401bfe4cfc30ea6c59025d1 /archiva-modules/archiva-base/archiva-repository-layer | |
parent | cc812c46653d3bed30c16e0c8f40d4fae4d86962 (diff) | |
download | archiva-ddca454de928cb5fca7bca934fa1b4c189e43464.tar.gz archiva-ddca454de928cb5fca7bca934fa1b4c189e43464.zip |
[MRM-1609] MetadataToolsTest fail in testGatherSnapshotVersionsA
Submitted by Eric Barboni.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1295115 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-repository-layer')
-rw-r--r-- | archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java index 5db1e95d3..49008eb0a 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java @@ -73,6 +73,10 @@ public class MetadataToolsTest public void testGatherSnapshotVersionsA() throws Exception { + removeProxyConnector( "test-repo", "apache-snapshots" ); + removeProxyConnector( "test-repo", "internal-snapshots" ); + removeProxyConnector( "test-repo", "snapshots.codehaus.org" ); + assertSnapshotVersions( "snap_shots_a", "1.0-alpha-11-SNAPSHOT", new String[]{ "1.0-alpha-11-SNAPSHOT", "1.0-alpha-11-20070221.194724-2", "1.0-alpha-11-20070302.212723-3", "1.0-alpha-11-20070303.152828-4", @@ -548,6 +552,30 @@ public class MetadataToolsTest assertMetadata( buf.toString(), testRepo, reference ); } + private void removeProxyConnector( String sourceRepoId, String targetRepoId ) + { + ProxyConnectorConfiguration toRemove = null; + for (ProxyConnectorConfiguration pcc : config.getConfiguration().getProxyConnectors()) + { + if (pcc.getTargetRepoId().equals( targetRepoId ) && pcc.getSourceRepoId().equals( sourceRepoId )) + { + toRemove = pcc; + } + } + if (toRemove != null) + { + config.getConfiguration().removeProxyConnector(toRemove); + String prefix = "proxyConnectors.proxyConnector(" + "1" + ")"; // XXX + config.triggerChange( prefix + ".sourceRepoId", toRemove.getSourceRepoId() ); + config.triggerChange( prefix + ".targetRepoId", toRemove.getTargetRepoId() ); + config.triggerChange( prefix + ".proxyId", toRemove.getProxyId() ); + config.triggerChange( prefix + ".policies.releases", toRemove.getPolicy( "releases", "" ) ); + config.triggerChange( prefix + ".policies.checksum", toRemove.getPolicy( "checksum", "" ) ); + config.triggerChange( prefix + ".policies.snapshots", toRemove.getPolicy( "snapshots", "" ) ); + config.triggerChange( prefix + ".policies.cache-failures", toRemove.getPolicy( "cache-failures", "" ) ); + } + } + private void createProxyConnector( String sourceRepoId, String targetRepoId ) { ProxyConnectorConfiguration connectorConfig = new ProxyConnectorConfiguration(); |