예제 #1
0
 @Test
 public void testPageSearch() throws Exception {
   System.out.println("testPageSearch");
   System.out.println("==============");
   String pql = "account?";
   int pageSize = 100;
   IScrollableResultSet<TemporalEntry<ITemporalKey<String>, ITemporalData<String>>> sr =
       temporalBiz.getEntryResultSet(pql, null, true, pageSize, true);
   int totalSize = sr.getTotalSize();
   int maxPage = totalSize / pageSize + (totalSize % pageSize > 0 ? 1 : 0);
   int size = sr.toList().size();
   int pos = (maxPage - 1) * pageSize;
   int left = totalSize - pos;
   System.out.println(
       "maxPage:"
           + maxPage
           + " totalSize:"
           + totalSize
           + " pos:"
           + pos
           + " size:"
           + size
           + " left:"
           + left);
   System.out.println();
   boolean bl = sr.goToSet(pos);
   int lastSetSize = sr.toList().size();
   Assert.assertTrue(bl);
   Assert.assertTrue(left == lastSetSize);
 }
예제 #2
0
  @Test
  public void testScrollNextSet() throws ParseException {
    System.out.println("testScrollNextSet");
    System.out.println("=================");
    String pql = "account?";

    IScrollableResultSet<TemporalEntry<ITemporalKey<String>, ITemporalData<String>>> sr =
        temporalBiz.getEntryResultSet(pql, -1, -1, null, true, 100, true);
    printEntryScrollableResultSet_NextSet(sr);
  }