Search in sources :

Example 11 with XStream

use of com.thoughtworks.xstream.XStream in project weixin-java-tools by chanjarster.

the class XStreamTransformer method config_WxMpXmlOutNewsMessage.

private static XStream config_WxMpXmlOutNewsMessage() {
    XStream xstream = XStreamInitializer.getInstance();
    xstream.processAnnotations(WxMpXmlOutMessage.class);
    xstream.processAnnotations(WxMpXmlOutNewsMessage.class);
    xstream.processAnnotations(WxMpXmlOutNewsMessage.Item.class);
    return xstream;
}
Also used : XStream(com.thoughtworks.xstream.XStream)

Example 12 with XStream

use of com.thoughtworks.xstream.XStream in project weixin-java-tools by chanjarster.

the class XStreamTransformer method config_WxMpXmlOutMusicMessage.

private static XStream config_WxMpXmlOutMusicMessage() {
    XStream xstream = XStreamInitializer.getInstance();
    xstream.processAnnotations(WxMpXmlOutMessage.class);
    xstream.processAnnotations(WxMpXmlOutMusicMessage.class);
    xstream.processAnnotations(WxMpXmlOutMusicMessage.Music.class);
    return xstream;
}
Also used : XStream(com.thoughtworks.xstream.XStream)

Example 13 with XStream

use of com.thoughtworks.xstream.XStream in project weixin-java-tools by chanjarster.

the class XStreamTransformer method config_WxMpXmlOutTextMessage.

private static XStream config_WxMpXmlOutTextMessage() {
    XStream xstream = XStreamInitializer.getInstance();
    xstream.processAnnotations(WxMpXmlOutMessage.class);
    xstream.processAnnotations(WxMpXmlOutTextMessage.class);
    return xstream;
}
Also used : XStream(com.thoughtworks.xstream.XStream)

Example 14 with XStream

use of com.thoughtworks.xstream.XStream in project eureka by Netflix.

the class XmlCodecTest method testEncodingDecodingWithMetaData.

@Test
public void testEncodingDecodingWithMetaData() throws Exception {
    Applications applications = InstanceInfoGenerator.newBuilder(10, 2).withMetaData(true).build().toApplications();
    XStream xstream = XmlXStream.getInstance();
    String xmlDocument = xstream.toXML(applications);
    Applications decodedApplications = (Applications) xstream.fromXML(xmlDocument);
    assertThat(EurekaEntityComparators.equal(decodedApplications, applications), is(true));
}
Also used : Applications(com.netflix.discovery.shared.Applications) XStream(com.thoughtworks.xstream.XStream) Test(org.junit.Test)

Example 15 with XStream

use of com.thoughtworks.xstream.XStream in project eureka by Netflix.

the class XmlCodecTest method testEncodingDecodingWithoutMetaData.

@Test
public void testEncodingDecodingWithoutMetaData() throws Exception {
    Applications applications = InstanceInfoGenerator.newBuilder(10, 2).withMetaData(false).build().toApplications();
    XStream xstream = XmlXStream.getInstance();
    String xmlDocument = xstream.toXML(applications);
    Applications decodedApplications = (Applications) xstream.fromXML(xmlDocument);
    assertThat(EurekaEntityComparators.equal(decodedApplications, applications), is(true));
}
Also used : Applications(com.netflix.discovery.shared.Applications) XStream(com.thoughtworks.xstream.XStream) Test(org.junit.Test)

Aggregations

XStream (com.thoughtworks.xstream.XStream)183 Test (org.junit.Test)54 IOException (java.io.IOException)31 InputStream (java.io.InputStream)28 WstxDriver (com.thoughtworks.xstream.io.xml.WstxDriver)22 Metacard (ddf.catalog.data.Metacard)21 DomDriver (com.thoughtworks.xstream.io.xml.DomDriver)16 HashMap (java.util.HashMap)14 ByteArrayInputStream (java.io.ByteArrayInputStream)12 Matchers.anyString (org.mockito.Matchers.anyString)11 HierarchicalStreamWriter (com.thoughtworks.xstream.io.HierarchicalStreamWriter)10 CswRecordCollection (org.codice.ddf.spatial.ogc.csw.catalog.common.CswRecordCollection)10 GmlGeometryConverter (org.codice.ddf.spatial.ogc.wfs.catalog.converter.impl.GmlGeometryConverter)8 XStreamException (com.thoughtworks.xstream.XStreamException)7 MarshallingContext (com.thoughtworks.xstream.converters.MarshallingContext)7 StaxDriver (com.thoughtworks.xstream.io.xml.StaxDriver)7 FileNotFoundException (java.io.FileNotFoundException)7 ArrayList (java.util.ArrayList)7 ForbiddenClassException (com.thoughtworks.xstream.security.ForbiddenClassException)6 FileWriter (java.io.FileWriter)6