@Test public void shouldSerializeCollection() { String expectedResult = " <order>\n <price>15.0</price>\n <comments>pack it nicely, please</comments>\n </order>\n"; expectedResult += expectedResult; expectedResult = "<list>\n" + expectedResult + "</list>"; Order order = new Order(new Client("guilherme silveira"), 15.0, "pack it nicely, please"); serialization.from(Arrays.asList(order, order)).serialize(); assertThat(result(), is(equalTo(expectedResult))); }
public <T> Serializer from(T object) { response.setContentType("application/xml"); return getSerializer().from(object); }
XStreamXMLSerialization implements XMLSerialization { public <T> Serializer from(T object) { response.setContentType("application/xml"); return getSerializer().from(object); } }
XStreamXMLSerialization implements XMLSerialization { public <T> Serializer from(T object) { response.setContentType("application/xml"); return getSerializer().from(object); } XStreamXMLSerialization(HttpServletResponse response, TypeNameExtractor extractor, ProxyInitializer initializer, XStreamBuilder builder); }
XStreamXMLSerialization implements XMLSerialization { public <T> Serializer from(T object) { response.setContentType("application/xml"); return getSerializer().from(object); } XStreamXMLSerialization(HttpServletResponse response, TypeNameExtractor extractor, ProxyInitializer initializer, XStreamBuilder builder); boolean accepts(String format); Serializer from(T object); Serializer from(T object, String alias); }
XStreamXMLSerialization implements XMLSerialization { public <T> Serializer from(T object) { response.setContentType("application/xml"); return getSerializer().from(object); } XStreamXMLSerialization(HttpServletResponse response, TypeNameExtractor extractor, ProxyInitializer initializer, XStreamBuilder builder); boolean accepts(String format); Serializer from(T object); Serializer from(T object, String alias);  }