Package org.libreplan.ws.calendars.api

Examples of org.libreplan.ws.calendars.api.CalendarExceptionDTO


    @Transactional
    public void testAddValidBaseCalendar() throws InstanceNotFoundException {

        /* Build valid base calendar "bc1" (5 constraint violations). */
        /* Build a calendar exception */
        CalendarExceptionDTO exceptionDTO_1 = new CalendarExceptionDTO(
                getUniqueName(), toXml(getValidDate(0)), new Integer(7),
                addedExceptionType.getCode());

        CalendarExceptionDTO exceptionDTO_2 = new CalendarExceptionDTO(
                getUniqueName(), toXml(getValidDate(1)), new Integer(7),
                addedExceptionType.getCode());

        List<CalendarExceptionDTO> calendarExceptions = new ArrayList<CalendarExceptionDTO>();
        calendarExceptions.add(exceptionDTO_1);
View Full Code Here


    @Test
    @Transactional
    public void testAddInvalidBaseCalendar() throws InstanceNotFoundException {
        /* Build valid base calendar "bc1" (5 constraint violations). */
        /* Build two calendar exception with the same date */
        CalendarExceptionDTO exceptionDTO_1 = new CalendarExceptionDTO(
                getUniqueName(), toXml(getValidDate(0)), new Integer(7),
                addedExceptionType.getCode());

        CalendarExceptionDTO exceptionDTO_2 = new CalendarExceptionDTO(
                getUniqueName(), toXml(getValidDate(0)), new Integer(7),
                addedExceptionType.getCode());

        /* Build two calendar exception with the past date */
        CalendarExceptionDTO exceptionDTO_3 = new CalendarExceptionDTO(
                getUniqueName(), toXml(getInvalidDate()), new Integer(7),
                addedExceptionType.getCode());

        /* Build two calendar exception with the invalid type */
        CalendarExceptionDTO exceptionDTO_4 = new CalendarExceptionDTO(
                getUniqueName(), toXml(getInvalidDate()), new Integer(7),
                "InvalidType");

        List<CalendarExceptionDTO> calendarExceptions = new ArrayList<CalendarExceptionDTO>();
        calendarExceptions.add(exceptionDTO_1);
View Full Code Here

            CalendarException calendarException) {
        XMLGregorianCalendar date = DateConverter
                .toXMLGregorianCalendar(calendarException.getDate());
        int hours = calendarException.getDuration().getHours();
        String code = calendarException.getType().getCode();
        return new CalendarExceptionDTO(calendarException.getCode(), date,
                hours, code);
    }
View Full Code Here

TOP

Related Classes of org.libreplan.ws.calendars.api.CalendarExceptionDTO

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.