[MRM-749]

o fixed pagination


git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-nexus-indexer@739952 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Maria Odea B. Ching 2009-02-02 09:46:31 +00:00
parent f3a0c76b37
commit 61d0936fc0
2 changed files with 6 additions and 4 deletions

View File

@ -263,7 +263,7 @@ public class NexusRepositorySearch
for ( int i = 0; i < fetchCount; i++ )
{
// Stop fetching if we are past the total # of available hits.
if ( offset + i > results.getTotalHits() )
if ( offset + i >= results.getHits().size() )
{
break;
}
@ -280,7 +280,7 @@ public class NexusRepositorySearch
}
}
}
paginated.setTotalHits( paginated.getHitsMap().size() );
paginated.setTotalHits( results.getTotalHits() );
return paginated;
}

View File

@ -201,7 +201,8 @@ public class NexusRepositorySearchTest
archivaConfigControl.verify();
assertNotNull( results );
assertEquals( 1, results.getTotalHits() );
assertEquals( 1, results.getHits().size() );
assertEquals( 2, results.getTotalHits() );
archivaConfigControl.reset();
@ -218,7 +219,8 @@ public class NexusRepositorySearchTest
archivaConfigControl.verify();
assertNotNull( results );
assertEquals( 1, results.getTotalHits() );
assertEquals( 1, results.getHits().size() );
assertEquals( 2, results.getTotalHits() );
}
public void testArtifactFoundInMultipleRepositories()