test_class.declarator: logger = LoggerFactory.getLogger(SxmpParserTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger logger = LoggerFactory.getLogger(SxmpParserTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: ch-sxmp/src/test/java/com/cloudhopper/sxmp/SxmpParserTest.java
test_class.identifier: SxmpParserTest
test_case.body: @Test
      public void parseDeliverRequestWithApplicationAndTicketId() throws Exception {
          StringBuilder string0 = new StringBuilder(200)
              .append("<?xml version=\"1.0\"?>\n")
              .append("<operation type=\"deliver\">\n")
              .append(" <account username=\"customer1\" password=\"test1\"/>\n")
              .append(" <application>TestApp1</application>\n")
              .append(" <deliverRequest>\n")
              .append("  <sourceAddress type=\"international\">+12065551212</sourceAddress>\n")
              .append("  <destinationAddress type=\"network\">40404</destinationAddress>\n")
              .append("  <text encoding=\"ISO-8859-1\">48656c6c6f20576f726c64</text>\n")
              .append("  <ticketId>THISISATICKETID</ticketId>")
              .append(" </deliverRequest>\n")
              .append("</operation>\n")
              .append("");
  
          ByteArrayInputStream is = new ByteArrayInputStream(string0.toString().getBytes());
          SxmpParser parser = new SxmpParser();
          Operation operation = parser.parse(is);
  
          logger.debug("{}", operation);
  
          Assert.assertEquals(Operation.Type.DELIVER, operation.getType());
          Assert.assertEquals(true, operation.isRequest());
          DeliverRequest deliverReq = (DeliverRequest)operation;
          Assert.assertEquals("customer1", deliverReq.getAccount().getUsername());
          Assert.assertEquals("test1", deliverReq.getAccount().getPassword());
          Assert.assertEquals("TestApp1", deliverReq.getApplication().getName());
          Assert.assertNull(deliverReq.getReferenceId());
          Assert.assertEquals(null, deliverReq.getOperatorId());
          Assert.assertEquals(MobileAddress.Type.NETWORK, deliverReq.getDestinationAddress().getType());
          Assert.assertEquals("40404", deliverReq.getDestinationAddress().getAddress());
          Assert.assertEquals(MobileAddress.Type.INTERNATIONAL, deliverReq.getSourceAddress().getType());
          Assert.assertEquals("+12065551212", deliverReq.getSourceAddress().getAddress());
          Assert.assertEquals("Hello World", deliverReq.getText());
          Assert.assertEquals("THISISATICKETID", deliverReq.getTicketId());
      }
test_case.class_method_signature: SxmpParserTest.parseDeliverRequestWithApplicationAndTicketId()
test_case.full_signature: @Test public void parseDeliverRequestWithApplicationAndTicketId()
test_case.identifier: parseDeliverRequestWithApplicationAndTicketId
test_case.invocations: append append append append append append append append append append append append getBytes toString parse debug assertEquals getType assertEquals isRequest assertEquals getUsername getAccount assertEquals getPassword getAccount assertEquals getName getApplication assertNull getReferenceId assertEquals getOperatorId assertEquals getType getDestinationAddress assertEquals getAddress getDestinationAddress assertEquals getType getSourceAddress assertEquals getAddress getSourceAddress assertEquals getText assertEquals getTicketId
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void parseDeliverRequestWithApplicationAndTicketId()
focal_class.declarator: logger = LoggerFactory.getLogger(SxmpParser.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(SxmpParser.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: dateTimeFormat = ISODateTimeFormat.dateTime().withZone(DateTimeZone.UTC)
focal_class.modifier: static protected
focal_class.original_string: static protected DateTimeFormatter dateTimeFormat = ISODateTimeFormat.dateTime().withZone(DateTimeZone.UTC);
focal_class.type: DateTimeFormatter
focal_class.var_name: dateTimeFormat
focal_class.declarator: VERSION_1_0 = "1.0"
focal_class.modifier: public static final
focal_class.original_string: public static final String VERSION_1_0 = "1.0";
focal_class.type: String
focal_class.var_name: VERSION_1_0
focal_class.declarator: VERSION_1_1 = "1.1"
focal_class.modifier: public static final
focal_class.original_string: public static final String VERSION_1_1 = "1.1";
focal_class.type: String
focal_class.var_name: VERSION_1_1
focal_class.declarator: VERSION_1_2 = "1.2"
focal_class.modifier: public static final
focal_class.original_string: public static final String VERSION_1_2 = "1.2";
focal_class.type: String
focal_class.var_name: VERSION_1_2
focal_class.declarator: version
focal_class.modifier: protected final
focal_class.original_string: protected final String version;
focal_class.type: String
focal_class.var_name: version
focal_class.file: ch-sxmp/src/main/java/com/cloudhopper/sxmp/SxmpParser.java
focal_class.identifier: SxmpParser
focal_class.class_method_signature: SxmpParser.SxmpParser()
focal_class.full_signature: public  SxmpParser()
focal_class.identifier: SxmpParser
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  SxmpParser()
focal_class.class_method_signature: SxmpParser.SxmpParser(final String version)
focal_class.full_signature: public  SxmpParser(final String version)
focal_class.identifier: SxmpParser
focal_class.modifiers: public
focal_class.parameters: (final String version)
focal_class.signature:  SxmpParser(final String version)
focal_class.class_method_signature: SxmpParser.parse(InputStream in)
focal_class.full_signature: public Operation parse(InputStream in)
focal_class.identifier: parse
focal_class.modifiers: public
focal_class.parameters: (InputStream in)
focal_class.return: Operation
focal_class.signature: Operation parse(InputStream in)
focal_method.body: public Operation parse(InputStream in) throws SxmpParsingException, IOException, SAXException, ParserConfigurationException {
          // create a new SAX parser
          SAXParserFactory factory = SAXParserFactory.newInstance();
  
          SAXParser parser = factory.newSAXParser();
          parser.getXMLReader().setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
          parser.getXMLReader().setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd",false);
          parser.getXMLReader().setFeature("http://xml.org/sax/features/external-general-entities", false);
          parser.getXMLReader().setFeature("http://xml.org/sax/features/external-parameter-entities"	, false);
          parser.getXMLReader().setFeature("http://xml.org/sax/features/namespaces", true);
          parser.getXMLReader().setFeature("http://xml.org/sax/features/namespace-prefixes", true);
          parser.getXMLReader().setFeature("http://javax.xml.XMLConstants/feature/secure-processing", true);
  
          //_dtd=null;
          Handler handler = new Handler();
          XMLReader reader = parser.getXMLReader();
          reader.setContentHandler(handler);
          reader.setErrorHandler(handler);
          reader.setEntityResolver(handler);
  
          // try parsing (may throw an SxmpParsingException in the handler)
          try {
              parser.parse(new InputSource(in), handler);
          } catch (com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException e) {
              throw new SxmpParsingException(SxmpErrorCode.INVALID_XML, "XML encoding mismatch", null);
          }
  
          // check if there was an error
          if (handler.error != null) {
              throw handler.error;
          }
  
          // check to see if an operation was actually parsed
          if (handler.getOperation() == null) {
              throw new SxmpParsingException(SxmpErrorCode.MISSING_REQUIRED_ELEMENT, "The operation type [" + handler.operationType.getValue() + "] requires a request element", new PartialOperation(handler.operationType));
          }
  
          // if we got here, an operation was parsed -- now we need to validate it
          // to make sure that it has all required elements
          try {
              handler.getOperation().validate();
          } catch (SxmpErrorException e) {
              throw new SxmpParsingException(e.getErrorCode(), e.getErrorMessage(), handler.getOperation());
          }
  
          return handler.getOperation();
      }
focal_method.class_method_signature: SxmpParser.parse(InputStream in)
focal_method.full_signature: public Operation parse(InputStream in)
focal_method.identifier: parse
focal_method.invocations: newInstance newSAXParser setFeature getXMLReader setFeature getXMLReader setFeature getXMLReader setFeature getXMLReader setFeature getXMLReader setFeature getXMLReader setFeature getXMLReader getXMLReader setContentHandler setErrorHandler setEntityResolver parse getOperation getValue validate getOperation getErrorCode getErrorMessage getOperation getOperation
focal_method.modifiers: public
focal_method.parameters: (InputStream in)
focal_method.return: Operation
focal_method.signature: Operation parse(InputStream in)