@Test
public void testValidation() throws JAXBException, SAXException, IOException {

    XmlNationalCalendar xcal1 = new XmlNationalCalendar();
    xcal1.setName("calendar.test1");
    XmlFixedDay fday = new XmlFixedDay();
    fday.setMonth(Month.March);
    fday.setDay(21);
    XmlSpecialDayEvent sday = new XmlSpecialDayEvent();
    sday.setDay(fday);
    xcal1.getSpecialDayEvent().add(sday);
    XmlNationalCalendar xcal2 = new XmlNationalCalendar();
    xcal2.setName("calendar.test2");
    xcal2.getSpecialDayEvent().add(sday);
    XmlChainedCalendar xchained = new XmlChainedCalendar();
    xchained.setCalendarBreak(Day.toDay());
    xchained.setStartCalendar(xcal1.getName());
    xchained.setEndCalendar(xcal2.getName());
    xchained.setName("calendar.chained");
    XmlCompositeCalendar xcomposite = new XmlCompositeCalendar();
    xcomposite.getWeightedCalendar().add(new XmlWeightedItem(xcal1.getName()));
    xcomposite.getWeightedCalendar().add(new XmlWeightedItem(xcal2.getName()));
    xcomposite.getWeightedCalendar().add(new XmlWeightedItem(xchained.getName()));
    xcomposite.setName("calendar.composite");
    XmlCalendars xcals = new XmlCalendars();
    xcals.getCalendars().add(xcal1);
    xcals.getCalendars().add(xcal2);
    xcals.getCalendars().add(xchained);
    xcals.getCalendars().add(xcomposite);
    JAXBContext jaxb = JAXBContext.newInstance(xcals.getClass());
    JAXBSource source = new JAXBSource(jaxb, xcals);
    Validator validator = Schemas.Calendars.newValidator();
    //validator.setErrorHandler(new TestErrorHandler());
    validator.validate(source);
}