public void testXMLGregorian() throws Exception
{
DefaultTypeMappingRegistry registry = new DefaultTypeMappingRegistry();
registry.createDefaultMappings();
TypeMapping tm = registry.getDefaultTypeMapping();
Type type = tm.getType(XMLGregorianCalendar.class);
assertEquals("dateTime", type.getSchemaType().getLocalPart());
MockControl readerControl = MockControl.createControl(MessageReader.class);
MessageReader reader = (MessageReader) readerControl.getMock();
reader.getValue();
readerControl.setDefaultReturnValue("---28");
readerControl.replay();
XMLGregorianCalendarType xType = (XMLGregorianCalendarType) tm.getType(XMLGregorianCalendar.class);
assertNotNull(xType);
XMLGregorianCalendar cal = (XMLGregorianCalendar) xType.readObject(reader, new MessageContext());
assertEquals(28, cal.getDay());
readerControl.verify();