@Test public void testSerialize_null() throws Exception { String str = xmlobj.serialize(null); Assert.assertNull(str); }
public <T> String serialize(T object) throws SerializationException { if (object == null) { return null; } StringWriter writer = new StringWriter(); try { Marshaller marshaller = MessageUtils.createMarshaller(); marshaller.marshal(object, writer); } catch (JAXBException e) { LOG.error("unable to marshall in XML Serializer", e); throw new SerializationException(e); } String documentToPost = writer.toString(); LOG.debug("XML serialized data : " + documentToPost); return documentToPost; }
XMLSerializer implements IEntitySerializer { public <T> String serialize(T object) throws SerializationException { if (object == null) { return null; } StringWriter writer = new StringWriter(); try { Marshaller marshaller = MessageUtils.createMarshaller(); marshaller.marshal(object, writer); } catch (JAXBException e) { LOG.error("unable to marshall in XML Serializer", e); throw new SerializationException(e); } String documentToPost = writer.toString(); LOG.debug("XML serialized data : " + documentToPost); return documentToPost; } }
XMLSerializer implements IEntitySerializer { public <T> String serialize(T object) throws SerializationException { if (object == null) { return null; } StringWriter writer = new StringWriter(); try { Marshaller marshaller = MessageUtils.createMarshaller(); marshaller.marshal(object, writer); } catch (JAXBException e) { LOG.error("unable to marshall in XML Serializer", e); throw new SerializationException(e); } String documentToPost = writer.toString(); LOG.debug("XML serialized data : " + documentToPost); return documentToPost; }  }
XMLSerializer implements IEntitySerializer { public <T> String serialize(T object) throws SerializationException { if (object == null) { return null; } StringWriter writer = new StringWriter(); try { Marshaller marshaller = MessageUtils.createMarshaller(); marshaller.marshal(object, writer); } catch (JAXBException e) { LOG.error("unable to marshall in XML Serializer", e); throw new SerializationException(e); } String documentToPost = writer.toString(); LOG.debug("XML serialized data : " + documentToPost); return documentToPost; }  String serialize(T object); @SuppressWarnings("unchecked") Response deserialize(String str, Class<?> cl); @Override Response deserializeEntitlements(String decompressedData, Class<EntitlementsResponse> cl); }
XMLSerializer implements IEntitySerializer { public <T> String serialize(T object) throws SerializationException { if (object == null) { return null; } StringWriter writer = new StringWriter(); try { Marshaller marshaller = MessageUtils.createMarshaller(); marshaller.marshal(object, writer); } catch (JAXBException e) { LOG.error("unable to marshall in XML Serializer", e); throw new SerializationException(e); } String documentToPost = writer.toString(); LOG.debug("XML serialized data : " + documentToPost); return documentToPost; }  String serialize(T object); @SuppressWarnings("unchecked") Response deserialize(String str, Class<?> cl); @Override Response deserializeEntitlements(String decompressedData, Class<EntitlementsResponse> cl);  }