fix some formatting I broke!

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1203197 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-11-17 14:18:45 +00:00
parent 3e47bcb15c
commit f8d3094638
6 changed files with 60 additions and 60 deletions

View File

@ -20,7 +20,6 @@ package org.apache.archiva.indexer.merger;
import org.apache.maven.index.context.IndexingContext; import org.apache.maven.index.context.IndexingContext;
import java.io.File;
import java.util.Collection; import java.util.Collection;
/** /**

View File

@ -123,8 +123,8 @@ public class SearchResults
} }
/** /**
* @since 1.4-M1
* @return * @return
* @since 1.4-M1
*/ */
public int getTotalHitsMapSize() public int getTotalHitsMapSize()
{ {
@ -132,10 +132,10 @@ public class SearchResults
} }
/** /**
* @since 1.4-M1
* @param totalHitsMapSize * @param totalHitsMapSize
* @since 1.4-M1
*/ */
public void setTotalHitsMapSize(int totalHitsMapSize) public void setTotalHitsMapSize( int totalHitsMapSize )
{ {
this.totalHitsMapSize = totalHitsMapSize; this.totalHitsMapSize = totalHitsMapSize;
} }

View File

@ -39,11 +39,11 @@ public class NexusRepositorySearchPaginateTest
{ {
NexusRepositorySearch search = new NexusRepositorySearch(); NexusRepositorySearch search = new NexusRepositorySearch();
SearchResults searchResults = build(10, new SearchResultLimits(0)); SearchResults searchResults = build( 10, new SearchResultLimits( 0 ) );
searchResults = search.paginate(searchResults); searchResults = search.paginate( searchResults );
assertEquals(10, searchResults.getReturnedHitsCount()); assertEquals( 10, searchResults.getReturnedHitsCount() );
} }
@ -53,17 +53,17 @@ public class NexusRepositorySearchPaginateTest
{ {
NexusRepositorySearch search = new NexusRepositorySearch(); NexusRepositorySearch search = new NexusRepositorySearch();
SearchResults origSearchResults = build(63, new SearchResultLimits(0)); SearchResults origSearchResults = build( 63, new SearchResultLimits( 0 ) );
SearchResults searchResults = search.paginate(origSearchResults); SearchResults searchResults = search.paginate( origSearchResults );
assertEquals(30, searchResults.getReturnedHitsCount()); assertEquals( 30, searchResults.getReturnedHitsCount() );
origSearchResults = build(63, new SearchResultLimits(1)); origSearchResults = build( 63, new SearchResultLimits( 1 ) );
searchResults = search.paginate(origSearchResults); searchResults = search.paginate( origSearchResults );
assertEquals(30, searchResults.getReturnedHitsCount()); assertEquals( 30, searchResults.getReturnedHitsCount() );
} }
@ -73,32 +73,32 @@ public class NexusRepositorySearchPaginateTest
{ {
NexusRepositorySearch search = new NexusRepositorySearch(); NexusRepositorySearch search = new NexusRepositorySearch();
SearchResults searchResults = build(32, new SearchResultLimits(1)); SearchResults searchResults = build( 32, new SearchResultLimits( 1 ) );
searchResults = search.paginate(searchResults); searchResults = search.paginate( searchResults );
assertEquals(2, searchResults.getReturnedHitsCount()); assertEquals( 2, searchResults.getReturnedHitsCount() );
} }
SearchResults build(int number, SearchResultLimits limits) SearchResults build( int number, SearchResultLimits limits )
{ {
SearchResults searchResults = new SearchResults(); SearchResults searchResults = new SearchResults();
searchResults.setLimits(limits); searchResults.setLimits( limits );
for ( int i = 0; i < number; i++ ) for ( int i = 0; i < number; i++ )
{ {
SearchResultHit hit = new SearchResultHit(); SearchResultHit hit = new SearchResultHit();
hit.setGroupId("commons-foo"); hit.setGroupId( "commons-foo" );
hit.setArtifactId("commons-bar-" + i); hit.setArtifactId( "commons-bar-" + i );
hit.setPackaging("jar"); hit.setPackaging( "jar" );
hit.setVersions(Arrays.asList("1.0")); hit.setVersions( Arrays.asList( "1.0" ) );
String id = String id =
SearchUtil.getHitId(hit.getGroupId(), hit.getArtifactId(), hit.getClassifier(), hit.getPackaging()); SearchUtil.getHitId( hit.getGroupId(), hit.getArtifactId(), hit.getClassifier(), hit.getPackaging() );
searchResults.addHit(id, hit); searchResults.addHit( id, hit );
} }
searchResults.setTotalHits(number); searchResults.setTotalHits( number );
return searchResults; return searchResults;
} }

