diff options
author | Martin Stockhammer <martin_s@apache.org> | 2020-02-02 00:09:29 +0100 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2020-02-02 00:09:29 +0100 |
commit | 9634a9310d4daed0c2ed22424225aa9b3a9a1406 (patch) | |
tree | fd75f5c42aabfb36a480fbe881bf189147c18cae /archiva-modules | |
parent | 61c39c4f42333c53f5f0e2dfcce7a2b9fa0c7284 (diff) | |
download | archiva-9634a9310d4daed0c2ed22424225aa9b3a9a1406.tar.gz archiva-9634a9310d4daed0c2ed22424225aa9b3a9a1406.zip |
Cleanup of consumer-archetype
Diffstat (limited to 'archiva-modules')
17 files changed, 41 insertions, 1599 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml index a50eb2602..a0d7e8278 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml @@ -37,32 +37,54 @@ <site.staging.base>${project.parent.parent.parent.basedir}</site.staging.base> </properties> <dependencies> - <!-- Used by the archetype, so needed to be built before integration - tests run and use them --> + <dependency> <groupId>org.apache.archiva</groupId> - <artifactId>archiva-consumer-api</artifactId> - <scope>test</scope> + <artifactId>archiva-common</artifactId> </dependency> <dependency> <groupId>org.apache.archiva</groupId> - <artifactId>archiva-configuration</artifactId> - <scope>test</scope> + <artifactId>archiva-repository-api</artifactId> </dependency> <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-repository-admin-api</artifactId> - <scope>test</scope> + <groupId>org.apache.archiva.components.registry</groupId> + <artifactId>archiva-components-spring-registry-api</artifactId> </dependency> + <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl-over-slf4j</artifactId> - <version>${slf4j.version}</version> + <groupId>javax.inject</groupId> + <artifactId>javax.inject</artifactId> + </dependency> + <dependency> + <groupId>javax.annotation</groupId> + <artifactId>javax.annotation-api</artifactId> </dependency> <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + </dependency> + + <!-- Used by the archetype, so needed to be built before integration + tests run and use them --> + <dependency> <groupId>org.apache.archiva.maven</groupId> <artifactId>archiva-maven-indexer</artifactId> - <version>${archivaVersion}</version> + </dependency> + + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-consumer-api</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-configuration</artifactId> + <scope>test</scope> </dependency> <dependency> <groupId>org.apache.archiva</groupId> @@ -98,26 +120,6 @@ <version>1.9</version> <scope>test</scope> </dependency> - <dependency> - <groupId>org.apache.lucene</groupId> - <artifactId>lucene-core</artifactId> - <version>5.5.5</version> - </dependency> - <dependency> - <groupId>org.apache.lucene</groupId> - <artifactId>lucene-highlighter</artifactId> - <version>5.5.5</version> - </dependency> - <dependency> - <groupId>org.apache.lucene</groupId> - <artifactId>lucene-memory</artifactId> - <version>5.5.5</version> - </dependency> - <dependency> - <groupId>org.apache.lucene</groupId> - <artifactId>lucene-queries</artifactId> - <version>5.5.5</version> - </dependency> <!-- for some reasons this help sonar to run --> <dependency> diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml index 5148224c0..98f379e30 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -49,9 +49,6 @@ <requiredProperty key="springVersion"> <defaultValue>${spring.version}</defaultValue> </requiredProperty> - <requiredProperty key="guavaVersion"> - <defaultValue>${guava.version}</defaultValue> - </requiredProperty> <requiredProperty key="springockitoVersion"> <defaultValue>${springockito.version}</defaultValue> </requiredProperty> @@ -64,8 +61,5 @@ <requiredProperty key="httpcoreVersion"> <defaultValue>${httpclient.core.version}</defaultValue> </requiredProperty> - <requiredProperty key="asmVersion"> - <defaultValue>${asm.version}</defaultValue> - </requiredProperty> </requiredProperties> </archetype-descriptor> diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/test/java/SimpleArtifactConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/test/java/SimpleArtifactConsumerTest.java index 88f329511..2554a5583 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/test/java/SimpleArtifactConsumerTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/test/java/SimpleArtifactConsumerTest.java @@ -19,8 +19,6 @@ package $package; * under the License. */ -import org.apache.archiva.admin.model.RepositoryAdminException; -import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.RepositorySessionFactory; import org.apache.archiva.repository.base.BasicManagedRepository; @@ -41,7 +39,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Date; -import static org.mockito.Mockito.*; +// import static org.mockito.Mockito.*; /** * <code>SimpleArtifactConsumerTest</code> @@ -54,9 +52,6 @@ public class SimpleArtifactConsumerTest private SimpleArtifactConsumer consumer; @Inject - private ManagedRepositoryAdmin managedRepositoryAdmin; - - @Inject private RepositoryRegistry repositoryRegistry; @Inject @@ -76,7 +71,7 @@ public class SimpleArtifactConsumerTest } private void setUpMockRepository() - throws RepositoryAdminException, IOException, RepositoryException + throws IOException, RepositoryException { Path repoDir = Paths.get( "target/test-consumer-repo" ); Files.createDirectories( repoDir ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resourcesstatic/archetype-resources/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resourcesstatic/archetype-resources/pom.xml index 3dab62357..2de571f08 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resourcesstatic/archetype-resources/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resourcesstatic/archetype-resources/pom.xml @@ -34,12 +34,10 @@ <slf4j.version>${slf4jVersion}</slf4j.version> <log4j.version>${log4jVersion}</log4j.version> <spring.version>${springVersion}</spring.version> - <guava.version>${guavaVersion}</guava.version> <springockito.version>${springockitoVersion}</springockito.version> <mockito.version>${mockitoVersion}</mockito.version> <httpclient.version>${httpclientVersion}</httpclient.version> <httpclient.core.version>${httpcoreVersion}</httpclient.core.version> - <asm.version>${asmVersion}</asm.version> <archiva.comp.version>${archivaCompVersion}</archiva.comp.version> <commons.beanutils.version>${beanUtilsVersion}</commons.beanutils.version> </properties> @@ -56,11 +54,6 @@ </dependency> <dependency> <groupId>org.apache.archiva</groupId> - <artifactId>archiva-repository-admin-api</artifactId> - <version>${archiva.version}</version> - </dependency> - <dependency> - <groupId>org.apache.archiva</groupId> <artifactId>archiva-model</artifactId> <version>${archiva.version}</version> </dependency> @@ -217,6 +210,7 @@ <version>${log4j.version}</version> <scope>test</scope> </dependency> + <dependency> <groupId>org.kubek2k</groupId> <artifactId>springockito</artifactId> @@ -224,22 +218,20 @@ <scope>test</scope> </dependency> + <!-- <dependency> <groupId>org.ow2.asm</groupId> <artifactId>asm</artifactId> <scope>test</scope> </dependency> + + --> </dependencies> <!-- match up with those used by Archiva --> <dependencyManagement> <dependencies> <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - <version>${guava.version}</version> - </dependency> - <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-all</artifactId> <version>${mockito.version}</version> @@ -254,11 +246,6 @@ <artifactId>httpcore</artifactId> <version>${httpclient.core.version}</version> </dependency> - <dependency> - <groupId>org.ow2.asm</groupId> - <artifactId>asm</artifactId> - <version>${asm.version}</version> - </dependency> </dependencies> </dependencyManagement> diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/test/resources/projects/compile/archetype.properties b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/test/resources/projects/compile/archetype.properties index 6b48f58d5..dbb350a5d 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/test/resources/projects/compile/archetype.properties +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/test/resources/projects/compile/archetype.properties @@ -25,13 +25,11 @@ archivaVersion=${archivaVersion} log4jVersion=${log4j.version} slf4jVersion=${slf4j.version} springVersion=${spring.version} -guavaVersion=${guava.version} redbackRegistryVersion=${redback.registry.version} redbackCacheVersion=${redback.cache.version} springockitoVersion=${springockito.version} mockitoVersion=${mockito.version} httpclientVersion=${httpclient.version} httpcoreVersion=${httpclient.core.version} -asmVersion=${asm.version} archivaCompVersion=${archiva.comp.version} beanUtilsVersion=${commons.beanutils.version}
\ No newline at end of file diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml deleted file mode 100644 index 24a726ddf..000000000 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml +++ /dev/null @@ -1,145 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-consumers</artifactId> - <version>3.0.0-SNAPSHOT</version> - </parent> - <artifactId>archiva-lucene-consumers</artifactId> - <name>Archiva Base :: Consumers :: Lucene</name> - - <properties> - <site.staging.base>${project.parent.parent.parent.basedir}</site.staging.base> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-configuration</artifactId> - </dependency> - <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-consumer-api</artifactId> - </dependency> - <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-scheduler-api</artifactId> - </dependency> - <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-scheduler-indexing</artifactId> - </dependency> - <dependency> - <groupId>org.apache.archiva.components.registry</groupId> - <artifactId>archiva-components-spring-registry-api</artifactId> - </dependency> - <dependency> - <groupId>org.apache.archiva.components</groupId> - <artifactId>archiva-components-spring-taskqueue</artifactId> - </dependency> - <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-common</artifactId> - </dependency> - <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-repository-api</artifactId> - </dependency> - <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-repository-layer</artifactId> - </dependency> - <dependency> - <groupId>org.apache.archiva.redback</groupId> - <artifactId>redback-rbac-model</artifactId> - </dependency> - <dependency> - <groupId>org.apache.archiva.redback</groupId> - <artifactId>redback-rbac-role-manager</artifactId> - </dependency> - - <dependency> - <groupId>javax.inject</groupId> - <artifactId>javax.inject</artifactId> - </dependency> - <dependency> - <groupId>javax.annotation</groupId> - <artifactId>javax.annotation-api</artifactId> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - </dependency> - - <!-- Test scope --> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-test</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-test-utils</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>metadata-store-jcr</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.archiva.maven</groupId> - <artifactId>archiva-maven-indexer</artifactId> - <scope>test</scope> - </dependency> - - </dependencies> - <build> - <pluginManagement> - <plugins> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - <configuration> - <excludes> - <exclude>src/test/resources/test-repo/**</exclude> - </excludes> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <systemPropertyVariables> - <appserver.base>${project.build.directory}/appserver-base</appserver.base> - <plexus.home>${project.build.directory}/appserver-base</plexus.home> - <openjpa.Log>${openjpa.Log}</openjpa.Log> - </systemPropertyVariables> - </configuration> - </plugin> - </plugins> - </pluginManagement> - </build> -</project> diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java deleted file mode 100644 index e03557ebf..000000000 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java +++ /dev/null @@ -1,246 +0,0 @@ -package org.apache.archiva.consumers.lucene; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.apache.archiva.common.utils.PathUtil; -import org.apache.archiva.configuration.ArchivaConfiguration; -import org.apache.archiva.configuration.ConfigurationNames; -import org.apache.archiva.configuration.FileTypes; -import org.apache.archiva.consumers.AbstractMonitoredConsumer; -import org.apache.archiva.consumers.ConsumerException; -import org.apache.archiva.consumers.KnownRepositoryContentConsumer; -import org.apache.archiva.components.registry.Registry; -import org.apache.archiva.components.registry.RegistryListener; -import org.apache.archiva.components.taskqueue.TaskQueueException; -import org.apache.archiva.repository.ManagedRepository; -import org.apache.archiva.scheduler.ArchivaTaskScheduler; -import org.apache.archiva.scheduler.indexing.ArtifactIndexingTask; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Service; - -import javax.annotation.PostConstruct; -import javax.inject.Inject; -import javax.inject.Named; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; - -/** - * Consumer for indexing the repository to provide search and IDE integration features. - */ -@Service( "knownRepositoryContentConsumer#index-content" ) -@Scope( "prototype" ) -public class NexusIndexerConsumer - extends AbstractMonitoredConsumer - implements KnownRepositoryContentConsumer, RegistryListener -{ - - - private Logger log = LoggerFactory.getLogger( getClass() ); - - private ArchivaConfiguration configuration; - - private FileTypes filetypes; - - private Path managedRepository; - - private ArchivaTaskScheduler<ArtifactIndexingTask> scheduler; - - private List<String> includes = new ArrayList<>( 0 ); - - private ManagedRepository repository; - - @Inject - public NexusIndexerConsumer( - @Named( value = "archivaTaskScheduler#indexing" ) ArchivaTaskScheduler<ArtifactIndexingTask> scheduler, - @Named( value = "archivaConfiguration" ) ArchivaConfiguration configuration, FileTypes filetypes) - { - this.configuration = configuration; - this.filetypes = filetypes; - this.scheduler = scheduler; - } - - @Override - public String getDescription() - { - return "Indexes the repository to provide search and IDE integration features"; - } - - @Override - public String getId() - { - return "index-content"; - } - - @Override - public void beginScan( ManagedRepository repository, Date whenGathered ) - throws ConsumerException - { - this.repository = repository; - managedRepository = PathUtil.getPathFromUri( repository.getLocation() ); - - } - - @Override - public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo ) - throws ConsumerException - { - if ( executeOnEntireRepo ) - { - beginScan( repository, whenGathered ); - } - else - { - this.repository = repository; - managedRepository = Paths.get( repository.getLocation() ); - } - } - - @Override - public void processFile( String path ) - throws ConsumerException - { - Path artifactFile = managedRepository.resolve(path); - - ArtifactIndexingTask task = - new ArtifactIndexingTask( repository, artifactFile, ArtifactIndexingTask.Action.ADD, repository.getIndexingContext() ); - try - { - log.debug( "Queueing indexing task '{}' to add or update the artifact in the index.", task ); - scheduler.queueTask( task ); - } - catch ( TaskQueueException e ) - { - throw new ConsumerException( e.getMessage(), e ); - } - } - - @Override - public void processFile( String path, boolean executeOnEntireRepo ) - throws Exception - { - if ( executeOnEntireRepo ) - { - processFile( path ); - } - else - { - Path artifactFile = managedRepository.resolve(path); - - // specify in indexing task that this is not a repo scan request! - ArtifactIndexingTask task = - new ArtifactIndexingTask( repository, artifactFile, ArtifactIndexingTask.Action.ADD, - repository.getIndexingContext(), false ); - // only update index we don't need to scan the full repo here - task.setOnlyUpdate( true ); - try - { - log.debug( "Queueing indexing task '{}' to add or update the artifact in the index.", task ); - scheduler.queueTask( task ); - } - catch ( TaskQueueException e ) - { - throw new ConsumerException( e.getMessage(), e ); - } - } - } - - @Override - public void completeScan() - { - ArtifactIndexingTask task = - new ArtifactIndexingTask( repository, null, ArtifactIndexingTask.Action.FINISH, repository.getIndexingContext()); - try - { - log.debug( "Queueing indexing task '{}' to finish indexing.", task ); - scheduler.queueTask( task ); - } - catch ( TaskQueueException e ) - { - log.error( "Error queueing task: {}: {}", task, e.getMessage(), e ); - } - } - - @Override - public void completeScan( boolean executeOnEntireRepo ) - { - if ( executeOnEntireRepo ) - { - completeScan(); - } - - // else, do nothing as the context will be closed when indexing task is executed if not a repo scan request! - } - - @Override - public List<String> getExcludes() - { - return Collections.emptyList(); - } - - @Override - public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) - { - if ( ConfigurationNames.isRepositoryScanning( propertyName ) ) - { - initIncludes(); - } - } - - @Override - public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) - { - /* do nothing */ - } - - private void initIncludes() - { - List<String> indexable = filetypes.getFileTypePatterns( FileTypes.INDEXABLE_CONTENT ); - List<String> artifacts = filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ); - - includes = new ArrayList<>( indexable.size() + artifacts.size() ); - - includes.addAll( indexable ); - - includes.addAll( artifacts ); - } - - @PostConstruct - public void initialize() - { - configuration.addChangeListener( this ); - - initIncludes(); - } - - @Override - public List<String> getIncludes() - { - return includes; - } - - - -} diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/resources/META-INF/spring-context.xml deleted file mode 100644 index 0609595ac..000000000 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/resources/META-INF/spring-context.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:context="http://www.springframework.org/schema/context" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-3.0.xsd - http://www.springframework.org/schema/context - http://www.springframework.org/schema/context/spring-context-3.0.xsd" - default-lazy-init="true"> - - <context:annotation-config/> - <context:component-scan base-package="org.apache.archiva.consumers.lucene"/> - - <alias name="knownRepositoryContentConsumer#index-content" alias="indexerConsumer"/> - -</beans>
\ No newline at end of file diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/conf/repository-manager.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/conf/repository-manager.xml deleted file mode 100644 index 106fcea10..000000000 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/conf/repository-manager.xml +++ /dev/null @@ -1,129 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<configuration> - <version>1</version> - <repositories> - <repository> - <id>test-repo</id> - <name>Test Repository</name> - <url>file://src/test/resources/test-repo</url> - <layout>default</layout> - <releases>true</releases> - <snapshots>true</snapshots> - <indexed>true</indexed> - <refreshCronExpression>0 0 * * * ?</refreshCronExpression> - <retentionPeriod>0</retentionPeriod> - <retentionCount>2</retentionCount> - </repository> - </repositories> - - <proxyConnectors/> - - <networkProxies> - <networkProxy> - <id>example</id> - <protocol>http</protocol> - <host>proxy.mycompany.com</host> - <port>8080</port> - <username>myself</username> - <password>mypass</password> - </networkProxy> - </networkProxies> - - <repositoryScanning> - <fileTypes> - <fileType> - <id>artifacts</id> - <patterns> - <pattern>**/*.pom</pattern> - <pattern>**/*.jar</pattern> - <pattern>**/*.ear</pattern> - <pattern>**/*.war</pattern> - </patterns> - </fileType> - <fileType> - <id>indexable-content</id> - <patterns> - <pattern>**/*.txt</pattern> - <pattern>**/*.TXT</pattern> - </patterns> - </fileType> - <fileType> - <id>auto-remove</id> - <patterns> - <pattern>**/*.bak</pattern> - <pattern>**/*~</pattern> - <pattern>**/*-</pattern> - </patterns> - </fileType> - <fileType> - <id>ignored</id> - <patterns> - <pattern>**/.htaccess</pattern> - <pattern>**/KEYS</pattern> - <pattern>**/*.rb</pattern> - <pattern>**/*.sh</pattern> - <pattern>**/.svn/**</pattern> - <pattern>**/.DAV/**</pattern> - </patterns> - </fileType> - </fileTypes> - <knownContentConsumers> - <knownContentConsumer>update-db-artifact</knownContentConsumer> - <knownContentConsumer>create-missing-checksums</knownContentConsumer> - <knownContentConsumer>update-db-repository-metadata</knownContentConsumer> - <knownContentConsumer>validate-checksum</knownContentConsumer> - <knownContentConsumer>validate-signature</knownContentConsumer> - <knownContentConsumer>index-content</knownContentConsumer> - <knownContentConsumer>auto-remove</knownContentConsumer> - <knownContentConsumer>auto-rename</knownContentConsumer> - <knownContentConsumer>repository-purge</knownContentConsumer> - </knownContentConsumers> - <invalidContentConsumers> - <invalidContentConsumer>update-db-bad-content</invalidContentConsumer> - </invalidContentConsumers> - </repositoryScanning> - - <databaseScanning> - <cronExpression>0 0 * * * ?</cronExpression> - <unprocessedConsumers> - <unprocessedConsumer>index-artifact</unprocessedConsumer> - <unprocessedConsumer>update-db-project</unprocessedConsumer> - <unprocessedConsumer>validate-repository-metadata</unprocessedConsumer> - <unprocessedConsumer>index-archive-toc</unprocessedConsumer> - <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer> - <unprocessedConsumer>index-public-methods</unprocessedConsumer> - </unprocessedConsumers> - <cleanupConsumers> - <cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer> - <cleanupConsumer>not-present-remove-db-project</cleanupConsumer> - <cleanupConsumer>not-present-remove-indexed</cleanupConsumer> - </cleanupConsumers> - </databaseScanning> - - <webapp> - <ui> - <showFindArtifacts>true</showFindArtifacts> - <appletFindEnabled>true</appletFindEnabled> - </ui> - </webapp> - -</configuration> diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java deleted file mode 100644 index 85ee9426d..000000000 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java +++ /dev/null @@ -1,237 +0,0 @@ -package org.apache.archiva.consumers.lucene; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import junit.framework.TestCase; -import org.apache.archiva.common.utils.PathUtil; -import org.apache.archiva.configuration.ArchivaConfiguration; -import org.apache.archiva.configuration.FileTypes; -import org.apache.archiva.components.taskqueue.TaskQueueException; -import org.apache.archiva.repository.base.ArchivaRepositoryRegistry; -import org.apache.archiva.repository.base.BasicManagedRepository; -import org.apache.archiva.repository.ReleaseScheme; -import org.apache.archiva.scheduler.ArchivaTaskScheduler; -import org.apache.archiva.scheduler.indexing.ArtifactIndexingTask; -import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.context.ApplicationContext; -import org.springframework.test.context.ContextConfiguration; - -import javax.inject.Inject; -import java.io.IOException; -import java.net.URI; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.*; - -/** - * NexusIndexerConsumerTest - */ -@RunWith( ArchivaSpringJUnit4ClassRunner.class ) -@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" } ) -public class NexusIndexerConsumerTest - extends TestCase -{ - private final class ArchivaTaskSchedulerStub - implements ArchivaTaskScheduler<ArtifactIndexingTask> - { - Set<Path> indexed = new HashSet<>(); - - @Override - public void queueTask( ArtifactIndexingTask task ) - throws TaskQueueException - { - switch ( task.getAction() ) - { - case ADD: - indexed.add( task.getResourceFile() ); - break; - case DELETE: - indexed.remove( task.getResourceFile() ); - break; - case FINISH: - try - { - task.getContext().close( false ); - } - catch ( IOException e ) - { - throw new TaskQueueException( e.getMessage() ); - } - break; - } - } - } - - private NexusIndexerConsumer nexusIndexerConsumer; - - private BasicManagedRepository repositoryConfig; - - private ArchivaTaskSchedulerStub scheduler; - - @Inject - private ApplicationContext applicationContext; - - @Inject - ArchivaRepositoryRegistry repositoryRegistry; - - - @Override - @Before - public void setUp() - throws Exception - { - super.setUp(); - - scheduler = new ArchivaTaskSchedulerStub(); - - ArchivaConfiguration configuration = applicationContext.getBean( ArchivaConfiguration.class ); - - FileTypes filetypes = applicationContext.getBean( FileTypes.class ); - - nexusIndexerConsumer = - new NexusIndexerConsumer( scheduler, configuration, filetypes); - - // initialize to set the file types to be processed - nexusIndexerConsumer.initialize(); - - repositoryConfig = BasicManagedRepository.newFilesystemInstance( "test-repo", "Test Repository", Paths.get("target/test-classes").resolve("test-repo") ); - repositoryConfig.setLocation( new URI("target/test-classes/test-repo") ); - repositoryConfig.setLayout( "default" ); - repositoryConfig.setScanned( true ); - repositoryConfig.addActiveReleaseScheme( ReleaseScheme.RELEASE ); - repositoryConfig.removeActiveReleaseScheme( ReleaseScheme.SNAPSHOT ); - repositoryRegistry.putRepository(repositoryConfig); - } - - - @Override - @After - public void tearDown() - throws Exception - { - // delete created index in the repository - Path basePath = PathUtil.getPathFromUri( repositoryConfig.getLocation() ); - Path indexDir = basePath.resolve( ".indexer" ); - org.apache.archiva.common.utils.FileUtils.deleteDirectory( indexDir ); - assertFalse( Files.exists(indexDir) ); - - indexDir = basePath.resolve( ".index" ); - org.apache.archiva.common.utils.FileUtils.deleteDirectory( indexDir ); - assertFalse( Files.exists(indexDir) ); - - repositoryRegistry.destroy(); - - super.tearDown(); - } - - @Test - public void testIndexerIndexArtifact() - throws Exception - { - Path basePath = PathUtil.getPathFromUri( repositoryConfig.getLocation() ); - Path artifactFile = basePath.resolve( - "org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar" ); - - // begin scan - Date now = Calendar.getInstance().getTime(); - nexusIndexerConsumer.beginScan( repositoryConfig, now ); - nexusIndexerConsumer.processFile( - "org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar" ); - nexusIndexerConsumer.completeScan(); - - assertTrue( scheduler.indexed.contains( artifactFile ) ); - } - - @Test - public void testIndexerArtifactAlreadyIndexed() - throws Exception - { - Path basePath = PathUtil.getPathFromUri( repositoryConfig.getLocation() ); - Path artifactFile = basePath.resolve( - "org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar" ); - - // begin scan - Date now = Calendar.getInstance().getTime(); - nexusIndexerConsumer.beginScan( repositoryConfig, now ); - nexusIndexerConsumer.processFile( - "org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar" ); - nexusIndexerConsumer.completeScan(); - - assertTrue( scheduler.indexed.contains( artifactFile ) ); - - // scan and index again - now = Calendar.getInstance().getTime(); - nexusIndexerConsumer.beginScan( repositoryConfig, now ); - nexusIndexerConsumer.processFile( - "org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar" ); - nexusIndexerConsumer.completeScan(); - - assertTrue( scheduler.indexed.contains( artifactFile ) ); - } - - @Test - public void testIndexerIndexArtifactThenPom() - throws Exception - { - Path basePath = PathUtil.getPathFromUri( repositoryConfig.getLocation( ) ); - Path artifactFile = basePath.resolve( - "org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar" ); - - // begin scan - Date now = Calendar.getInstance().getTime(); - nexusIndexerConsumer.beginScan( repositoryConfig, now ); - nexusIndexerConsumer.processFile( - "org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar" ); - nexusIndexerConsumer.completeScan(); - - assertTrue( scheduler.indexed.contains( artifactFile ) ); - - artifactFile = - basePath.resolve( "org/apache/archiva/archiva-index-methods-jar-test/1.0/pom.xml" ); - - // scan and index again - now = Calendar.getInstance().getTime(); - nexusIndexerConsumer.beginScan( repositoryConfig, now ); - nexusIndexerConsumer.processFile( "org/apache/archiva/archiva-index-methods-jar-test/1.0/pom.xml" ); - nexusIndexerConsumer.completeScan(); - - assertTrue( scheduler.indexed.contains( artifactFile ) ); - } - - // MRM-1275 - Include other file types for the index consumer instead of just the indexable-content - @Test - public void testIncludedFileTypes() - throws Exception - { - List<String> includes = nexusIndexerConsumer.getIncludes(); - assertTrue( ".pom artifacts should be processed.", includes.contains( "**/*.pom" ) ); - assertTrue( ".xml artifacts should be processed.", includes.contains( "**/*.xml" ) ); - assertTrue( ".txt artifacts should be processed.", includes.contains( "**/*.txt" ) ); - assertTrue( ".jar artifacts should be processed.", includes.contains( "**/*.jar" ) ); - assertTrue( ".war artifacts should be processed.", includes.contains( "**/*.war" ) ); - assertTrue( ".zip artifacts should be processed.", includes.contains( "**/*.zip" ) ); - } - -} diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/test/TestRBACManager.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/test/TestRBACManager.java deleted file mode 100644 index adcc42550..000000000 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/test/TestRBACManager.java +++ /dev/null @@ -1,472 +0,0 @@ -package org.apache.archiva.consumers.lucene.test; -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.apache.archiva.redback.rbac.Operation; -import org.apache.archiva.redback.rbac.Permission; -import org.apache.archiva.redback.rbac.RBACManager; -import org.apache.archiva.redback.rbac.RBACManagerListener; -import org.apache.archiva.redback.rbac.RbacManagerException; -import org.apache.archiva.redback.rbac.RbacObjectInvalidException; -import org.apache.archiva.redback.rbac.RbacObjectNotFoundException; -import org.apache.archiva.redback.rbac.Resource; -import org.apache.archiva.redback.rbac.Role; -import org.apache.archiva.redback.rbac.UserAssignment; -import org.springframework.stereotype.Service; - -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * @author Olivier Lamy - */ -@Service("rbacManager#cached") -public class TestRBACManager implements RBACManager -{ - - @Override - public void initialize() - { - - } - - @Override - public boolean isFinalImplementation() - { - return false; - } - - @Override - public String getDescriptionKey() - { - return "archiva.redback.rbacmanager.test"; - } - - @Override - public void addListener( RBACManagerListener listener ) - { - - } - - @Override - public void removeListener( RBACManagerListener listener ) - { - - } - - @Override - public Role createRole( String name ) - { - return null; - } - - @Override - public boolean roleExists( String name ) - { - return false; - } - - @Override - public boolean roleExists( Role role ) - { - return false; - } - - @Override - public Role saveRole( Role role ) - throws RbacObjectInvalidException, RbacManagerException - { - return null; - } - - @Override - public void saveRoles( Collection<Role> roles ) - throws RbacObjectInvalidException, RbacManagerException - { - - } - - @Override - public Role getRole( String roleName ) - throws RbacObjectNotFoundException, RbacManagerException - { - return null; - } - - @Override - public Map<String, Role> getRoles( Collection<String> roleNames ) - throws RbacObjectNotFoundException, RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void addChildRole( Role role, Role childRole ) - throws RbacObjectInvalidException, RbacManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Map<String, Role> getChildRoles( Role role ) - throws RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Map<String, Role> getParentRoles( Role role ) - throws RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public List<Role> getAllRoles() - throws RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Set<Role> getEffectiveRoles( Role role ) - throws RbacObjectNotFoundException, RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void removeRole( Role role ) - throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void removeRole( String roleName ) - throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Permission createPermission( String name ) - throws RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Permission createPermission( String name, String operationName, String resourceIdentifier ) - throws RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public boolean permissionExists( String name ) - { - return false; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public boolean permissionExists( Permission permission ) - { - return false; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Permission savePermission( Permission permission ) - throws RbacObjectInvalidException, RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Permission getPermission( String permissionName ) - throws RbacObjectNotFoundException, RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public List<Permission> getAllPermissions() - throws RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void removePermission( Permission permission ) - throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void removePermission( String permissionName ) - throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Operation createOperation( String name ) - throws RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public boolean operationExists( String name ) - { - return false; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public boolean operationExists( Operation operation ) - { - return false; - } - - @Override - public Operation saveOperation( Operation operation ) - throws RbacObjectInvalidException, RbacManagerException - { - return null; - } - - @Override - public Operation getOperation( String operationName ) - throws RbacObjectNotFoundException, RbacManagerException - { - return null; - } - - @Override - public List<Operation> getAllOperations() - throws RbacManagerException - { - return null; - } - - @Override - public void removeOperation( Operation operation ) - throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException - { - } - - @Override - public void removeOperation( String operationName ) - throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException - { - } - - @Override - public Resource createResource( String identifier ) - throws RbacManagerException - { - return null; - } - - @Override - public boolean resourceExists( String identifier ) - { - return false; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public boolean resourceExists( Resource resource ) - { - return false; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Resource saveResource( Resource resource ) - throws RbacObjectInvalidException, RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Resource getResource( String resourceIdentifier ) - throws RbacObjectNotFoundException, RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public List<Resource> getAllResources() - throws RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void removeResource( Resource resource ) - throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void removeResource( String resourceIdentifier ) - throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public UserAssignment createUserAssignment( String principal ) - throws RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public boolean userAssignmentExists( String principal ) - { - return false; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public boolean userAssignmentExists( UserAssignment assignment ) - { - return false; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public UserAssignment saveUserAssignment( UserAssignment userAssignment ) - throws RbacObjectInvalidException, RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public UserAssignment getUserAssignment( String principal ) - throws RbacObjectNotFoundException, RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public List<UserAssignment> getAllUserAssignments() - throws RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames ) - throws RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void removeUserAssignment( UserAssignment userAssignment ) - throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void removeUserAssignment( String principal ) - throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Collection<Role> getAssignedRoles( String principal ) - throws RbacObjectNotFoundException, RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Collection<Role> getAssignedRoles( UserAssignment userAssignment ) - throws RbacObjectNotFoundException, RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Collection<Role> getEffectivelyUnassignedRoles( String principal ) - throws RbacManagerException, RbacObjectNotFoundException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Collection<Role> getEffectivelyAssignedRoles( String principal ) - throws RbacObjectNotFoundException, RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Collection<Role> getUnassignedRoles( String principal ) - throws RbacManagerException, RbacObjectNotFoundException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Set<Permission> getAssignedPermissions( String principal ) - throws RbacObjectNotFoundException, RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Map<String, List<? extends Permission>> getAssignedPermissionMap( String principal ) - throws RbacObjectNotFoundException, RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public List<Role> getAllAssignableRoles() - throws RbacManagerException, RbacObjectNotFoundException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public Resource getGlobalResource() - throws RbacManagerException - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void eraseDatabase() - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public boolean isReadOnly() - { - return false; - } -} diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/test/TestRoleManager.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/test/TestRoleManager.java deleted file mode 100644 index 8f3bb644f..000000000 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/test/TestRoleManager.java +++ /dev/null @@ -1,137 +0,0 @@ -package org.apache.archiva.consumers.lucene.test; -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.apache.archiva.redback.role.RoleManager; -import org.apache.archiva.redback.role.RoleManagerException; -import org.apache.archiva.redback.role.model.RedbackRoleModel; -import org.springframework.stereotype.Service; - -import java.net.URL; - -/** - * @author Olivier Lamy - */ -@Service( "roleManager#test" ) -public class TestRoleManager - implements RoleManager -{ - @Override - public void loadRoleModel( URL resourceLocation ) - throws RoleManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void loadRoleModel( RedbackRoleModel model ) - throws RoleManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void createTemplatedRole( String templateId, String resource ) - throws RoleManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void removeTemplatedRole( String templateId, String resource ) - throws RoleManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void updateRole( String templateId, String oldResource, String newResource ) - throws RoleManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void assignRole( String roleId, String principal ) - throws RoleManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void assignRoleByName( String roleName, String principal ) - throws RoleManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void assignTemplatedRole( String templateId, String resource, String principal ) - throws RoleManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void unassignRole( String roleId, String principal ) - throws RoleManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void unassignRoleByName( String roleName, String principal ) - throws RoleManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public boolean roleExists( String roleId ) - throws RoleManagerException - { - return false; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public boolean templatedRoleExists( String templateId, String resource ) - throws RoleManagerException - { - return false; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public RedbackRoleModel getModel() - { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void verifyTemplatedRole( String templateID, String resource ) - throws RoleManagerException - { - //To change body of implemented methods use File | Settings | File Templates. - } - - @Override - public void initialize() - { - //To change body of implemented methods use File | Settings | File Templates. - } -} diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/log4j2-test.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/log4j2-test.xml deleted file mode 100644 index 03547df43..000000000 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/log4j2-test.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> -<configuration> - <Properties> - - </Properties> - <appenders> - <Console name="console" target="SYSTEM_OUT"> - <PatternLayout pattern="%d{ISO8601_PERIOD} [%L] [%t] %-5level %logger{3} - %msg%n"/> - </Console> - <!-- - <RandomAccessFile name="LogFile" fileName="target/test.log"> - <PatternLayout pattern="%d{ISO8601_PERIOD} [%L] [%t] %-5level %logger{3} - %msg%n"/> - </RandomAccessFile> - --> - </appenders> - <loggers> - <logger name="org.apache.archiva" level="info"/> - <logger name="org.apache.archiva.repository.scanner" level="info"/> - <root level="error" includeLocation="true"> - <appender-ref ref="console"/> - </root> - </loggers> -</configuration> diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/spring-context.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/spring-context.xml deleted file mode 100644 index 8fb55e1b1..000000000 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/spring-context.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0"?> - -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:context="http://www.springframework.org/schema/context" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-3.0.xsd - http://www.springframework.org/schema/context - http://www.springframework.org/schema/context/spring-context-3.0.xsd" - default-lazy-init="true"> - <context:annotation-config/> - <context:component-scan base-package="org.apache.archiva.consumers.lucene.test,org.apache.maven.index"/> - - <bean name="commons-configuration" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry"> - <property name="initialConfiguration"> - <value> - <![CDATA[ - <configuration> - <system/> - <xml fileName="${appserver.base}/conf/archiva.xml" config-forceCreate="true" - config-optional="true" - config-name="org.apache.archiva.base" config-at="org.apache.archiva"/> - </configuration> - ]]> - </value> - </property> - </bean> - - <bean name="scheduler" class="org.apache.archiva.components.scheduler.DefaultScheduler"> - <property name="properties"> - <props> - <prop key="org.quartz.scheduler.instanceName">scheduler1</prop> - <prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop> - <prop key="org.quartz.threadPool.threadCount">2</prop> - <prop key="org.quartz.threadPool.threadPriority">4</prop> - <prop key="org.quartz.jobStore.class">org.quartz.simpl.RAMJobStore</prop> - </props> - </property> - </bean> - - <alias name="roleManager#test" alias="roleManager"/> - - <!-- - <bean id="jcr-config" class="org.apache.archiva.metadata.repository.jcr.ArchivaJcrRepositoryConfig" factory-method="create"> - <constructor-arg value="${appserver.base}/conf/repository.xml"/> - <constructor-arg value="${appserver.base}/data/jcr"/> - </bean> - - <bean id="jcr-repository" class="org.apache.jackrabbit.core.RepositoryImpl" destroy-method="shutdown" lazy-init="true"> - <constructor-arg ref="jcr-config"/> - </bean> - --> - - -</beans>
\ No newline at end of file diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar Binary files differdeleted file mode 100644 index cc03dacc1..000000000 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar +++ /dev/null diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/archiva/archiva-index-methods-jar-test/1.0/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/archiva/archiva-index-methods-jar-test/1.0/pom.xml deleted file mode 100644 index e7bf54bda..000000000 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/archiva/archiva-index-methods-jar-test/1.0/pom.xml +++ /dev/null @@ -1,18 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-index-methods-jar-test</artifactId> - <packaging>jar</packaging> - <version>1.0</version> - <name>archiva-index-methods-jar-test</name> - <url>http://maven.apache.org</url> - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>3.8.1</version> - <scope>test</scope> - </dependency> - </dependencies> -</project> diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/maven/archiva/archiva-lucene-cleanup/1.0/archiva-lucene-cleanup-1.0.jar b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/maven/archiva/archiva-lucene-cleanup/1.0/archiva-lucene-cleanup-1.0.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/maven/archiva/archiva-lucene-cleanup/1.0/archiva-lucene-cleanup-1.0.jar +++ /dev/null |