]> source.dussan.org Git - archiva.git/commitdiff
Removing NexusIndexer references
authorMartin Stockhammer <martin_s@apache.org>
Fri, 30 Mar 2018 10:47:39 +0000 (12:47 +0200)
committerMartin Stockhammer <martin_s@apache.org>
Fri, 30 Mar 2018 10:47:39 +0000 (12:47 +0200)
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java

index b473b1db5e46f518ab18ef8dad4fc468b556c867..dae8575e472f421d23aa2b52c82ba4ae66ae65b3 100644 (file)
@@ -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()
index 345d257fa93df3c528e63bd9cf7d21a22459bc33..d02e99e86e8164c9184488ef45996175f672de5b 100644 (file)
@@ -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() );
index 1ef4bf9a0819379e7e7ddc2887c88d84705ba8c2..2ee46ed5fbfc9234d9cd8a4e87f297c386c252a3 100644 (file)
@@ -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 ));