public void testMarshalReferingBeanProxy() throws Exception {
XMLContext xmlContext = new XMLContext();
xmlContext.setProperty(XMLProperties.PROXY_INTERFACES, "net.sf.cglib.proxy.Factory");
Mapping mapping = xmlContext.createMapping();
mapping.loadMapping(getClass().getResource(MAPPING_FILE).toExternalForm());
StringWriter out = new StringWriter();
Marshaller marshaller = xmlContext.createMarshaller();
marshaller.setWriter(out);
marshaller.setMapping(mapping);