Package org.apache.cxf.jaxb

Examples of org.apache.cxf.jaxb.JAXBDataReaderFactory


    public void tearDown() throws IOException {
        is.close();
    }

    public void testReadWrapper() throws Exception {
        JAXBDataReaderFactory rf = getTestReaderFactory(GreetMe.class);

        reader = getTestReader("../resources/GreetMeDocLiteralReq.xml");
        assertNotNull(reader);
       
        DataReader<XMLStreamReader> dr = rf.createReader(XMLStreamReader.class);
        assertNotNull(dr);
        Object val = dr.read(reader);
        assertNotNull(val);
        assertTrue(val instanceof GreetMe);
        assertEquals("TestSOAPInputPMessage", ((GreetMe)val).getRequestType());
View Full Code Here


        assertTrue(val instanceof GreetMe);
        assertEquals("TestSOAPInputPMessage", ((GreetMe)val).getRequestType());
    }

    public void testReadWrapperReturn() throws Exception {
        JAXBDataReaderFactory rf = getTestReaderFactory(GreetMeResponse.class);

        reader = getTestReader("../resources/GreetMeDocLiteralResp.xml");
        assertNotNull(reader);

        DataReader<XMLStreamReader> dr = rf.createReader(XMLStreamReader.class);
        assertNotNull(dr);
       
        Object retValue = dr.read(reader);
       
        assertNotNull(retValue);
View Full Code Here

        assertTrue(retValue instanceof GreetMeResponse);
        assertEquals("TestSOAPOutputPMessage", ((GreetMeResponse)retValue).getResponseType());
    }

    public void testReadRPC() throws Exception {
        JAXBDataReaderFactory rf = getTestReaderFactory(MyComplexStruct.class);

        QName[] tags = {new QName("http://apache.org/hello_world_rpclit", "sendReceiveData")};

        reader = getTestReader("../resources/greetMeRpcLitReq.xml");
        assertNotNull(reader);
       
        XMLStreamReader localReader = getTestFilteredReader(reader, tags);

        DataReader<XMLStreamReader> dr = rf.createReader(XMLStreamReader.class);
        assertNotNull(dr);
        Object val = dr.read(new QName("http://apache.org/hello_world_rpclit", "in"),
                             localReader,
                             MyComplexStruct.class);
        assertNotNull(val);
View Full Code Here

        assertEquals(42, ((MyComplexStruct)val).getElem3());
    }


    public void testReadBare() throws Exception {
        JAXBDataReaderFactory rf = getTestReaderFactory(TradePriceData.class);

        reader = getTestReader("../resources/sayHiDocLitBareReq.xml");
        assertNotNull(reader);
       
        DataReader<XMLStreamReader> dr = rf.createReader(XMLStreamReader.class);
        assertNotNull(dr);
        QName elName = new QName("http://apache.org/hello_world_doc_lit_bare/types", "inout");
        MessagePartInfo part = new MessagePartInfo(elName, null);
        part.setElement(true);
        part.setElementQName(elName);
View Full Code Here

        assertEquals(1.0f, ((TradePriceData)val).getTickerPrice());
    }

    private JAXBDataReaderFactory getTestReaderFactory(Class... clz) throws Exception {
        JAXBContext ctx = JAXBContext.newInstance(clz);
        JAXBDataReaderFactory readerFacotry = new JAXBDataReaderFactory();
        readerFacotry.setJAXBContext(ctx);
        return readerFacotry;
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxb.JAXBDataReaderFactory

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.