public void testWrite() { StringReader reader = new StringReader(xpdl); Xmappr xmappr = new Xmappr(XPDLTriggerResultLink.class); XPDLTriggerResultLink trigger = (XPDLTriggerResultLink) xmappr.fromXML(reader); JSONObject importObject = new JSONObject(); trigger.write(importObject); assertEquals(jsonWrite, importObject.toString()); }
public void testParse() throws JSONException { XPDLTriggerResultLink trigger = new XPDLTriggerResultLink(); trigger.parse(new JSONObject(jsonParse)); StringWriter writer = new StringWriter(); Xmappr xmappr = new Xmappr(XPDLTriggerResultLink.class); xmappr.setPrettyPrint(false); xmappr.toXML(trigger, writer); assertEquals(xpdl, writer.toString()); }