type.setTypeClass(Date.class);
type.setSchemaType(new QName(ns, "date"));
mapping.register(type);
Type tsType = mapping.getType(Timestamp.class);
assertTrue(tsType instanceof TimestampType);
Type dtoType = mapping.getTypeCreator().createType(DateDTO.class);
mapping.register(dtoType);
// Test reading
ElementReader reader = new ElementReader(getResourceAsStream("/org/codehaus/xfire/aegis/type/basic/dates.xml"));
Object obj = dtoType.readObject(reader, new MessageContext());
DateDTO dto = (DateDTO) obj;
assertNotNull(dto.getDate0());
assertNotNull(dto.getDateTime0());
assertNotNull(dto.getDateTime1());
assertNotNull(dto.getDateTime2());
assertNotNull(dto.getDateTime3());
assertNotNull(dto.getDateTime4());
assertTrue ( dto.getDateTime3().before( dto.getDateTime4() ) );
assertNotNull(dto.getDateTime5());
assertNotNull(dto.getDateTime6());
assertTrue ( dto.getDateTime5().before( dto.getDateTime6() ) );
assertNotNull(dto.getTime0());
assertNotNull(dto.getTime1());
Element element = new Element("dates", ns);
new Document(element);
JDOMWriter writer = new JDOMWriter(element);
MessageContext mc = new MessageContext();
mc.setService(new Service(new ServiceInfo(
new QName("larry","curly","moe"),DateTypeTest.class)));
dtoType.writeObject(dto, writer, new MessageContext());
writer.close();
addNamespace("d", ns);
assertValid("/d:dates/d:date0", element);
assertValid("/d:dates/d:dateTime0", element);