示例#1
0
  public void testFindElementsBetween() {
    Date from = new GregorianCalendar(2015, Calendar.DECEMBER, 8).getTime();
    Date to = new GregorianCalendar(2016, Calendar.FEBRUARY, 20).getTime();

    logTest(
        "testFindElementsBetween: %s, %s, which: %s",
        Util.SIMPLE_DATE_FORMAT.format(from),
        Util.SIMPLE_DATE_FORMAT.format(to),
        ss.pkez().getName());

    List<TTransaction> list = ts.findElementsBetween(from, to, ss.pkez());

    for (TTransaction e : list) log("tr: %s", e);
  }
示例#2
0
  public void testFindFirstPivotAfter() {
    Date date = new GregorianCalendar(2015, Calendar.DECEMBER, 8).getTime();
    logTest(
        "testFindFirstPivotAfter: %s, which: %s",
        Util.SIMPLE_DATE_FORMAT.format(date), ss.pkez().getName());

    TTransaction e = ts.findFirstPivotAfter(date, ss.pkez());
    log("Pivot found: %s", e);
  }
示例#3
0
  public void testFindFirstPivotAfter_WhenNoPivot() {
    Date date = new GregorianCalendar(2016, Calendar.APRIL, 22).getTime();
    logTest(
        "testFindFirstPivotAfter_WhenNoPivot: %s, which: %s",
        Util.SIMPLE_DATE_FORMAT.format(date), ss.pkez().getName());

    TTransaction fromPivot = ts.findLastPivotBefore(date, ss.pkez());
    log("Pivot found before: %s", fromPivot);

    TTransaction toPivot = ts.findFirstPivotAfter(date, ss.pkez());
    log("Pivot found after : %s [should be null]", toPivot);

    List<TTransaction> dirtyElements =
        ts.findElementsBetween(
            fromPivot == null ? date : fromPivot.getDate(),
            toPivot == null ? null : toPivot.getDate(),
            ss.pkez());

    log("The dirty list is as follows:");
    for (TTransaction t : dirtyElements) log("dirty: %s", t);
  }