XmlExportDescriptorXStreamProvider implements XStreamProvider<XmlExportDescriptor> { private XStream provide() { if (this.xStream == null) { XStream xStream = new XStream(new DomDriver()); xStream.addPermission(AnyTypePermission.ANY); xStream.alias("export-descriptor", XmlExportDescriptorImpl.class); xStream.addDefaultImplementation(XmlExportDescriptorImpl.class, ExportDescriptor.class); xStream.addDefaultImplementation(XmlExportDescriptorImpl.class, XmlExportDescriptor.class); xStream.aliasField("entity-type", XmlExportDescriptorImpl.class, "entityType"); xStream.aliasField("context", XmlExportDescriptorImpl.class, "context"); xStream.addDefaultImplementation(XmlExportContextImpl.class, XmlExportContext.class); xStream.aliasField("shop-code", XmlExportContextImpl.class, "shopCode"); xStream.aliasField("select-sql", XmlExportDescriptorImpl.class, "selectCmd"); xStream.aliasField("select-cmd", XmlExportDescriptorImpl.class, "selectCmd"); xStream.aliasField("xml-handler", XmlExportDescriptorImpl.class, "xmlHandler"); xStream.aliasField("export-file-descriptor", XmlExportDescriptorImpl.class, "exportFileDescriptor"); xStream.addDefaultImplementation(XmlExportFileImpl.class, XmlExportFile.class); xStream.aliasField("file-encoding", XmlExportFileImpl.class, "fileEncoding"); xStream.aliasField("file-name", XmlExportFileImpl.class, "fileName"); this.xStream = xStream; } return this.xStream; }  @Override XmlExportDescriptor fromXML(final String xml); @Override XmlExportDescriptor fromXML(final InputStream is); @Override String toXML(final XmlExportDescriptor object);  }
@Test public void testProvide() throws Exception { testProvide("src/test/resources/export/xml/schematest001.xml"); testProvide("src/test/resources/export/xml/schematest002.xml"); }