From 8152eb5642e2f9639a466da9f0db512e85e77e1b Mon Sep 17 00:00:00 2001 From: James William Dumay Date: Thu, 20 Nov 2008 04:13:50 +0000 Subject: [PATCH] MRM-1015 - Move consumers and related API's to Spring RepositoryContentConsumers needed to be ported over as a spring component so that we can use the ApplicationContextAware interface. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@719157 13f79535-47bb-0310-9956-ffa450edef68 --- .../ArtifactMissingChecksumsConsumer.java | 42 ++-- .../resources/META-INF/spring-context.xml | 29 +++ .../ArtifactMissingChecksumsConsumerTest.java | 6 +- .../archiva-repository-layer/pom.xml | 4 + .../scanner/RepositoryContentConsumers.java | 73 ++----- .../resources/META-INF/spring-context.xml | 11 + .../RepositoryContentConsumersStub.java | 9 +- .../RepositoryContentConsumersTest.java | 190 +++++++++++++++++- .../maven/archiva/webdav/DavResourceTest.java | 2 +- .../StubRepositoryContentConsumers.java | 8 + .../webdav/RepositoryServletSecurityTest.xml | 8 - .../archiva/webdav/RepositoryServletTest.xml | 8 - 12 files changed, 279 insertions(+), 111 deletions(-) create mode 100644 archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/resources/META-INF/spring-context.xml create mode 100644 archiva-modules/archiva-base/archiva-repository-layer/src/main/resources/META-INF/spring-context.xml diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java index 5513cf3cc..9befcbf5f 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java @@ -19,8 +19,6 @@ package org.apache.maven.archiva.consumers.core; * under the License. */ -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ConfigurationNames; import org.apache.maven.archiva.configuration.FileTypes; @@ -46,47 +44,23 @@ import java.util.List; * ArtifactMissingChecksumsConsumer - Create missing checksums for the artifact. * * @version $Id$ - * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" - * role-hint="create-missing-checksums" - * instantiation-strategy="per-lookup" */ public class ArtifactMissingChecksumsConsumer extends AbstractMonitoredConsumer implements KnownRepositoryContentConsumer, RegistryListener, Initializable { - /** - * @plexus.configuration default-value="create-missing-checksums" - */ private String id; - /** - * @plexus.configuration default-value="Create Missing Checksums (.sha1 & .md5)" - */ private String description; - /** - * @plexus.requirement - */ private ArchivaConfiguration configuration; - /** - * @plexus.requirement - */ private FileTypes filetypes; - /** - * @plexus.requirement role-hint="sha1" - */ private Digester digestSha1; - /** - * @plexus.requirement role-hint="md5"; - */ private Digester digestMd5; - /** - * @plexus.requirement - */ private ChecksumFile checksum; private static final String TYPE_CHECKSUM_NOT_FILE = "checksum-bad-not-file"; @@ -99,6 +73,22 @@ public class ArtifactMissingChecksumsConsumer private List includes = new ArrayList(); + public ArtifactMissingChecksumsConsumer(String id, + String description, + ArchivaConfiguration configuration, + FileTypes filetypes, + Digester digestSha1, + Digester digestMd5, + ChecksumFile checksum) { + this.id = id; + this.description = description; + this.configuration = configuration; + this.filetypes = filetypes; + this.digestSha1 = digestSha1; + this.digestMd5 = digestMd5; + this.checksum = checksum; + } + public String getId() { return this.id; diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/resources/META-INF/spring-context.xml new file mode 100644 index 000000000..70d85196f --- /dev/null +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/resources/META-INF/spring-context.xml @@ -0,0 +1,29 @@ + + + + + + create-missing-checksums + + + Create Missing Checksums (.sha1, .md5) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumerTest.java index 42f84d39e..d97e0b0b6 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumerTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumerTest.java @@ -19,17 +19,15 @@ package org.apache.maven.archiva.consumers.core; * under the License. */ -import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; - public class ArtifactMissingChecksumsConsumerTest extends AbstractArtifactConsumerTest { + @Override protected void setUp() throws Exception { super.setUp(); - consumer = (ArtifactMissingChecksumsConsumer) lookup( KnownRepositoryContentConsumer.class.getName(), - "create-missing-checksums" ); + consumer = (ArtifactMissingChecksumsConsumer) lookup( "artifactMissingChecksumsConsumer" ); } } diff --git a/archiva-modules/archiva-base/archiva-repository-layer/pom.xml b/archiva-modules/archiva-base/archiva-repository-layer/pom.xml index 998863313..15411bd4c 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/pom.xml +++ b/archiva-modules/archiva-base/archiva-repository-layer/pom.xml @@ -56,6 +56,10 @@ org.apache.archiva archiva-xml-tools + + org.springframework + spring-context + xmlunit xmlunit diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java index c62612d85..83042e287 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java @@ -38,39 +38,36 @@ import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; import org.apache.maven.archiva.repository.scanner.functors.ConsumerProcessFileClosure; import org.apache.maven.archiva.repository.scanner.functors.ConsumerWantsFilePredicate; import org.apache.maven.archiva.repository.scanner.functors.TriggerBeginScanClosure; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; /** * RepositoryContentConsumerUtil * * @version $Id$ - * - * @plexus.component role="org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers" */ -public class RepositoryContentConsumers +public class RepositoryContentConsumers implements ApplicationContextAware { - private Logger log = LoggerFactory.getLogger( RepositoryContentConsumers.class ); + private ApplicationContext applicationContext; - /** - * @plexus.requirement - */ private ArchivaConfiguration archivaConfiguration; - /** - * @plexus.requirement role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" - */ - private List availableKnownConsumers; - - /** - * @plexus.requirement role="org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer" - */ - private List availableInvalidConsumers; - private List selectedKnownConsumers; private List selectedInvalidConsumers; - + + public RepositoryContentConsumers(ArchivaConfiguration archivaConfiguration) + { + this.archivaConfiguration = archivaConfiguration; + } + + public void setApplicationContext(ApplicationContext applicationContext) + throws BeansException + { + this.applicationContext = applicationContext; + } + /** *

