type.setTypeMapping(mapping);
type.setSchemaType(new QName("urn:Bean", "bean"));
ElementReader reader = new ElementReader(getResourceAsStream("bean4.xml"));
SimpleBean bean = (SimpleBean)type.readObject(reader, new Context());
assertEquals("bleh", bean.getBleh());
assertEquals("howdy", bean.getHowdy());
reader.getXMLStreamReader().close();
// Test writing
Element element = new Element("root", "b", "urn:Bean");
new Document(element);
type.writeObject(bean, new JDOMWriter(element), new Context());
assertValid("/b:root[@b:bleh='bleh']", element);
assertValid("/b:root[@b:howdy='howdy']", element);
Element types = new Element("types", "xsd", XmlConstants.XSD);