From ee953f8d131ef04bcc17ca1fe3263b3c4bd333aa Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Fri, 30 Mar 2018 12:47:39 +0200 Subject: [PATCH] Removing NexusIndexer references --- .../core/AbstractArtifactConsumerTest.java | 17 ----------------- .../repository/AbstractRepositoryPurgeTest.java | 15 --------------- ...nupReleasedSnapshotsRepositoryPurgeTest.java | 2 -- 3 files changed, 34 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java index b473b1db5..dae8575e4 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java @@ -27,9 +27,6 @@ import org.apache.archiva.consumers.KnownRepositoryContentConsumer; import org.apache.archiva.consumers.functors.ConsumerWantsFilePredicate; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; import org.apache.commons.lang.StringUtils; -import org.apache.maven.index.NexusIndexer; -import org.apache.maven.index.context.IndexingContext; -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -37,7 +34,6 @@ import org.springframework.context.ApplicationContext; import org.springframework.test.context.ContextConfiguration; import javax.inject.Inject; - import java.nio.file.Path; import java.nio.file.Paths; @@ -58,9 +54,6 @@ public abstract class AbstractArtifactConsumerTest @Inject ArchivaConfiguration archivaConfiguration; - @Inject - protected NexusIndexer nexusIndexer; - @Before public void setUp() @@ -74,16 +67,6 @@ public abstract class AbstractArtifactConsumerTest repoLocation = Paths.get( "target/test-" + getName() + "/test-repo" ); } - @After - public void tearDown() - throws Exception - { - for ( IndexingContext indexingContext : nexusIndexer.getIndexingContexts().values() ) - { - nexusIndexer.removeIndexingContext( indexingContext, false ); - } - } - @Test public void testConsumption() diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java index 345d257fa..d02e99e86 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java @@ -110,17 +110,12 @@ public abstract class AbstractRepositoryPurgeTest @Inject protected ApplicationContext applicationContext; - @Inject - protected NexusIndexer nexusIndexer; - @Before public void setUp() throws Exception { - removeMavenIndexes(); - listenerControl = EasyMock.createControl(); listener = listenerControl.createMock( RepositoryListener.class ); @@ -136,20 +131,11 @@ public abstract class AbstractRepositoryPurgeTest public void tearDown() throws Exception { - removeMavenIndexes(); config = null; repo = null; } - protected void removeMavenIndexes() - throws Exception - { - for ( IndexingContext indexingContext : nexusIndexer.getIndexingContexts().values() ) - { - nexusIndexer.removeIndexingContext( indexingContext, false ); - } - } protected static String fixPath( String path ) { @@ -214,7 +200,6 @@ public abstract class AbstractRepositoryPurgeTest protected String prepareTestRepos() throws Exception { - removeMavenIndexes(); Path testDir = Paths.get( AbstractRepositoryPurgeTest.fixPath( getTestRepoRoot().toAbsolutePath().toString() ) ); org.apache.archiva.common.utils.FileUtils.deleteDirectory( testDir ); Path sourceDir = Paths.get( Paths.get( "target/test-classes/" + TEST_REPO_ID ).toAbsolutePath().toString() ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java index 1ef4bf9a0..2ee46ed5f 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java @@ -98,7 +98,6 @@ public class CleanupReleasedSnapshotsRepositoryPurgeTest ( (DefaultManagedRepositoryAdmin) applicationContext.getBean( ManagedRepositoryAdmin.class ) ).setArchivaConfiguration( archivaConfiguration ); - removeMavenIndexes(); } @Test @@ -106,7 +105,6 @@ public class CleanupReleasedSnapshotsRepositoryPurgeTest throws Exception { RepositoryRegistry repositoryRegistry = applicationContext.getBean( RepositoryRegistry.class ); - ManagedRepository managedRepository = repositoryRegistry.getManagedRepository( TEST_REPO_ID ); repositoryRegistry.removeRepository( TEST_REPO_ID ); repositoryRegistry.putRepository( getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME )); -- 2.39.5