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 write10SubmitRequestWithoutIncludingOptionalParams() throws Exception {
          SubmitRequest request = new SubmitRequest(SxmpParser.VERSION_1_0);
          request.setAccount(new Account("customer1", "test1"));
          request.setOperatorId(20);
          request.setDestinationAddress(new MobileAddress(MobileAddress.Type.PUSH_DESTINATION, "abcd1234fghi"));
          request.setText("Hello World");
          // use a tree map to get guaranteed key order
          OptionalParamMap optParams = new OptionalParamMap(OptionalParamMap.TREE_MAP);
          optParams.put("A", new Integer(42));
          optParams.put("b", "value with unicode and UTF8 extended chars: € £ æ - \u20AC \u0623 \u0647 \u0644 ");
          optParams.put("c", "'sample' with XML-excaping: \n&\r<>'\"");
          optParams.put("e", new Integer(-42));
          optParams.put("f", new Double(3.14159));
          optParams.put("g", new Integer(33445566));
          optParams.put("h", new Long(123456789123456l));
          request.setOptionalParams(optParams);
  
          StringWriter sw = new StringWriter();
          SxmpWriter.write(sw, request);
  
          logger.debug("UTF8 OPTIONAL PARAMS: "+sw.toString());
  
          StringBuilder expectedXML = new StringBuilder(200)
              .append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
              .append("<operation type=\"submit\">\n")
              .append(" <account username=\"customer1\" password=\"test1\"/>\n")
              .append(" <submitRequest>\n")
              .append("  <operatorId>20</operatorId>\n")
              .append("  <priority>0</priority>\n")
              .append("  <deliveryReport>false</deliveryReport>\n")
              .append("  <destinationAddress type=\"push_destination\">abcd1234fghi</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.write10SubmitRequestWithoutIncludingOptionalParams()
test_case.full_signature: @Test public void write10SubmitRequestWithoutIncludingOptionalParams()
test_case.identifier: write10SubmitRequestWithoutIncludingOptionalParams
test_case.invocations: setAccount setOperatorId setDestinationAddress setText put put put put put put put setOptionalParams write debug toString 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 write10SubmitRequestWithoutIncludingOptionalParams()
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)