From: James William Dumay Date: Fri, 5 Dec 2008 07:09:29 +0000 (+0000) Subject: Remove content tests X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1368d14cd6099e7ed78b75573fef76e22c0fbd40;p=archiva.git Remove content tests git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-search-improvements@723624 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.java b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.java index bfbe2b9af..3b411d15e 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.java @@ -142,22 +142,6 @@ public class DefaultCrossRepositorySearchTest assertSearchResults( expectedRepos, expectedResults, search, "org", null, false ); } - public void testSearchTerm_Junit() - throws Exception - { - CrossRepositorySearch search = lookupCrossRepositorySearch(); - - String expectedRepos[] = new String[] { - TEST_DEFAULT_REPO_ID - }; - - String expectedResults[] = new String[] { - "junit","junit2","junit3" - }; - - assertSearchResults( expectedRepos, expectedResults, search, "junit", null, false ); - } - public void testSearchInvalidTerm() throws Exception { @@ -174,44 +158,6 @@ public class DefaultCrossRepositorySearchTest assertSearchResults( expectedRepos, expectedResults, search, "monosodium", null, false ); } - public void testSearchWithinSearchResults() - throws Exception - { - CrossRepositorySearch search = lookupCrossRepositorySearch(); - - String expectedRepos[] = new String[] { - TEST_DEFAULT_REPO_ID - }; - - String expectedResults[] = new String[] { - "org","org2","org3","org4","org5","org6","org7" - }; - - // first search - assertSearchResults( expectedRepos, expectedResults, search, "org", null, false ); - - List previousSearchTerms = new ArrayList(); - previousSearchTerms.add( "org" ); - String secondSearchExpectedResults[] = new String[] { - "org.apache.maven.archiva.record", "org.apache.maven.archiva.record2", - "org.apache.maven.archiva.record3", "org.apache.maven.archiva.record4", - "org.apache.maven.archiva.record5", "org.apache.maven.archiva.record6", - "org.apache.maven.archiva.record7" - }; - - //second search - assertSearchResults( expectedRepos, secondSearchExpectedResults, search, "org.apache.maven.archiva.record", - previousSearchTerms, false ); - - previousSearchTerms.add( "org.apache.maven.archiva.record" ); - String thirdSearchExpectedResults[] = new String[] { - "junit", "junit2", "junit3" - }; - - //third search - assertSearchResults( expectedRepos, thirdSearchExpectedResults, search, "junit", previousSearchTerms, false ); - } - public void testSearchForClassesAndPackages() throws Exception { diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/FileContentIndexPopulator.java b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/FileContentIndexPopulator.java index c0dc214e8..12e2f4e6b 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/FileContentIndexPopulator.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/FileContentIndexPopulator.java @@ -78,16 +78,6 @@ public class FileContentIndexPopulator record.setRepositoryId( "test-repo" ); record.setFilename( path ); - try - { - record.setContents( FileUtils.readFileToString( pathToFile, null ) ); - } - catch ( IOException e ) - { - e.printStackTrace(); - throw new AssertionFailedError( "Can't load test file contents: " + pathToFile.getAbsolutePath() ); - } - return record; } }