an other try to prevent windauze file leak

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1204873 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-11-22 09:27:22 +00:00
parent c6db5dad33
commit 4b16406276
1 changed files with 12 additions and 4 deletions

View File

@ -120,21 +120,29 @@ public abstract class AbstractRepositoryPurgeTest
previousArchivaConfiguration = ( (DefaultManagedRepositoryAdmin) applicationContext.getBean( previousArchivaConfiguration = ( (DefaultManagedRepositoryAdmin) applicationContext.getBean(
ManagedRepositoryAdmin.class ) ).getArchivaConfiguration(); ManagedRepositoryAdmin.class ) ).getArchivaConfiguration();
removeMavenIndexes();
} }
@After @After
public void tearDown() public void tearDown()
throws Exception throws Exception
{
removeMavenIndexes();
super.tearDown();
config = null;
repo = null;
}
protected void removeMavenIndexes()
throws Exception
{ {
NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class ); NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
for ( IndexingContext indexingContext : nexusIndexer.getIndexingContexts().values() ) for ( IndexingContext indexingContext : nexusIndexer.getIndexingContexts().values() )
{ {
nexusIndexer.removeIndexingContext( indexingContext, false ); nexusIndexer.removeIndexingContext( indexingContext, false );
} }
super.tearDown();
config = null;
repo = null;
} }
public ManagedRepository getRepoConfiguration( String repoId, String repoName ) public ManagedRepository getRepoConfiguration( String repoId, String repoName )