* Get the list of Ids associated with those {@link KnownRepositoryContentConsumer} that have @@ -160,7 +157,7 @@ public class RepositoryContentConsumers List knownSelected = getSelectedKnownConsumerIds(); - for ( KnownRepositoryContentConsumer consumer : availableKnownConsumers ) + for ( KnownRepositoryContentConsumer consumer : getAvailableKnownConsumers() ) { if ( knownSelected.contains( consumer.getId() ) || consumer.isPermanent() ) { @@ -187,7 +184,7 @@ public class RepositoryContentConsumers List invalidSelected = getSelectedInvalidConsumerIds(); - for ( InvalidRepositoryContentConsumer consumer : availableInvalidConsumers ) + for ( InvalidRepositoryContentConsumer consumer : getAvailableInvalidConsumers() ) { if ( invalidSelected.contains( consumer.getId() ) || consumer.isPermanent() ) { @@ -208,7 +205,7 @@ public class RepositoryContentConsumers */ public List getAvailableKnownConsumers() { - return availableKnownConsumers; + return new ArrayList(applicationContext.getBeansOfType(KnownRepositoryContentConsumer.class).values()); } /** @@ -220,35 +217,7 @@ public class RepositoryContentConsumers */ public List getAvailableInvalidConsumers() { - return availableInvalidConsumers; - } - - /** - * Set the list of {@link KnownRepositoryContentConsumer} objects that are - * available. - * - * NOTE: This is an override for the base functionality as a component, this - * is used by archiva-cli and the unit testing framework. - * - * @return the list of available {@link KnownRepositoryContentConsumer}. - */ - public void setAvailableKnownConsumers( List availableKnownConsumers ) - { - this.availableKnownConsumers = availableKnownConsumers; - } - - /** - * Set the list of {@link InvalidRepositoryContentConsumer} objects that are - * available. - * - * NOTE: This is an override for the base functionality as a component, this - * is used by archiva-cli and the unit testing framework. - * - * @return the list of available {@link InvalidRepositoryContentConsumer}. - */ - public void setAvailableInvalidConsumers( List availableInvalidConsumers ) - { - this.availableInvalidConsumers = availableInvalidConsumers; + return new ArrayList(applicationContext.getBeansOfType(InvalidRepositoryContentConsumer.class).values()); } /** diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-repository-layer/src/main/resources/META-INF/spring-context.xml new file mode 100644 index 000000000..994559fdd --- /dev/null +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/resources/META-INF/spring-context.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersStub.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersStub.java index 8d3780c26..73ef2ca1a 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersStub.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersStub.java @@ -1,10 +1,17 @@ package org.apache.maven.archiva.repository.scanner; import java.util.Date; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; public class RepositoryContentConsumersStub extends RepositoryContentConsumers -{ +{ + public RepositoryContentConsumersStub(ArchivaConfiguration archivaConfiguration) + { + super(archivaConfiguration); + } + + @Override public Date getStartTime() { Date startTimeForTest = new Date( System.currentTimeMillis() ); diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java index 22e596abb..5717b2de7 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java @@ -19,6 +19,8 @@ package org.apache.maven.archiva.repository.scanner; * under the License. */ +import java.io.IOException; +import java.util.Locale; import org.apache.commons.lang.SystemUtils; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; @@ -31,8 +33,18 @@ import java.io.File; import java.util.Arrays; import java.util.Collections; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.Map; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.BeanFactory; +import org.springframework.beans.factory.NoSuchBeanDefinitionException; +import org.springframework.beans.factory.config.AutowireCapableBeanFactory; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationEvent; +import org.springframework.context.MessageSourceResolvable; +import org.springframework.context.NoSuchMessageException; +import org.springframework.core.io.Resource; /** * RepositoryContentConsumersTest @@ -45,17 +57,18 @@ public class RepositoryContentConsumersTest private RepositoryContentConsumers lookupRepositoryConsumers() throws Exception { - RepositoryContentConsumers consumerUtilStub = (RepositoryContentConsumers) lookup( RepositoryContentConsumers.class - .getName(), "test" ); - ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.ROLE ); + ArchivaConfiguration configuration = (ArchivaConfiguration)lookup(ArchivaConfiguration.class); + + RepositoryContentConsumers consumerUtilStub = new RepositoryContentConsumersStub(configuration); + RepositoryContentConsumers consumerUtil = (RepositoryContentConsumers) lookup( RepositoryContentConsumers.class .getName() ); - - consumerUtilStub.setAvailableKnownConsumers( consumerUtil.getAvailableKnownConsumers() ); - consumerUtilStub.setAvailableInvalidConsumers( consumerUtil.getAvailableInvalidConsumers() ); + ApplicationContext context = new MockApplicationContext(consumerUtil.getAvailableKnownConsumers(), consumerUtil.getAvailableInvalidConsumers()); + + consumerUtilStub.setApplicationContext(context); consumerUtilStub.setSelectedInvalidConsumers( consumerUtil.getSelectedInvalidConsumers() ); consumerUtilStub.setSelectedKnownConsumers( consumerUtil.getSelectedKnownConsumers() ); - consumerUtilStub.setArchivaConfiguration( archivaConfiguration ); + consumerUtilStub.setArchivaConfiguration( configuration ); assertNotNull( "RepositoryContentConsumers should not be null.", consumerUtilStub ); @@ -206,7 +219,9 @@ public class RepositoryContentConsumersTest KnownRepositoryContentConsumer unselectedKnownConsumer = (KnownRepositoryContentConsumer) MockControl.createNiceControl( KnownRepositoryContentConsumer.class ).getMock(); - consumers.setAvailableKnownConsumers( Arrays.asList( selectedKnownConsumer, unselectedKnownConsumer ) ); + + consumers.setApplicationContext(new MockApplicationContext(Arrays.asList( selectedKnownConsumer, unselectedKnownConsumer ), null)); + consumers.setSelectedKnownConsumers( Collections.singletonList( selectedKnownConsumer ) ); MockControl invalidControl = MockControl.createControl( InvalidRepositoryContentConsumer.class ); @@ -215,7 +230,9 @@ public class RepositoryContentConsumersTest InvalidRepositoryContentConsumer unselectedInvalidConsumer = (InvalidRepositoryContentConsumer) MockControl.createControl( InvalidRepositoryContentConsumer.class ).getMock(); - consumers.setAvailableInvalidConsumers( Arrays.asList( selectedInvalidConsumer, unselectedInvalidConsumer ) ); + + consumers.setApplicationContext( new MockApplicationContext(null, Arrays.asList( selectedInvalidConsumer, unselectedInvalidConsumer ))); + consumers.setSelectedInvalidConsumers( Collections.singletonList( selectedInvalidConsumer ) ); ManagedRepositoryConfiguration repo = createRepository( "id", "name", getTestFile( "target/test-repo" ) ); @@ -223,7 +240,7 @@ public class RepositoryContentConsumersTest Date startTime = new Date( System.currentTimeMillis() ); startTime.setTime( 12345678 ); - + selectedKnownConsumer.beginScan( repo, startTime ); selectedKnownConsumer.getExcludes(); knownControl.setReturnValue( Collections.EMPTY_LIST ); @@ -236,7 +253,7 @@ public class RepositoryContentConsumersTest selectedInvalidConsumer.beginScan( repo, startTime ); // invalidConsumer.completeScan(); invalidControl.replay(); - + consumers.executeConsumers( repo, testFile ); knownControl.verify(); @@ -303,4 +320,155 @@ public class RepositoryContentConsumersTest } return path; } + + private static Map convertToMap(List objects) + { + HashMap map = new HashMap(); + for (Object o : objects) + { + map.put(o, o); + } + return map; + } + + public class MockApplicationContext implements ApplicationContext + { + private List knownRepositoryContentConsumer; + + private List invalidRepositoryContentConsumers; + + public MockApplicationContext(List knownRepositoryContentConsumer, List invalidRepositoryContentConsumers) + { + this.knownRepositoryContentConsumer = knownRepositoryContentConsumer; + this.invalidRepositoryContentConsumers = invalidRepositoryContentConsumers; + } + + public AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws IllegalStateException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getDisplayName() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getId() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public ApplicationContext getParent() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public long getStartupDate() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean containsBeanDefinition(String beanName) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int getBeanDefinitionCount() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String[] getBeanDefinitionNames() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String[] getBeanNamesForType(Class type) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String[] getBeanNamesForType(Class type, boolean includeNonSingletons, boolean allowEagerInit) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Map getBeansOfType(Class type) throws BeansException { + if (type == KnownRepositoryContentConsumer.class) + { + return convertToMap(knownRepositoryContentConsumer); + } + if (type == InvalidRepositoryContentConsumer.class) + { + return convertToMap(invalidRepositoryContentConsumers); + } + throw new UnsupportedOperationException("Should not have been called"); + } + + public Map getBeansOfType(Class type, boolean includeNonSingletons, boolean allowEagerInit) throws BeansException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean containsBean(String name) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String[] getAliases(String name) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Object getBean(String name) throws BeansException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Object getBean(String name, Class requiredType) throws BeansException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Object getBean(String name, Object[] args) throws BeansException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Class getType(String name) throws NoSuchBeanDefinitionException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean isPrototype(String name) throws NoSuchBeanDefinitionException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean isSingleton(String name) throws NoSuchBeanDefinitionException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean isTypeMatch(String name, Class targetType) throws NoSuchBeanDefinitionException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean containsLocalBean(String name) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public BeanFactory getParentBeanFactory() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void publishEvent(ApplicationEvent event) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Resource[] getResources(String locationPattern) throws IOException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public ClassLoader getClassLoader() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Resource getResource(String location) { + throw new UnsupportedOperationException("Not supported yet."); + } + } } diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java index b53007004..28fb95588 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java @@ -86,7 +86,7 @@ public class DavResourceTest extends PlexusInSpringTestCase resource = getDavResource(resourceLocator.getHref(false), myResource); lockManager = new SimpleLockManager(); resource.addLockManager(lockManager); - consumers = new RepositoryContentConsumers(); + consumers = (RepositoryContentConsumers)getApplicationContext().getBean("repositoryContentConsumers"); archivaXworkUser = (ArchivaXworkUser) getApplicationContext().getBean( PlexusToSpringUtils.buildSpringId( ArchivaXworkUser.class ) ); } diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java index ff9dbd237..573895c58 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java @@ -5,15 +5,23 @@ import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; import org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers; import java.util.List; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; public class StubRepositoryContentConsumers extends RepositoryContentConsumers { + public StubRepositoryContentConsumers(ArchivaConfiguration configuration) + { + super(configuration); + } + + @Override public List getSelectedKnownConsumers() { return getAvailableKnownConsumers(); } + @Override public synchronized List getSelectedInvalidConsumers() { return getAvailableInvalidConsumers(); diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml index 53e79073f..2dbdc4889 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml @@ -95,14 +95,6 @@ 1800 - - - - - - org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers - default - org.apache.maven.archiva.webdav.StubRepositoryContentConsumers diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml index fd67257ef..a175b1abc 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml @@ -95,14 +95,6 @@ 1800 - - - - - - org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers - default - org.apache.maven.archiva.webdav.StubRepositoryContentConsumers