FileDocCategorySizeDatePackage
FaultEncode.javaAPI DocApache Axis 1.41877Sat Apr 22 18:57:26 BST 2006test.faults

FaultEncode

public class FaultEncode extends TestCase
This class tests Fault deserialization.
author
Sam Ruby (rubys@us.ibm.com)

Fields Summary
Constructors Summary
public FaultEncode(String name)

        super(name);
    
Methods Summary
public voidtestFault()

        AxisFault fault = new AxisFault("<code>", "<string>", "<actor>", null);
        fault.setFaultDetailString("<detail>");

        AxisServer server = new AxisServer();
        Message message = new Message(fault);
        message.setMessageContext(new MessageContext(server));

        String data = message.getSOAPPartAsString();
        assertTrue("Fault code not encoded correctly",
            data.indexOf("<code>")>=0);
        assertTrue("Fault string not encoded correctly",
            data.indexOf("<string>")>=0);
        assertTrue("Fault actor not encoded correctly",
            data.indexOf("<actor>")>=0);
        assertTrue("Fault detail not encoded correctly",
            data.indexOf("<detail>")>=0);