Exemplo n.º 1
0
  @Test
  public void testGenerateServiceInfo() {
    TestHelper.INSTANCE.initialize();
    GregorianCalendar start = new GregorianCalendar(2010, 0, 1, 15, 0, 0);
    GregorianCalendar end = new GregorianCalendar(2010, 2, 3, 15, 0, 0);
    RecurrenceType r = new RecurrenceType(RecurrenceFreq.FREQ_DAILY, 1, 0, null);

    Schedule s =
        new Schedule(
            ACTIVATION_TYPE.RESERVATION_AUTOMATIC,
            "unknown",
            "unAssigned",
            State.SCHEDULE.EXECUTION_PENDING,
            start.getTimeInMillis(),
            Long.valueOf(end.getTimeInMillis()),
            60 * 60 * 1000,
            new UserType(null, null, null, null, null, null, null),
            null,
            true,
            r,
            null);

    log.debug("Created serviceInfo from " + s.toDebugString());
    try {
      long[][] res = LpcpAdminManager.INSTANCE.generateServiceInfo(s);
      assertEquals(62, res.length);

      for (long[] r1 : res) {
        log.debug(
            "Schedule starts "
                + r1[0]
                + "("
                + new Date(r1[0]).toString()
                + ") and ends at "
                + r1[1]
                + "("
                + new Date(r1[1]).toString()
                + ")");
      }
    } catch (NrbException e) {
      log.error("Error: ", e);
      fail("See previous stack trace");
    }
  }
Exemplo n.º 2
0
 @Test
 public void testGetInstance() {
   TestHelper.INSTANCE.initialize();
 }