Package org.apache.hello_world_doc_lit

Examples of org.apache.hello_world_doc_lit.PingMeFault


    public void pingMe() throws PingMeFault {
        FaultDetail faultDetail = new FaultDetail();
        faultDetail.setMajor((short)2);
        faultDetail.setMinor((short)1);
        throw new PingMeFault("PingMeFault raised by server", faultDetail);
       
    }
View Full Code Here


    public void pingMe() throws PingMeFault {
        FaultDetail faultDetail = new FaultDetail();
        faultDetail.setMajor((short)2);
        faultDetail.setMinor((short)1);
        throw new PingMeFault("PingMeFault raised by server", faultDetail);
       
    }
View Full Code Here

    public void testFault() throws Exception {
        FaultDetail detail = new FaultDetail();
        detail.setMajor((short)2);
        detail.setMinor((short)1);
        PingMeFault fault = new PingMeFault("TEST_FAULT", detail);

        XMLFault xmlFault = XMLFault.createFault(new Fault(fault));
        Element el = xmlFault.getOrCreateDetail();
        JAXBContext ctx = JAXBContext.newInstance(FaultDetail.class);
        Marshaller m = ctx.createMarshaller();
        m.marshal(detail, el);
       
        OutputStream outputStream = new ByteArrayOutputStream();
        xmlMessage.setContent(OutputStream.class, outputStream);
        XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(outputStream);
        xmlMessage.setContent(XMLStreamWriter.class, writer);
        xmlMessage.setContent(Exception.class, xmlFault);
       
        out.handleMessage(xmlMessage);
        outputStream.flush();

        XMLStreamReader reader = getXMLReader();
        DepthXMLStreamReader dxr = new DepthXMLStreamReader(reader);
       
        dxr.nextTag();
        StaxUtils.toNextElement(dxr);
        assertEquals(XMLConstants.NS_XML_FORMAT, dxr.getNamespaceURI());
        assertEquals(XMLFault.XML_FAULT_ROOT, dxr.getLocalName());
       
        dxr.nextTag();
        StaxUtils.toNextElement(dxr);
        assertEquals(XMLFault.XML_FAULT_STRING, dxr.getLocalName());
        assertEquals(fault.toString(), dxr.getElementText());
       
        dxr.nextTag();
        StaxUtils.toNextElement(dxr);
        assertEquals(XMLFault.XML_FAULT_DETAIL, dxr.getLocalName());
       
View Full Code Here

    @Test
    public void testFault() throws Exception {
        FaultDetail detail = new FaultDetail();
        detail.setMajor((short)2);
        detail.setMinor((short)1);
        PingMeFault fault = new PingMeFault("TEST_FAULT", detail);

        XMLFault xmlFault = XMLFault.createFault(new Fault(fault));
        Element el = xmlFault.getOrCreateDetail();
        JAXBContext ctx = JAXBContext.newInstance(FaultDetail.class);
        Marshaller m = ctx.createMarshaller();
        m.marshal(detail, el);
       
        OutputStream outputStream = new ByteArrayOutputStream();
        xmlMessage.setContent(OutputStream.class, outputStream);
        XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(outputStream);
        xmlMessage.setContent(XMLStreamWriter.class, writer);
        xmlMessage.setContent(Exception.class, xmlFault);
       
        out.handleMessage(xmlMessage);
        outputStream.flush();

        XMLStreamReader reader = getXMLReader();
        DepthXMLStreamReader dxr = new DepthXMLStreamReader(reader);
       
        dxr.nextTag();
        StaxUtils.toNextElement(dxr);
        assertEquals(XMLConstants.NS_XML_FORMAT, dxr.getNamespaceURI());
        assertEquals(XMLFault.XML_FAULT_ROOT, dxr.getLocalName());
       
        dxr.nextTag();
        StaxUtils.toNextElement(dxr);
        assertEquals(XMLFault.XML_FAULT_STRING, dxr.getLocalName());
        assertEquals(fault.toString(), dxr.getElementText());
       
        dxr.nextTag();
        StaxUtils.toNextElement(dxr);
        assertEquals(XMLFault.XML_FAULT_DETAIL, dxr.getLocalName());
       
View Full Code Here

    public void pingMe() throws PingMeFault {
        FaultDetail faultDetail = new FaultDetail();
        faultDetail.setMajor((short)2);
        faultDetail.setMinor((short)1);
        throw new PingMeFault("PingMeFault raised by server", faultDetail);
       
    }
View Full Code Here

    public void pingMe() throws PingMeFault {
        FaultDetail faultDetail = new FaultDetail();
        faultDetail.setMajor((short)2);
        faultDetail.setMinor((short)1);
        throw new PingMeFault("PingMeFault raised by server", faultDetail);
       
    }
View Full Code Here

    public void pingMe() throws PingMeFault {
        FaultDetail faultDetail = new FaultDetail();
        faultDetail.setMajor((short)2);
        faultDetail.setMinor((short)1);
        throw new PingMeFault("PingMeFault raised by server", faultDetail);
       
    }
View Full Code Here

TOP

Related Classes of org.apache.hello_world_doc_lit.PingMeFault

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.