Package er.chronic.repeaters

Examples of er.chronic.repeaters.RepeaterHour


    super.setUp();
    _now = Time.construct(2006, 8, 16, 14, 0, 0, 0);
  }

  public void testNextFuture() {
    RepeaterHour hours = new RepeaterHour();
    hours.setStart(_now);

    Span nextHour = hours.nextSpan(Pointer.PointerType.FUTURE);
    assertEquals(Time.construct(2006, 8, 16, 15), nextHour.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 16, 16), nextHour.getEndCalendar());

    Span nextNextHour = hours.nextSpan(Pointer.PointerType.FUTURE);
    assertEquals(Time.construct(2006, 8, 16, 16), nextNextHour.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 16, 17), nextNextHour.getEndCalendar());
  }
View Full Code Here


    assertEquals(Time.construct(2006, 8, 16, 16), nextNextHour.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 16, 17), nextNextHour.getEndCalendar());
  }

  public void testNextPast() {
    RepeaterHour hours = new RepeaterHour();
    hours.setStart(_now);
    Span lastHour = hours.nextSpan(Pointer.PointerType.PAST);
    assertEquals(Time.construct(2006, 8, 16, 13), lastHour.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 16, 14), lastHour.getEndCalendar());

    Span lastLastHour = hours.nextSpan(Pointer.PointerType.PAST);
    assertEquals(Time.construct(2006, 8, 16, 12), lastLastHour.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 16, 13), lastLastHour.getEndCalendar());
  }
View Full Code Here

  }

  public void testThis() {
    _now = Time.construct(2006, 8, 16, 14, 30);

    RepeaterHour hours = new RepeaterHour();
    hours.setStart(_now);

    Span thisHour;
    thisHour = hours.thisSpan(Pointer.PointerType.FUTURE);
    assertEquals(Time.construct(2006, 8, 16, 14, 31), thisHour.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 16, 15), thisHour.getEndCalendar());

    thisHour = hours.thisSpan(Pointer.PointerType.PAST);
    assertEquals(Time.construct(2006, 8, 16, 14), thisHour.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 16, 14, 30), thisHour.getEndCalendar());
  }
View Full Code Here

  public void testOffset() {
      Span span = new Span(_now, Calendar.SECOND, 1);

      Span offsetSpan;
      offsetSpan = new RepeaterHour().getOffset(span, 3, Pointer.PointerType.FUTURE);

      assertEquals(Time.construct(2006, 8, 16, 17), offsetSpan.getBeginCalendar());
      assertEquals(Time.construct(2006, 8, 16, 17, 0, 1), offsetSpan.getEndCalendar());

      offsetSpan = new RepeaterHour().getOffset(span, 24, Pointer.PointerType.PAST);

      assertEquals(Time.construct(2006, 8, 15, 14), offsetSpan.getBeginCalendar());
      assertEquals(Time.construct(2006, 8, 15, 14, 0, 1), offsetSpan.getEndCalendar());
  }
View Full Code Here

TOP

Related Classes of er.chronic.repeaters.RepeaterHour

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.