diff options
Diffstat (limited to 'archiva-base/archiva-proxy')
-rw-r--r-- | archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MockConfiguration.java | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MockConfiguration.java b/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MockConfiguration.java index 69f3ce3f4..08e4d2740 100644 --- a/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MockConfiguration.java +++ b/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MockConfiguration.java @@ -21,13 +21,14 @@ package org.apache.maven.archiva.proxy; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.ConfigurationListener; import org.codehaus.plexus.registry.Registry; import org.codehaus.plexus.registry.RegistryException; import org.codehaus.plexus.registry.RegistryListener; import org.easymock.MockControl; -import java.util.ArrayList; -import java.util.List; +import java.util.HashSet; +import java.util.Set; /** * MockConfiguration @@ -43,7 +44,8 @@ public class MockConfiguration { private Configuration configuration = new Configuration(); - private List<RegistryListener> listeners = new ArrayList<RegistryListener>(); + private Set<RegistryListener> registryListeners = new HashSet<RegistryListener>(); + private Set<ConfigurationListener> configListeners = new HashSet<ConfigurationListener>(); private MockControl registryControl; @@ -57,7 +59,7 @@ public class MockConfiguration public void addChangeListener( RegistryListener listener ) { - listeners.add( listener ); + registryListeners.add( listener ); } public Configuration getConfiguration() @@ -73,7 +75,7 @@ public class MockConfiguration public void triggerChange( String name, String value ) { - for( RegistryListener listener: listeners ) + for(RegistryListener listener: registryListeners) { try { @@ -85,4 +87,14 @@ public class MockConfiguration } } } + + public void addListener( ConfigurationListener listener ) + { + configListeners.add(listener); + } + + public void removeListener( ConfigurationListener listener ) + { + configListeners.remove( listener ); + } } |