FileDocCategorySizeDatePackage
TestOutputter.javaAPI DocApache Axis 1.42254Sat Apr 22 18:57:26 BST 2006test.encoding

TestOutputter

public class TestOutputter extends org.custommonkey.xmlunit.XMLTestCase
Test deserialization of SOAP responses

Fields Summary
private String
header
private String
footer
private org.apache.axis.server.AxisServer
server
Constructors Summary
public TestOutputter(String name)


       
        this(name, Constants.URI_DEFAULT_SCHEMA_XSI,
                   Constants.URI_DEFAULT_SCHEMA_XSD);
    
public TestOutputter(String name, String NS_XSI, String NS_XSD)

        super(name);

        header =
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<soap:Envelope " +
              "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
              "xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" " +
              "xmlns:xsi=\"" + NS_XSI + "\" " +
              "xmlns:xsd=\"" + NS_XSD + "\">\n" +
              "<soap:Body>\n" +
                "<methodResult xmlns=\"http://tempuri.org/\">\n";

        footer =
                "</methodResult>\n" +
              "</soap:Body>\n" +
            "</soap:Envelope>";
    
Methods Summary
public static voidmain(java.lang.String[] args)

        TestOutputter tester = new TestOutputter("test");
        tester.testString();
    
protected voidroundtrip(java.lang.String data)
Verify that a given XML deserialized produces the expected result

       Message message = new Message(header + data + footer);
       message.setMessageContext(new MessageContext(server));

       message.getSOAPEnvelope();

       assertXMLEqual(header+data+footer, message.getSOAPPartAsString());
    
public voidtestEscapedAttributes()

        roundtrip("<abc foo=\"<&>\"/>");
        // roundtrip("<abc foo=\"<&>\"/>");
    
public voidtestEscapedText()

        roundtrip("<abc><&></abc>");
    
public voidtestString()

        roundtrip("<result xsi:type=\"xsd:string\">abc</result>");