Package com.agiletec.plugins.jpcalendar.aps.system.services.calendar.util

Examples of com.agiletec.plugins.jpcalendar.aps.system.services.calendar.util.DateEventInfo


    assertEquals(1, info.getEndDay());
  }

  public void testIsValidEvent_NullStart_10() {
    Calendar requiredMonth = this.getRequiredMonth(1999, Calendar.MAY);
    DateEventInfo info = this.getDateEventInfoForTest(requiredMonth);

    info.setStart(null);

    Calendar endEvent = Calendar.getInstance();
    endEvent.set(Calendar.YEAR, 1999);
    endEvent.set(Calendar.MONTH, Calendar.MAY);
    endEvent.set(Calendar.DAY_OF_MONTH, 15);
    info.setEnd(endEvent.getTime());

    assertTrue(info.isValidEvent());
    assertEquals(15, info.getStartDay());
    assertEquals(15, info.getEndDay());
  }
View Full Code Here


    assertEquals(15, info.getEndDay());
  }
 
  public void testIsValidEvent_NullStart_11() {
    Calendar requiredMonth = this.getRequiredMonth(1999, Calendar.APRIL);
    DateEventInfo info = this.getDateEventInfoForTest(requiredMonth);
   
    info.setStart(null);
   
    Calendar endEvent = Calendar.getInstance();
    endEvent.set(Calendar.DAY_OF_MONTH, endEvent.getActualMinimum(Calendar.DAY_OF_MONTH));
    endEvent.set(Calendar.YEAR, 1999);
    endEvent.set(Calendar.MONTH, Calendar.APRIL);
    endEvent.set(Calendar.DAY_OF_MONTH, endEvent.getActualMaximum(Calendar.DAY_OF_MONTH));
    info.setEnd(endEvent.getTime());

    assertTrue(info.isValidEvent());
    assertEquals(endEvent.getActualMaximum(Calendar.DAY_OF_MONTH), info.getStartDay());
    assertEquals(endEvent.getActualMaximum(Calendar.DAY_OF_MONTH), info.getEndDay());
  }
View Full Code Here

    assertEquals(endEvent.getActualMaximum(Calendar.DAY_OF_MONTH), info.getEndDay());
  }
 
  public void testIsValidEvent_NullStart_12() {
    Calendar requiredMonth = this.getRequiredMonth(1999, Calendar.APRIL);
    DateEventInfo info = this.getDateEventInfoForTest(requiredMonth);

    info.setStart(null);

    Calendar endEvent = Calendar.getInstance();
    endEvent.set(Calendar.YEAR, 1999);
    endEvent.set(Calendar.MONTH, Calendar.MAY);
    endEvent.set(Calendar.DAY_OF_MONTH, 12);
    info.setEnd(endEvent.getTime());

    assertFalse(info.isValidEvent());
  }
View Full Code Here

 
  private DateEventInfo getDateEventInfoForTest(Calendar requiredMonth) {
    Date firstDayOfReqMonth = this.getFirstDay(requiredMonth);
    Date lastDayOfReqMonth = this.getLastDay(requiredMonth);

    DateEventInfo info = new DateEventInfo(firstDayOfReqMonth, lastDayOfReqMonth);
    return info;
  }
View Full Code Here

      String attributeNameStart, String attributeNameEnd) throws ApsSystemException {
    int[] eventsForMonth = new int[31];
    List<DateEventInfo> eventsInfo = this.getEventsInfo(requiredMonth, groupName,
        contentType, attributeNameStart, attributeNameEnd);
    for (int i=0; i<eventsInfo.size(); i++) {
      DateEventInfo info = (DateEventInfo) eventsInfo.get(i);
      if (info.isValidEvent()) {
        for (int j=(info.getStartDay()-1); j<=(info.getEndDay()-1); j++) {
          int eventsOfDay = eventsForMonth[j];
          eventsForMonth[j] = (++eventsOfDay);
        }
      }
    }
View Full Code Here

      stat.setString(3, attributeNameEnd);
      stat.setString(4, groupName);
      res = stat.executeQuery();
      while (res.next()) {
        String contentId = res.getString(1);
        DateEventInfo info = (DateEventInfo) eventsInfoMap.get(contentId);
        if (info == null) {
          info = new DateEventInfo(first, last);
          eventsInfoMap.put(contentId, info);
        }
        String attributeName = res.getString(2);
        if (attributeName.equalsIgnoreCase(attributeNameStart)) {
          info.setStart(res.getDate(3));
        } else if (attributeName.equalsIgnoreCase(attributeNameEnd)) {
          info.setEnd(res.getDate(3));
        }
      }
    } catch (Throwable t) {
      processDaoException(t, "Error loading calendar", "loadCalendar");
    } finally {
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpcalendar.aps.system.services.calendar.util.DateEventInfo

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.