make no limit working back

This commit is contained in:
Olivier Lamy 2014-04-24 11:52:05 +10:00
parent 641e04909f
commit 30d380e6b0
2 changed files with 3 additions and 2 deletions

View File

@ -274,7 +274,8 @@ public class MavenRepositorySearch
request.setContexts( getIndexingContexts( indexingContextIds ) );
if ( limits != null )
{
if ( limits.getSelectedPage() < 1 )
// we apply limits only when first page asked
if ( limits.getSelectedPage() == 0 )
{
request.setCount( limits.getPageSize() * ( Math.max( 1, limits.getSelectedPage() ) ) );
}

View File

@ -879,7 +879,7 @@ public class MavenRepositorySearchTest
repo.toURI().toURL().toExternalForm(),
indexDirectory.toURI().toURL().toString(), search.getAllIndexCreators() );
SearchResultLimits limits = new SearchResultLimits( 0 );
SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );
limits.setPageSize( 300 );
EasyMock.expect( archivaConfig.getConfiguration() ).andReturn( config ).times( 1, 5 );