use of com.adaptris.core.AdaptrisMarshaller in project interlok by adaptris.
the class MarshallingBaseCase method testMarshalToWriter.
@Test
public void testMarshalToWriter() throws Exception {
AdaptrisMarshaller marshaller = createMarshaller();
Adapter adapter = createMarshallingObject();
StringWriter out = new StringWriter();
marshaller.marshal(adapter, out);
}
use of com.adaptris.core.AdaptrisMarshaller in project interlok by adaptris.
the class MarshallingBaseCase method testUnmarshalWithTransient.
@Test
public void testUnmarshalWithTransient() throws Exception {
AdaptrisMarshaller marshaller = createMarshaller();
Channel channel = new Channel();
// availability starts off as "true"
channel.toggleAvailability(false);
assertEquals(false, channel.isAvailable());
String xml = marshaller.marshal(channel);
Channel c2 = (Channel) marshaller.unmarshal(xml);
// availability should still as per constructor if it's marked as transient
assertNotSame(false, c2.isAvailable());
}
use of com.adaptris.core.AdaptrisMarshaller in project interlok by adaptris.
the class MarshallingBaseCase method testUnmarshalFromReader.
@Test
public void testUnmarshalFromReader() throws Exception {
AdaptrisMarshaller marshaller = createMarshaller();
Adapter adapter = createMarshallingObject();
String s = marshaller.marshal(adapter);
try (StringReader in = new StringReader(s)) {
assertRoundtripEquality(adapter, marshaller.unmarshal(in));
}
}
use of com.adaptris.core.AdaptrisMarshaller in project interlok by adaptris.
the class MarshallingBaseCase method testInlineRoundtrip.
@Test
public void testInlineRoundtrip() throws Exception {
AdaptrisMarshaller marshaller = createMarshaller();
Adapter adapter = createMarshallingObject();
String xml = marshaller.marshal(adapter);
assertRoundtripEquality(adapter, marshaller.unmarshal(xml));
}
Aggregations