Package er.chronic.repeaters

Examples of er.chronic.repeaters.RepeaterWeekend


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

  public void testNextFuture() {
    RepeaterWeekend weekends = new RepeaterWeekend();
    weekends.setStart(_now);

    Span nextWeekend = weekends.nextSpan(Pointer.PointerType.FUTURE);
    assertEquals(Time.construct(2006, 8, 19), nextWeekend.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 21), nextWeekend.getEndCalendar());
  }
View Full Code Here


    assertEquals(Time.construct(2006, 8, 19), nextWeekend.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 21), nextWeekend.getEndCalendar());
  }

  public void testNextPast() {
    RepeaterWeekend weekends = new RepeaterWeekend();
    weekends.setStart(_now);
    Span lastWeekend = weekends.nextSpan(Pointer.PointerType.PAST);
    assertEquals(Time.construct(2006, 8, 12), lastWeekend.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 14), lastWeekend.getEndCalendar());
  }
View Full Code Here

    assertEquals(Time.construct(2006, 8, 12), lastWeekend.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 14), lastWeekend.getEndCalendar());
  }

  public void testThisFuture() {
    RepeaterWeekend weekends = new RepeaterWeekend();
    weekends.setStart(_now);

    Span thisWeekend = weekends.thisSpan(Pointer.PointerType.FUTURE);
    assertEquals(Time.construct(2006, 8, 19), thisWeekend.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 21), thisWeekend.getEndCalendar());
  }
View Full Code Here

    assertEquals(Time.construct(2006, 8, 19), thisWeekend.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 21), thisWeekend.getEndCalendar());
  }

  public void testThisPast() {
    RepeaterWeekend weekends = new RepeaterWeekend();
    weekends.setStart(_now);

    Span thisWeekend = weekends.thisSpan(Pointer.PointerType.PAST);
    assertEquals(Time.construct(2006, 8, 12), thisWeekend.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 14), thisWeekend.getEndCalendar());
  }
View Full Code Here

    assertEquals(Time.construct(2006, 8, 12), thisWeekend.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 14), thisWeekend.getEndCalendar());
  }

  public void testThisNone() {
    RepeaterWeekend weekends = new RepeaterWeekend();
    weekends.setStart(_now);

    Span thisWeekend = weekends.thisSpan(Pointer.PointerType.FUTURE);
    assertEquals(Time.construct(2006, 8, 19), thisWeekend.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 21), thisWeekend.getEndCalendar());
  }
View Full Code Here

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

    Span offsetSpan;

    offsetSpan = new RepeaterWeekend().getOffset(span, 3, Pointer.PointerType.FUTURE);
    assertEquals(Time.construct(2006, 9, 2), offsetSpan.getBeginCalendar());
    assertEquals(Time.construct(2006, 9, 2, 0, 0, 1), offsetSpan.getEndCalendar());

    offsetSpan = new RepeaterWeekend().getOffset(span, 1, Pointer.PointerType.PAST);
    assertEquals(Time.construct(2006, 8, 12), offsetSpan.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 12, 0, 0, 1), offsetSpan.getEndCalendar());

    offsetSpan = new RepeaterWeekend().getOffset(span, 0, Pointer.PointerType.FUTURE);
    assertEquals(Time.construct(2006, 8, 12), offsetSpan.getBeginCalendar());
    assertEquals(Time.construct(2006, 8, 12, 0, 0, 1), offsetSpan.getEndCalendar());
  }
View Full Code Here

TOP

Related Classes of er.chronic.repeaters.RepeaterWeekend

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.