aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-base/archiva-indexer
diff options
context:
space:
mode:
authorJoakim Erdfelt <joakime@apache.org>2007-10-08 22:07:39 +0000
committerJoakim Erdfelt <joakime@apache.org>2007-10-08 22:07:39 +0000
commit8af86cd884b34ecfa98c6a42d2975fdd45c48fff (patch)
tree3747df8c304e8c84090f325abab84775e961db6e /archiva-base/archiva-indexer
parent4b9cf4b9298b9906ae4975146706e6a870349e43 (diff)
downloadarchiva-8af86cd884b34ecfa98c6a42d2975fdd45c48fff.tar.gz
archiva-8af86cd884b34ecfa98c6a42d2975fdd45c48fff.zip
Finishing the Repository split work that brett started.
ArchivaRepository has been removed from model. This work was needed before repository layout/detection proposal work is started. git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@582987 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-base/archiva-indexer')
-rw-r--r--archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndex.java4
-rw-r--r--archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndexFactory.java8
-rw-r--r--archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/BytecodeIndexTransformer.java6
-rw-r--r--archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/FileContentIndexTransformer.java6
-rw-r--r--archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/HashcodesIndexTransformer.java6
-rw-r--r--archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/UserAllowedToSearchRepositoryPredicate.java4
-rw-r--r--archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndex.java8
-rw-r--r--archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndexFactory.java13
-rw-r--r--archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java3
-rw-r--r--archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractIndexerTestCase.java23
-rw-r--r--archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeIndexTest.java4
-rw-r--r--archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeSearchTest.java4
-rw-r--r--archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesIndexTest.java4
-rw-r--r--archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesSearchTest.java4
-rw-r--r--archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.java16
15 files changed, 60 insertions, 53 deletions
diff --git a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndex.java b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndex.java
index 984c861f8..b45f5727a 100644
--- a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndex.java
+++ b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndex.java
@@ -22,9 +22,9 @@ package org.apache.maven.archiva.indexer;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.search.Searchable;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.indexer.lucene.LuceneEntryConverter;
import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord;
-import org.apache.maven.archiva.model.ArchivaRepository;
import java.io.File;
import java.util.Collection;
@@ -116,7 +116,7 @@ public interface RepositoryContentIndex
*
* @return the repository that this index belongs to.
*/
- ArchivaRepository getRepository();
+ ManagedRepositoryConfiguration getRepository();
/**
* Get the analyzer in use for this index.
diff --git a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndexFactory.java b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndexFactory.java
index fa80e2d8d..2eb796eed 100644
--- a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndexFactory.java
+++ b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndexFactory.java
@@ -19,7 +19,7 @@ package org.apache.maven.archiva.indexer;
* under the License.
*/
-import org.apache.maven.archiva.model.ArchivaRepository;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
/**
* Obtain an index instance.
@@ -34,7 +34,7 @@ public interface RepositoryContentIndexFactory
* @param repository the repository to create the content index from.
* @return the index instance
*/
- RepositoryContentIndex createBytecodeIndex( ArchivaRepository repository );
+ RepositoryContentIndex createBytecodeIndex( ManagedRepositoryConfiguration repository );
/**
* Method to create an instance of the file content index.
@@ -42,7 +42,7 @@ public interface RepositoryContentIndexFactory
* @param repository the repository to create the file content index from.
* @return the index instance
*/
- RepositoryContentIndex createFileContentIndex( ArchivaRepository repository );
+ RepositoryContentIndex createFileContentIndex( ManagedRepositoryConfiguration repository );
/**
* Method to create an instance of the hashcode index.
@@ -50,5 +50,5 @@ public interface RepositoryContentIndexFactory
* @param repository the repository to create the content index from.
* @return the index instance
*/
- RepositoryContentIndex createHashcodeIndex( ArchivaRepository repository );
+ RepositoryContentIndex createHashcodeIndex( ManagedRepositoryConfiguration repository );
}
diff --git a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/BytecodeIndexTransformer.java b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/BytecodeIndexTransformer.java
index 53e0b0043..5d232aef5 100644
--- a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/BytecodeIndexTransformer.java
+++ b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/BytecodeIndexTransformer.java
@@ -20,8 +20,8 @@ package org.apache.maven.archiva.indexer.functors;
*/
import org.apache.commons.collections.Transformer;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory;
-import org.apache.maven.archiva.model.ArchivaRepository;
/**
* BytecodeIndexTransformer
@@ -41,9 +41,9 @@ public class BytecodeIndexTransformer
public Object transform( Object input )
{
- if ( input instanceof ArchivaRepository )
+ if ( input instanceof ManagedRepositoryConfiguration )
{
- return indexFactory.createBytecodeIndex( (ArchivaRepository) input );
+ return indexFactory.createBytecodeIndex( (ManagedRepositoryConfiguration) input );
}
return input;
diff --git a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/FileContentIndexTransformer.java b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/FileContentIndexTransformer.java
index 311eb92ac..2b20cbf2e 100644
--- a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/FileContentIndexTransformer.java
+++ b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/FileContentIndexTransformer.java
@@ -20,8 +20,8 @@ package org.apache.maven.archiva.indexer.functors;
*/
import org.apache.commons.collections.Transformer;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory;
-import org.apache.maven.archiva.model.ArchivaRepository;
/**
* FileContentIndexTransformer
@@ -41,9 +41,9 @@ public class FileContentIndexTransformer
public Object transform( Object input )
{
- if ( input instanceof ArchivaRepository )
+ if ( input instanceof ManagedRepositoryConfiguration )
{
- return indexFactory.createFileContentIndex( (ArchivaRepository) input );
+ return indexFactory.createFileContentIndex( (ManagedRepositoryConfiguration) input );
}
return input;
diff --git a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/HashcodesIndexTransformer.java b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/HashcodesIndexTransformer.java
index 56258608a..6101e8891 100644
--- a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/HashcodesIndexTransformer.java
+++ b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/HashcodesIndexTransformer.java
@@ -20,8 +20,8 @@ package org.apache.maven.archiva.indexer.functors;
*/
import org.apache.commons.collections.Transformer;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory;
-import org.apache.maven.archiva.model.ArchivaRepository;
/**
* HashcodesIndexTransformer
@@ -41,9 +41,9 @@ public class HashcodesIndexTransformer
public Object transform( Object input )
{
- if ( input instanceof ArchivaRepository )
+ if ( input instanceof ManagedRepositoryConfiguration )
{
- return indexFactory.createHashcodeIndex( (ArchivaRepository) input );
+ return indexFactory.createHashcodeIndex( (ManagedRepositoryConfiguration) input );
}
return input;
diff --git a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/UserAllowedToSearchRepositoryPredicate.java b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/UserAllowedToSearchRepositoryPredicate.java
index 7ecac1fe3..528de940d 100644
--- a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/UserAllowedToSearchRepositoryPredicate.java
+++ b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/UserAllowedToSearchRepositoryPredicate.java
@@ -20,7 +20,7 @@ package org.apache.maven.archiva.indexer.functors;
*/
import org.apache.commons.collections.Predicate;
-import org.apache.maven.archiva.model.ArchivaRepository;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
/**
* UserAllowedToSearchRepositoryPredicate
@@ -35,7 +35,7 @@ public class UserAllowedToSearchRepositoryPredicate
{
boolean satisfies = false;
- if ( object instanceof ArchivaRepository )
+ if ( object instanceof ManagedRepositoryConfiguration )
{
// TODO: perform check here.
satisfies = true; // Everyone is allowed! (for now)
diff --git a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndex.java b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndex.java
index 5fcfa10e5..8793682fa 100644
--- a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndex.java
+++ b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndex.java
@@ -29,10 +29,10 @@ import org.apache.lucene.index.TermEnum;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Searchable;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.indexer.RepositoryContentIndex;
import org.apache.maven.archiva.indexer.RepositoryIndexException;
import org.apache.maven.archiva.indexer.RepositoryIndexSearchException;
-import org.apache.maven.archiva.model.ArchivaRepository;
import java.io.File;
import java.io.IOException;
@@ -64,9 +64,9 @@ public class LuceneRepositoryContentIndex
*/
private LuceneIndexHandlers indexHandlers;
- private ArchivaRepository repository;
+ private ManagedRepositoryConfiguration repository;
- public LuceneRepositoryContentIndex( ArchivaRepository repository, File indexDir, LuceneIndexHandlers handlers )
+ public LuceneRepositoryContentIndex( ManagedRepositoryConfiguration repository, File indexDir, LuceneIndexHandlers handlers )
{
this.repository = repository;
this.indexLocation = indexDir;
@@ -399,7 +399,7 @@ public class LuceneRepositoryContentIndex
return this.indexHandlers.getId();
}
- public ArchivaRepository getRepository()
+ public ManagedRepositoryConfiguration getRepository()
{
return repository;
}
diff --git a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndexFactory.java b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndexFactory.java
index de6b8626d..8564bd74a 100644
--- a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndexFactory.java
+++ b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndexFactory.java
@@ -27,7 +27,6 @@ import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory;
import org.apache.maven.archiva.indexer.bytecode.BytecodeHandlers;
import org.apache.maven.archiva.indexer.filecontent.FileContentHandlers;
import org.apache.maven.archiva.indexer.hashcodes.HashcodesHandlers;
-import org.apache.maven.archiva.model.ArchivaRepository;
import java.io.File;
@@ -46,19 +45,19 @@ public class LuceneRepositoryContentIndexFactory
*/
private ArchivaConfiguration configuration;
- public RepositoryContentIndex createBytecodeIndex( ArchivaRepository repository )
+ public RepositoryContentIndex createBytecodeIndex( ManagedRepositoryConfiguration repository )
{
File indexDir = toIndexDir( repository, "bytecode" );
return new LuceneRepositoryContentIndex( repository, indexDir, new BytecodeHandlers() );
}
- public RepositoryContentIndex createFileContentIndex( ArchivaRepository repository )
+ public RepositoryContentIndex createFileContentIndex( ManagedRepositoryConfiguration repository )
{
File indexDir = toIndexDir( repository, "filecontent" );
return new LuceneRepositoryContentIndex( repository, indexDir, new FileContentHandlers() );
}
- public RepositoryContentIndex createHashcodeIndex( ArchivaRepository repository )
+ public RepositoryContentIndex createHashcodeIndex( ManagedRepositoryConfiguration repository )
{
File indexDir = toIndexDir( repository, "hashcodes" );
return new LuceneRepositoryContentIndex( repository, indexDir, new HashcodesHandlers() );
@@ -71,7 +70,7 @@ public class LuceneRepositoryContentIndexFactory
* @param indexId the id of the index
* @return the directory to put the index into.
*/
- private File toIndexDir( ArchivaRepository repository, String indexId )
+ private File toIndexDir( ManagedRepositoryConfiguration repository, String indexId )
{
// Attempt to get the specified indexDir in the configuration first.
ManagedRepositoryConfiguration repoConfig =
@@ -81,7 +80,7 @@ public class LuceneRepositoryContentIndexFactory
if ( repoConfig == null )
{
// No configured index dir, use the repository path instead.
- String repoPath = repository.getUrl().getPath();
+ String repoPath = repository.getLocation();
indexDir = new File( repoPath, ".index/" + indexId + "/" );
}
else
@@ -90,7 +89,7 @@ public class LuceneRepositoryContentIndexFactory
String repoPath = repoConfig.getIndexDir();
if ( StringUtils.isBlank( repoPath ) )
{
- repoPath = repository.getUrl().getPath();
+ repoPath = repository.getLocation();
if ( !repoPath.endsWith( "/" ) )
{
repoPath += "/";
diff --git a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java
index c98d2500a..3021ab2a5 100644
--- a/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java
+++ b/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java
@@ -41,7 +41,6 @@ import org.apache.maven.archiva.indexer.hashcodes.HashcodesKeys;
import org.apache.maven.archiva.indexer.lucene.LuceneEntryConverter;
import org.apache.maven.archiva.indexer.lucene.LuceneQuery;
import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord;
-import org.apache.maven.archiva.repository.ArchivaConfigurationAdaptor;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
@@ -330,7 +329,7 @@ public class DefaultCrossRepositorySearch
{
if ( repo.isScanned() )
{
- localIndexedRepositories.add( ArchivaConfigurationAdaptor.toArchivaRepository( repo ) );
+ localIndexedRepositories.add( repo );
}
}
}
diff --git a/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractIndexerTestCase.java b/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractIndexerTestCase.java
index a670a1619..3aaec0272 100644
--- a/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractIndexerTestCase.java
+++ b/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractIndexerTestCase.java
@@ -19,7 +19,6 @@ package org.apache.maven.archiva.indexer;
* under the License.
*/
-import org.apache.commons.lang.StringUtils;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexWriter;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
@@ -27,7 +26,6 @@ import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.indexer.lucene.LuceneIndexHandlers;
import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord;
import org.apache.maven.archiva.model.ArchivaArtifact;
-import org.apache.maven.archiva.model.ArchivaRepository;
import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.util.FileUtils;
@@ -73,7 +71,7 @@ public abstract class AbstractIndexerTestCase
}
public abstract RepositoryContentIndex createIndex( RepositoryContentIndexFactory indexFactory,
- ArchivaRepository repository );
+ ManagedRepositoryConfiguration repository );
public abstract LuceneIndexHandlers getIndexHandler();
@@ -86,14 +84,14 @@ public abstract class AbstractIndexerTestCase
(RepositoryContentIndexFactory) lookup( RepositoryContentIndexFactory.class
.getName(), "lucene" );
- ArchivaRepository repository = createTestIndex( getIndexName() );
+ ManagedRepositoryConfiguration repository = createTestIndex( getIndexName() );
index = createIndex( indexFactory, repository );
indexHandlers = getIndexHandler();
}
- private ArchivaRepository createTestIndex( String indexName )
+ private ManagedRepositoryConfiguration createTestIndex( String indexName )
throws Exception
{
File repoDir = new File( getBasedir(), "src/test/managed-repository" );
@@ -106,10 +104,8 @@ public abstract class AbstractIndexerTestCase
assertTrue( "Default Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() );
- String repoUri = "file://" + StringUtils.replace( repoDir.getAbsolutePath(), "\\", "/" );
-
- ArchivaRepository repository =
- new ArchivaRepository( TEST_DEFAULT_REPO_ID, TEST_DEFAULT_REPOSITORY_NAME, repoUri );
+ ManagedRepositoryConfiguration repository = createRepository( TEST_DEFAULT_REPO_ID,
+ TEST_DEFAULT_REPOSITORY_NAME, repoDir );
File indexLocation = new File( testIndexesDir, "/index-" + indexName + "-" + getName() + "/" );
@@ -228,4 +224,13 @@ public abstract class AbstractIndexerTestCase
writer.optimize();
writer.close();
}
+
+ protected ManagedRepositoryConfiguration createRepository( String id, String name, File location )
+ {
+ ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
+ repo.setId( id );
+ repo.setName( name );
+ repo.setLocation( location.getAbsolutePath() );
+ return repo;
+ }
}
diff --git a/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeIndexTest.java b/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeIndexTest.java
index c0db8e536..a4bba0f41 100644
--- a/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeIndexTest.java
+++ b/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeIndexTest.java
@@ -19,13 +19,13 @@ package org.apache.maven.archiva.indexer.bytecode;
* under the License.
*/
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.indexer.AbstractIndexCreationTestCase;
import org.apache.maven.archiva.indexer.RepositoryContentIndex;
import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory;
import org.apache.maven.archiva.indexer.lucene.LuceneIndexHandlers;
import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord;
import org.apache.maven.archiva.model.ArchivaArtifact;
-import org.apache.maven.archiva.model.ArchivaRepository;
import java.io.File;
import java.util.Map;
@@ -48,7 +48,7 @@ public class BytecodeIndexTest extends AbstractIndexCreationTestCase
return new BytecodeHandlers();
}
- public RepositoryContentIndex createIndex( RepositoryContentIndexFactory indexFactory, ArchivaRepository repository )
+ public RepositoryContentIndex createIndex( RepositoryContentIndexFactory indexFactory, ManagedRepositoryConfiguration repository )
{
return indexFactory.createBytecodeIndex( repository );
}
diff --git a/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeSearchTest.java b/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeSearchTest.java
index 46c0ca84f..2dba5a4b2 100644
--- a/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeSearchTest.java
+++ b/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeSearchTest.java
@@ -22,13 +22,13 @@ package org.apache.maven.archiva.indexer.bytecode;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.MatchAllDocsQuery;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.indexer.AbstractSearchTestCase;
import org.apache.maven.archiva.indexer.ArtifactKeys;
import org.apache.maven.archiva.indexer.RepositoryContentIndex;
import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory;
import org.apache.maven.archiva.indexer.lucene.LuceneIndexHandlers;
import org.apache.maven.archiva.model.ArchivaArtifact;
-import org.apache.maven.archiva.model.ArchivaRepository;
import java.io.File;
import java.util.HashMap;
@@ -54,7 +54,7 @@ public class BytecodeSearchTest extends AbstractSearchTestCase
return new BytecodeHandlers();
}
- public RepositoryContentIndex createIndex( RepositoryContentIndexFactory indexFactory, ArchivaRepository repository )
+ public RepositoryContentIndex createIndex( RepositoryContentIndexFactory indexFactory, ManagedRepositoryConfiguration repository )
{
return indexFactory.createBytecodeIndex( repository );
}
diff --git a/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesIndexTest.java b/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesIndexTest.java
index 2bb635078..6f03d560d 100644
--- a/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesIndexTest.java
+++ b/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesIndexTest.java
@@ -19,13 +19,13 @@ package org.apache.maven.archiva.indexer.hashcodes;
* under the License.
*/
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.indexer.AbstractIndexCreationTestCase;
import org.apache.maven.archiva.indexer.RepositoryContentIndex;
import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory;
import org.apache.maven.archiva.indexer.lucene.LuceneIndexHandlers;
import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord;
import org.apache.maven.archiva.model.ArchivaArtifact;
-import org.apache.maven.archiva.model.ArchivaRepository;
/**
* HashcodesIndexTest
@@ -45,7 +45,7 @@ public class HashcodesIndexTest extends AbstractIndexCreationTestCase
return new HashcodesHandlers();
}
- public RepositoryContentIndex createIndex( RepositoryContentIndexFactory indexFactory, ArchivaRepository repository )
+ public RepositoryContentIndex createIndex( RepositoryContentIndexFactory indexFactory, ManagedRepositoryConfiguration repository )
{
return indexFactory.createHashcodeIndex( repository );
}
diff --git a/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesSearchTest.java b/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesSearchTest.java
index 18a688f03..b0d7b71ab 100644
--- a/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesSearchTest.java
+++ b/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesSearchTest.java
@@ -22,13 +22,13 @@ package org.apache.maven.archiva.indexer.hashcodes;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.MatchAllDocsQuery;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.indexer.AbstractSearchTestCase;
import org.apache.maven.archiva.indexer.ArtifactKeys;
import org.apache.maven.archiva.indexer.RepositoryContentIndex;
import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory;
import org.apache.maven.archiva.indexer.lucene.LuceneIndexHandlers;
import org.apache.maven.archiva.model.ArchivaArtifact;
-import org.apache.maven.archiva.model.ArchivaRepository;
import java.io.File;
import java.util.HashMap;
@@ -54,7 +54,7 @@ public class HashcodesSearchTest extends AbstractSearchTestCase
return new HashcodesHandlers();
}
- public RepositoryContentIndex createIndex( RepositoryContentIndexFactory indexFactory, ArchivaRepository repository )
+ public RepositoryContentIndex createIndex( RepositoryContentIndexFactory indexFactory, ManagedRepositoryConfiguration repository )
{
return indexFactory.createHashcodeIndex( repository );
}
diff --git a/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.java b/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.java
index 40c9e054b..fef16cba7 100644
--- a/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.java
+++ b/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.java
@@ -19,7 +19,6 @@ package org.apache.maven.archiva.indexer.search;
* under the License.
*/
-import org.apache.commons.lang.StringUtils;
import org.apache.lucene.search.Hits;
import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.Query;
@@ -29,7 +28,6 @@ import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.indexer.MockConfiguration;
import org.apache.maven.archiva.indexer.RepositoryContentIndex;
import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory;
-import org.apache.maven.archiva.model.ArchivaRepository;
import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.util.FileUtils;
@@ -62,10 +60,7 @@ public class DefaultCrossRepositorySearchTest
assertTrue( "Default Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() );
- String repoUri = "file://" + StringUtils.replace( repoDir.getAbsolutePath(), "\\", "/" );
-
- ArchivaRepository repository =
- new ArchivaRepository( TEST_DEFAULT_REPO_ID, TEST_DEFAULT_REPOSITORY_NAME, repoUri );
+ ManagedRepositoryConfiguration repository = createRepository( TEST_DEFAULT_REPO_ID, TEST_DEFAULT_REPOSITORY_NAME, repoDir );
File indexLocation = new File( "target/index-crossrepo-" + getName() + "/" );
@@ -168,4 +163,13 @@ public class DefaultCrossRepositorySearchTest
assertEquals( "Search Result Hits", hitCount, results.getHits().size() );
}
+
+ protected ManagedRepositoryConfiguration createRepository( String id, String name, File location )
+ {
+ ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
+ repo.setId( id );
+ repo.setName( name );
+ repo.setLocation( location.getAbsolutePath() );
+ return repo;
+ }
}