config.addManagedRepository( createRepositoryConfig( TEST_REPO_2 ) );
}
- private void createIndexForQuickSearch()
+ private void createSimpleIndex()
throws IOException, UnsupportedExistingLuceneIndexException, IllegalArtifactCoordinateException
{
List<File> files = new ArrayList<File>();
createIndex( TEST_REPO_1, files );
}
+
+ private void createIndexContainingMoreArtifacts()
+ throws IOException, UnsupportedExistingLuceneIndexException, IllegalArtifactCoordinateException
+ {
+ List<File> files = new ArrayList<File>();
+ files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
+ "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
+ files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
+ "/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.jar" ) );
+ files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
+ "/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.jar" ) );
+ files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
+ "/org/apache/archiva/archiva-webapp/1.0/archiva-webapp-1.0.war" ) );
+ files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
+ "/com/artifactid-numeric/1.0/artifactid-numeric-1.0.jar" ) );
+ files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
+ "/com/artifactid-numeric123/1.0/artifactid-numeric123-1.0.jar" ) );
+ files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
+ "/com/classname-search/1.0/classname-search-1.0.jar" ) );
+
+ createIndex( TEST_REPO_1, files );
+ }
private ManagedRepositoryConfiguration createRepositoryConfig( String repository )
{
public void testQuickSearch()
throws Exception
{
- createIndexForQuickSearch();
+ createSimpleIndex();
List<String> selectedRepos = new ArrayList<String>();
selectedRepos.add( TEST_REPO_1 );
public void testQuickSearchWithMultipleKeywords()
throws Exception
{
- createIndexForQuickSearch();
+ createSimpleIndex();
List<String> selectedRepos = new ArrayList<String>();
selectedRepos.add( TEST_REPO_1 );
public void testQuickSearchWithPagination()
throws Exception
{
- createIndexForQuickSearch();
+ createSimpleIndex();
List<String> selectedRepos = new ArrayList<String>();
selectedRepos.add( TEST_REPO_1 );
public void testArtifactFoundInMultipleRepositories()
throws Exception
{
- createIndexForQuickSearch();
+ createSimpleIndex();
List<File> files = new ArrayList<File>();
files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_2 +
public void testNoMatchFound()
throws Exception
{
- createIndexForQuickSearch();
+ createSimpleIndex();
List<String> selectedRepos = new ArrayList<String>();
selectedRepos.add( TEST_REPO_1 );
public void testSearchWithinSearchResults()
throws Exception
{
- createIndexForQuickSearch();
+ createSimpleIndex();
List<String> selectedRepos = new ArrayList<String>();
selectedRepos.add( TEST_REPO_1 );
public void testAdvancedSearchWithPagination()
throws Exception
{
- List<File> files = new ArrayList<File>();
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-webapp/1.0/archiva-webapp-1.0.war" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/com/artifactid-numeric/1.0/artifactid-numeric-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/com/artifactid-numeric123/1.0/artifactid-numeric123-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/com/classname-search/1.0/classname-search-1.0.jar" ) );
-
- createIndex( TEST_REPO_1, files );
+ createIndexContainingMoreArtifacts();
List<String> selectedRepos = new ArrayList<String>();
selectedRepos.add( TEST_REPO_1 );
public void testAdvancedSearchAllSearchCriteriaSpecified()
throws Exception
{
- List<File> files = new ArrayList<File>();
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.jar" ) );
-
- createIndex( TEST_REPO_1, files );
+ createSimpleIndex();
List<String> selectedRepos = new ArrayList<String>();
selectedRepos.add( TEST_REPO_1 );
public void testAdvancedSearchJarArtifacts()
throws Exception
{
- List<File> files = new ArrayList<File>();
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-webapp/1.0/archiva-webapp-1.0.war" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/com/artifactid-numeric/1.0/artifactid-numeric-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/com/artifactid-numeric123/1.0/artifactid-numeric123-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/com/classname-search/1.0/classname-search-1.0.jar" ) );
-
- createIndex( TEST_REPO_1, files );
+ createIndexContainingMoreArtifacts();
List<String> selectedRepos = new ArrayList<String>();
selectedRepos.add( TEST_REPO_1 );
public void testAdvancedSearchWithIncorrectPackaging()
throws Exception
{
- List<File> files = new ArrayList<File>();
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.jar" ) );
-
- createIndex( TEST_REPO_1, files );
+ createSimpleIndex();
List<String> selectedRepos = new ArrayList<String>();
selectedRepos.add( TEST_REPO_1 );
public void testAdvancedSearchClassname()
throws Exception
{
- List<File> files = new ArrayList<File>();
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/org/apache/archiva/archiva-webapp/1.0/archiva-webapp-1.0.war" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/com/artifactid-numeric/1.0/artifactid-numeric-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/com/artifactid-numeric123/1.0/artifactid-numeric123-1.0.jar" ) );
- files.add( new File( getBasedir(), "/target/test-classes/" + TEST_REPO_1 +
- "/com/classname-search/1.0/classname-search-1.0.jar" ) );
-
- createIndex( TEST_REPO_1, files );
+ createIndexContainingMoreArtifacts();
List<String> selectedRepos = new ArrayList<String>();
selectedRepos.add( TEST_REPO_1 );