View File

@ -118,7 +118,7 @@ public class NexusRepositorySearchTest
archivaConfigControl.reset(); archivaConfigControl.reset();
// search groupId // search groupId
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -141,7 +141,7 @@ public class NexusRepositorySearchTest
List<String> selectedRepos = Arrays.asList( TEST_REPO_1 ); List<String> selectedRepos = Arrays.asList( TEST_REPO_1 );
// search artifactId // search artifactId
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -161,7 +161,7 @@ public class NexusRepositorySearchTest
archivaConfigControl.reset(); archivaConfigControl.reset();
// search groupId // search groupId
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -185,7 +185,7 @@ public class NexusRepositorySearchTest
selectedRepos.add( TEST_REPO_1 ); selectedRepos.add( TEST_REPO_1 );
// search artifactId // search artifactId
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -215,7 +215,7 @@ public class NexusRepositorySearchTest
selectedRepos.add( TEST_REPO_1 ); selectedRepos.add( TEST_REPO_1 );
// search artifactId // search artifactId
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -251,7 +251,7 @@ public class NexusRepositorySearchTest
List<String> selectedRepos = new ArrayList<String>(); List<String> selectedRepos = new ArrayList<String>();
selectedRepos.add( TEST_REPO_1 ); selectedRepos.add( TEST_REPO_1 );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
SearchResults results = search.search( "user", selectedRepos, "archiva search", null, null ); SearchResults results = search.search( "user", selectedRepos, "archiva search", null, null );
@ -275,7 +275,7 @@ public class NexusRepositorySearchTest
SearchResultLimits limits = new SearchResultLimits( 0 ); SearchResultLimits limits = new SearchResultLimits( 0 );
limits.setPageSize( 1 ); limits.setPageSize( 1 );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -295,7 +295,7 @@ public class NexusRepositorySearchTest
limits = new SearchResultLimits( 1 ); limits = new SearchResultLimits( 1 );
limits.setPageSize( 1 ); limits.setPageSize( 1 );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -330,7 +330,7 @@ public class NexusRepositorySearchTest
config.addManagedRepository( createRepositoryConfig( TEST_REPO_2 ) ); config.addManagedRepository( createRepositoryConfig( TEST_REPO_2 ) );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 5 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 5 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -365,7 +365,7 @@ public class NexusRepositorySearchTest
List<String> selectedRepos = new ArrayList<String>(); List<String> selectedRepos = new ArrayList<String>();
selectedRepos.add( TEST_REPO_1 ); selectedRepos.add( TEST_REPO_1 );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -384,7 +384,7 @@ public class NexusRepositorySearchTest
List<String> selectedRepos = new ArrayList<String>(); List<String> selectedRepos = new ArrayList<String>();
selectedRepos.add( TEST_REPO_1 ); selectedRepos.add( TEST_REPO_1 );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -402,7 +402,7 @@ public class NexusRepositorySearchTest
List<String> selectedRepos = new ArrayList<String>(); List<String> selectedRepos = new ArrayList<String>();
selectedRepos.add( "non-existing-repo" ); selectedRepos.add( "non-existing-repo" );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -425,7 +425,7 @@ public class NexusRepositorySearchTest
List<String> previousSearchTerms = new ArrayList<String>(); List<String> previousSearchTerms = new ArrayList<String>();
previousSearchTerms.add( "archiva-test" ); previousSearchTerms.add( "archiva-test" );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -463,7 +463,7 @@ public class NexusRepositorySearchTest
searchFields.setVersion( "1.0" ); searchFields.setVersion( "1.0" );
searchFields.setRepositories( selectedRepos ); searchFields.setRepositories( selectedRepos );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -498,7 +498,7 @@ public class NexusRepositorySearchTest
SearchResultLimits limits = new SearchResultLimits( 0 ); SearchResultLimits limits = new SearchResultLimits( 0 );
limits.setPageSize( 1 ); limits.setPageSize( 1 );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -516,7 +516,7 @@ public class NexusRepositorySearchTest
limits = new SearchResultLimits( 1 ); limits = new SearchResultLimits( 1 );
limits.setPageSize( 1 ); limits.setPageSize( 1 );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -548,7 +548,7 @@ public class NexusRepositorySearchTest
searchFields.setArtifactId( "artifactid-numeric" ); searchFields.setArtifactId( "artifactid-numeric" );
searchFields.setRepositories( selectedRepos ); searchFields.setRepositories( selectedRepos );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -591,7 +591,7 @@ public class NexusRepositorySearchTest
try try
{ {
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -625,7 +625,7 @@ public class NexusRepositorySearchTest
try try
{ {
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -658,7 +658,7 @@ public class NexusRepositorySearchTest
searchFields.setClassName( "org.apache.archiva.test.App" ); searchFields.setClassName( "org.apache.archiva.test.App" );
searchFields.setRepositories( selectedRepos ); searchFields.setRepositories( selectedRepos );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -689,7 +689,7 @@ public class NexusRepositorySearchTest
searchFields.setPackaging( "jar" ); searchFields.setPackaging( "jar" );
searchFields.setRepositories( selectedRepos ); searchFields.setRepositories( selectedRepos );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -740,7 +740,7 @@ public class NexusRepositorySearchTest
searchFields.setClassName( "com.classname.search.App" ); searchFields.setClassName( "com.classname.search.App" );
searchFields.setRepositories( selectedRepos ); searchFields.setRepositories( selectedRepos );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -768,7 +768,7 @@ public class NexusRepositorySearchTest
searchFields.setGroupId( "org.apache.archiva" ); searchFields.setGroupId( "org.apache.archiva" );
searchFields.setRepositories( selectedRepos ); searchFields.setRepositories( selectedRepos );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -792,7 +792,7 @@ public class NexusRepositorySearchTest
searchFields.setClassName( "SomeClass" ); searchFields.setClassName( "SomeClass" );
searchFields.setRepositories( selectedRepos ); searchFields.setRepositories( selectedRepos );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -806,13 +806,14 @@ public class NexusRepositorySearchTest
} }
@Test @Test
public void getAllGroupIds() throws Exception public void getAllGroupIds()
throws Exception
{ {
createIndexContainingMoreArtifacts( true ); createIndexContainingMoreArtifacts( true );
List<String> selectedRepos = Arrays.asList( TEST_REPO_1 ); List<String> selectedRepos = Arrays.asList( TEST_REPO_1 );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 0 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 0, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();
@ -823,8 +824,8 @@ public class NexusRepositorySearchTest
log.info( "groupIds: " + groupIds ); log.info( "groupIds: " + groupIds );
assertEquals( 3, groupIds.size() ); assertEquals( 3, groupIds.size() );
assertTrue( groupIds.contains( "com" )); assertTrue( groupIds.contains( "com" ) );
assertTrue( groupIds.contains( "org.apache.felix") ); assertTrue( groupIds.contains( "org.apache.felix" ) );
assertTrue( groupIds.contains( "org.apache.archiva" ) ); assertTrue( groupIds.contains( "org.apache.archiva" ) );
} }
@ -840,7 +841,7 @@ public class NexusRepositorySearchTest
searchFields.setClassName( "SomeClass" ); searchFields.setClassName( "SomeClass" );
searchFields.setRepositories( selectedRepos ); searchFields.setRepositories( selectedRepos );
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config , 1 , 2 ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 1, 2 );
archivaConfigControl.replay(); archivaConfigControl.replay();