test_class.declarator: logger = LoggerFactory.getLogger(SxmpWriterTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger logger = LoggerFactory.getLogger(SxmpWriterTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: ch-sxmp/src/test/java/com/cloudhopper/sxmp/SxmpWriterTest.java
test_class.identifier: SxmpWriterTest
test_case.body: @Test
      public void writeSubmitRequestWithNationalAndApplication() throws Exception {
          SubmitRequest request = new SubmitRequest();
          request.setAccount(new Account("customer1", "test1"));
          request.setApplication(new Application("TestApp"));
          request.setOperatorId(20);
          request.setSourceAddress(new MobileAddress(MobileAddress.Type.NATIONAL, "0123456789"));
          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(" <application>TestApp</application>\n")
              .append(" <submitRequest>\n")
              .append("  <operatorId>20</operatorId>\n")
              .append("  <priority>0</priority>\n")
              .append("  <deliveryReport>false</deliveryReport>\n")
              .append("  <sourceAddress type=\"national\">0123456789</sourceAddress>\n")
              .append("  <destinationAddress type=\"international\">+13135551212</destinationAddress>\n")
              .append("  <text encoding=\"UTF-8\">48656C6C6F20576F726C64</text>\n")
              .append(" </submitRequest>\n")
              .append("</operation>\n")
              .append("");
  
          // compare to actual correct submit response
          XMLUnit.setIgnoreWhitespace(true);
          Diff myDiff = new Diff(expectedXML.toString(), sw.toString());
          DetailedDiff myDetailedDiff = new DetailedDiff(myDiff);
          Assert.assertTrue("XML are similar " + myDetailedDiff, myDetailedDiff.similar());
      }
test_case.class_method_signature: SxmpWriterTest.writeSubmitRequestWithNationalAndApplication()
test_case.full_signature: @Test public void writeSubmitRequestWithNationalAndApplication()
test_case.identifier: writeSubmitRequestWithNationalAndApplication
test_case.invocations: setAccount setApplication setOperatorId setSourceAddress setDestinationAddress setText write debug toString append append append append append append append append append append append append append append setIgnoreWhitespace toString toString assertTrue similar
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void writeSubmitRequestWithNationalAndApplication()
focal_class.file: ch-sxmp/src/main/java/com/cloudhopper/sxmp/SxmpWriter.java
focal_class.identifier: SxmpWriter
focal_class.class_method_signature: SxmpWriter.writeXmlHeader(Writer out, Operation operation)
focal_class.full_signature: static private void writeXmlHeader(Writer out, Operation operation)
focal_class.identifier: writeXmlHeader
focal_class.modifiers: static private
focal_class.parameters: (Writer out, Operation operation)
focal_class.return: void
focal_class.signature: void writeXmlHeader(Writer out, Operation operation)
focal_class.class_method_signature: SxmpWriter.writeOperationStartTag(Writer out, Operation.Type type)
focal_class.full_signature: static private void writeOperationStartTag(Writer out, Operation.Type type)
focal_class.identifier: writeOperationStartTag
focal_class.modifiers: static private
focal_class.parameters: (Writer out, Operation.Type type)
focal_class.return: void
focal_class.signature: void writeOperationStartTag(Writer out, Operation.Type type)
focal_class.class_method_signature: SxmpWriter.writeOperationEndTag(Writer out)
focal_class.full_signature: static private void writeOperationEndTag(Writer out)
focal_class.identifier: writeOperationEndTag
focal_class.modifiers: static private
focal_class.parameters: (Writer out)
focal_class.return: void
focal_class.signature: void writeOperationEndTag(Writer out)
focal_class.class_method_signature: SxmpWriter.writeRequestResponseTag(Writer out, Operation operation)
focal_class.full_signature: static private void writeRequestResponseTag(Writer out, Operation operation)
focal_class.identifier: writeRequestResponseTag
focal_class.modifiers: static private
focal_class.parameters: (Writer out, Operation operation)
focal_class.return: void
focal_class.signature: void writeRequestResponseTag(Writer out, Operation operation)
focal_class.class_method_signature: SxmpWriter.writeRequestResponseStartTag(Writer out, Operation operation)
focal_class.full_signature: static private void writeRequestResponseStartTag(Writer out, Operation operation)
focal_class.identifier: writeRequestResponseStartTag
focal_class.modifiers: static private
focal_class.parameters: (Writer out, Operation operation)
focal_class.return: void
focal_class.signature: void writeRequestResponseStartTag(Writer out, Operation operation)
focal_class.class_method_signature: SxmpWriter.writeRequestResponseEndTag(Writer out, Operation operation)
focal_class.full_signature: static private void writeRequestResponseEndTag(Writer out, Operation operation)
focal_class.identifier: writeRequestResponseEndTag
focal_class.modifiers: static private
focal_class.parameters: (Writer out, Operation operation)
focal_class.return: void
focal_class.signature: void writeRequestResponseEndTag(Writer out, Operation operation)
focal_class.class_method_signature: SxmpWriter.writeErrorElement(Writer out, Response response)
focal_class.full_signature: static private void writeErrorElement(Writer out, Response response)
focal_class.identifier: writeErrorElement
focal_class.modifiers: static private
focal_class.parameters: (Writer out, Response response)
focal_class.return: void
focal_class.signature: void writeErrorElement(Writer out, Response response)
focal_class.class_method_signature: SxmpWriter.createString(Operation operation)
focal_class.full_signature: static public String createString(Operation operation)
focal_class.identifier: createString
focal_class.modifiers: static public
focal_class.parameters: (Operation operation)
focal_class.return: String
focal_class.signature: String createString(Operation operation)
focal_class.class_method_signature: SxmpWriter.write(Writer out, Operation operation)
focal_class.full_signature: static public void write(Writer out, Operation operation)
focal_class.identifier: write
focal_class.modifiers: static public
focal_class.parameters: (Writer out, Operation operation)
focal_class.return: void
focal_class.signature: void write(Writer out, Operation operation)
focal_class.class_method_signature: SxmpWriter.write(Writer out, Operation operation, boolean withXmlHeader)
focal_class.full_signature: static public void write(Writer out, Operation operation, boolean withXmlHeader)
focal_class.identifier: write
focal_class.modifiers: static public
focal_class.parameters: (Writer out, Operation operation, boolean withXmlHeader)
focal_class.return: void
focal_class.signature: void write(Writer out, Operation operation, boolean withXmlHeader)
focal_method.body: static public void write(Writer out, Operation operation) throws SxmpErrorException, IOException {
  	write(out, operation, true);
      }
focal_method.class_method_signature: SxmpWriter.write(Writer out, Operation operation)
focal_method.full_signature: static public void write(Writer out, Operation operation)
focal_method.identifier: write
focal_method.invocations: write
focal_method.modifiers: static public
focal_method.parameters: (Writer out, Operation operation)
focal_method.return: void
focal_method.signature: void write(Writer out, Operation operation)