@@ -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() |
@@ -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() ); |
@@ -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 )); |