@Test public void writeSubmitRequest0() throws Exception { SubmitRequest request = new SubmitRequest(); request.setAccount(new Account("customer1", "test1")); request.setOperatorId(20); request.setReferenceId("TESTREF"); request.setSourceAddress(new MobileAddress(MobileAddress.Type.NETWORK, "40404")); request.setDestinationAddress(new MobileAddress(MobileAddress.Type.INTERNATIONAL, "+13135551212")); request.setText("Hello World"); StringWriter sw = new StringWriter(); SxmpWriter.write(sw, request); logger.debug(sw.toString()); StringBuilder expectedXML = new StringBuilder(200) .append("<?xml version=\"1.0\"?>\n") .append("<operation type=\"submit\">\n") .append(" <account username=\"customer1\" password=\"test1\"/>\n") .append(" <submitRequest referenceId=\"TESTREF\">\n") .append(" <operatorId>20</operatorId>\n") .append(" <priority>0</priority>\n") .append(" <deliveryReport>false</deliveryReport>\n") .append(" <sourceAddress type=\"network\">40404</sourceAddress>\n") .append(" <destinationAddress type=\"international\">+13135551212</destinationAddress>\n") .append(" <text encoding=\"UTF-8\">48656C6C6F20576F726C64</text>\n") .append(" </submitRequest>\n") .append("</operation>\n") .append(""); XMLUnit.setIgnoreWhitespace(true); Diff myDiff = new Diff(expectedXML.toString(), sw.toString()); DetailedDiff myDetailedDiff = new DetailedDiff(myDiff); Assert.assertTrue("XML are similar " + myDetailedDiff, myDetailedDiff.similar()); }
static public void write(Writer out, Operation operation) throws SxmpErrorException, IOException { write(out, operation, true); }
SxmpWriter { static public void write(Writer out, Operation operation) throws SxmpErrorException, IOException { write(out, operation, true); } }
SxmpWriter { static public void write(Writer out, Operation operation) throws SxmpErrorException, IOException { write(out, operation, true); }  }
SxmpWriter { static public void write(Writer out, Operation operation) throws SxmpErrorException, IOException { write(out, operation, true); }  static String createString(Operation operation); static void write(Writer out, Operation operation); static void write(Writer out, Operation operation, boolean withXmlHeader); }
SxmpWriter { static public void write(Writer out, Operation operation) throws SxmpErrorException, IOException { write(out, operation, true); }  static String createString(Operation operation); static void write(Writer out, Operation operation); static void write(Writer out, Operation operation, boolean withXmlHeader);  }