Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFault


    public TestGetRole(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPFault soapFault = soapFactory.createSOAPFault();
        assertNull(
                "Fault Test:- After creating a SOAPFault, it has a role",
                soapFault.getRole());
        soapFault.setRole(soapFactory.createSOAPFaultRole(soapFault));
        assertNotNull(
                "Fault Test:- After calling setRole method, Fault has no role",
                soapFault.getRole());
        assertEquals("Fault Test:- Fault role local name mismatch",
                spec.getFaultRoleQName(), soapFault.getRole().getQName());
    }
View Full Code Here


    }

    protected void runTest() throws Throwable {
        OMElement parent = soapFactory.createOMElement("parent", null);
        OMElement child1 = soapFactory.createOMElement("child1", null, parent);
        SOAPFault fault = soapFactory.createSOAPFault();
        try {
            child1.insertSiblingAfter(fault);
            fail("Expected SOAPProcessingException");
        } catch (SOAPProcessingException ex) {
            // Expected
View Full Code Here

    public TestSetDetail(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPFault soapFault = soapFactory.createSOAPFault();
        soapFault.setDetail(soapFactory.createSOAPFaultDetail(soapFault));
        assertNotNull(
                "Fault Test:- After calling setDetail method, Fault has no detail",
                soapFault.getDetail());
        assertEquals("Fault Test:- Fault detail local name mismatch",
                spec.getFaultDetailQName(), soapFault.getDetail().getQName());
        try {
            soapFault.setDetail(altSoapFactory.createSOAPFaultDetail());
            fail("SOAPFaultDetail should not be set in to a SOAPFault for a different SOAP version");
        } catch (SOAPProcessingException e) {
            assertTrue(true);
        }
    }
View Full Code Here

    public TestGetReasonWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPFault soapFaultWithParser = getTestMessage(MESSAGE).getBody().getFault();
        assertNotNull(
                "Fault Test with parser: - getReason method returns null",
                soapFaultWithParser.getReason());
        assertEquals(
                "Fault Test with parser: - Fault reason local name mismatch",
                spec.getFaultReasonQName(), soapFaultWithParser.getReason().getQName());
    }
View Full Code Here

    public TestGetReason(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPFault soapFault = soapFactory.createSOAPFault();
        assertNull(
                "Fault Test:- After creating a SOAPFault, it has a reason",
                soapFault.getReason());
        soapFault.setReason(soapFactory.createSOAPFaultReason(soapFault));
        assertNotNull(
                "Fault Test:- After calling setReason method, Fault has no reason",
                soapFault.getReason());
        assertEquals("Fault Test:- Fault reason local name mismatch",
                spec.getFaultReasonQName(), soapFault.getReason().getQName());
    }
View Full Code Here

    public TestGetDetailWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPFault soapFaultWithParser = getTestMessage(MESSAGE).getBody().getFault();
        assertNotNull(
                "Fault Test with parser: - getDetail method returns null",
                soapFaultWithParser.getDetail());
        assertEquals(
                "Fault Test with parser: - Fault detail local name mismatch",
                spec.getFaultDetailQName(), soapFaultWithParser.getDetail().getQName());
    }
View Full Code Here

    public TestGetCode(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPFault soapFault = soapFactory.createSOAPFault();
        assertNull(
                "Fault Test:- After creating a SOAPFault, it has a code",
                soapFault.getCode());
        soapFault.setCode(soapFactory.createSOAPFaultCode(soapFault));
        assertNotNull(
                "Fault Test:- After calling setCode method, Fault has no code",
                soapFault.getCode());
        assertEquals("Fault Test:- Fault code local name mismatch",
                spec.getFaultCodeQName(), soapFault.getCode().getQName());
    }
View Full Code Here

    public TestSetReason(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPFault soapFault = soapFactory.createSOAPFault();
        soapFault.setReason(soapFactory.createSOAPFaultReason(soapFault));
        assertNotNull(
                "Fault Test:- After calling setReason method, Fault has no reason",
                soapFault.getReason());
        assertEquals("Fault Test:- Fault reason local name mismatch",
                spec.getFaultReasonQName(), soapFault.getReason().getQName());
        try {
            soapFault.setReason(altSoapFactory.createSOAPFaultReason());
            fail("SOAPFaultReason should not be set in to a SOAPFault for a different SOAP version");

        } catch (Exception e) {
            assertTrue(true);
        }
View Full Code Here

        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        OMElement parent = soapFactory.createOMElement("parent", null);
        SOAPFault fault = soapFactory.createSOAPFault();
        try {
            parent.addChild(fault);
            fail("Expected SOAPProcessingException");
        } catch (SOAPProcessingException ex) {
            // Expected
View Full Code Here

        return (SOAPFaultRoleImpl)getFirstChildWithName(SOAP12Constants.QNAME_FAULT_ROLE);
    }

    protected OMElement createClone(OMCloneOptions options, ParentNode targetParent,
            boolean generateNSDecl) {
        SOAPFault clone = new SOAP12FaultImpl(targetParent, namespace, null, factory, generateNSDecl);
        if (e != null) {
            clone.setException(e);
        }
        return clone;
    }
View Full Code Here

TOP

Related Classes of org.apache.axiom.soap.SOAPFault

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.