コード例 #1
0
  @Test
  public void testSimplePageProvider() throws Exception {

    LogEntryGen.generate("dummy", "entry", "category", 15);
    PageProvider<?> pp =
        pps.getPageProvider(
            "SimpleESAuditPP",
            null,
            Long.valueOf(5),
            Long.valueOf(0),
            new HashMap<String, Serializable>());
    assertNotNull(pp);

    List<LogEntry> entries = (List<LogEntry>) pp.getCurrentPage();

    Assert.assertEquals(5, entries.size());
    Assert.assertEquals(5, pp.getCurrentPageSize());
    Assert.assertEquals(7, pp.getResultsCount());

    // check that sort does work
    Assert.assertTrue(entries.get(0).getId() < entries.get(1).getId());
    Assert.assertTrue(entries.get(3).getId() < entries.get(4).getId());
  }
コード例 #2
0
 @Override
 public long getResultsCount() {
   return pageProvider.getResultsCount();
 }