aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2011-06-27 07:45:32 +0000
committerOlivier Lamy <olamy@apache.org>2011-06-27 07:45:32 +0000
commit8233856ae41fe614e527773a278e6bd4e8a19f83 (patch)
treecf60d2adb6ff6fbb9ceeadbf0833476d2abb65b9 /archiva-modules
parent23d74d095637d15749c547106f751d5cd82250b6 (diff)
downloadarchiva-8233856ae41fe614e527773a278e6bd4e8a19f83.tar.gz
archiva-8233856ae41fe614e527773a278e6bd4e8a19f83.zip
retrieve IndexSearcher from NexusIndexer instead of manual creation to prevent lucene locks
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1140036 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java
index c8cc90533..bdbc23feb 100644
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java
+++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java
@@ -26,7 +26,6 @@ import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.TopDocs;
-import org.apache.lucene.store.SimpleFSDirectory;
import org.apache.maven.archiva.common.utils.ArchivaNexusIndexerUtil;
import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
@@ -175,7 +174,7 @@ public class ArchivaIndexingTaskExecutorTest
Set<ArtifactInfo> results = response.getResults();
- ArtifactInfo artifactInfo = (ArtifactInfo) results.iterator().next();
+ ArtifactInfo artifactInfo = results.iterator().next();
assertEquals( "org.apache.archiva", artifactInfo.groupId );
assertEquals( "archiva-index-methods-jar-test", artifactInfo.artifactId );
assertEquals( "test-repo", artifactInfo.repository );
@@ -203,8 +202,7 @@ public class ArchivaIndexingTaskExecutorTest
indexer.constructQuery( MAVEN.ARTIFACT_ID, new StringSearchExpression( "archiva-index-methods-jar-test" ) ),
Occur.SHOULD );
- IndexSearcher searcher =
- new IndexSearcher( new SimpleFSDirectory( new File( repositoryConfig.getLocation() + "/.indexer" ) ) );
+ IndexSearcher searcher = nexusIndexer.getIndexingContexts().get( repositoryConfig.getId() ).getIndexSearcher();
TopDocs topDocs = searcher.search( q, null, 10 );
searcher.close();
@@ -236,8 +234,7 @@ public class ArchivaIndexingTaskExecutorTest
indexer.constructQuery( MAVEN.ARTIFACT_ID, new StringSearchExpression( "archiva-index-methods-jar-test" ) ),
Occur.SHOULD );
- IndexSearcher searcher =
- new IndexSearcher( new SimpleFSDirectory( new File( repositoryConfig.getLocation() + "/.indexer" ) ) );
+ IndexSearcher searcher = nexusIndexer.getIndexingContexts().get( repositoryConfig.getId() ).getIndexSearcher();
TopDocs topDocs = searcher.search( q, null, 10 );
@@ -267,8 +264,7 @@ public class ArchivaIndexingTaskExecutorTest
indexer.constructQuery( MAVEN.ARTIFACT_ID, new StringSearchExpression( "archiva-index-methods-jar-test" ) ),
Occur.SHOULD );
- searcher =
- new IndexSearcher( new SimpleFSDirectory( new File( repositoryConfig.getLocation() + "/.indexer" ) ) );
+ searcher = nexusIndexer.getIndexingContexts().get( repositoryConfig.getId() ).getIndexSearcher();
topDocs = searcher.search( q, null, 10 );