Package org.objectweb.header_test.types

Examples of org.objectweb.header_test.types.TestHeader3


       
        //TestHeader3 InOutHeader
        Method testHeader3 = SOAPMessageUtil.getMethod(TestHeader.class, "testHeader3");
        assertNotNull(testHeader3);
        objContext.setMethod(testHeader3);
        TestHeader3 arg0 = new TestHeader3();       
        TestHeader3 arg1 = new TestHeader3();
        arg1.setRequestType("HeaderVal");
        Object[] args = SOAPMessageUtil.getMessageObjects(testHeader3, arg0, arg1);
        objContext.setMessageObjects(args);
        //Write soap headers for testHeader3 operation - tests inout headers
        binding.marshal(
                   objContext,
                   soapContext,
                   new JAXBDataBindingCallback(testHeader3,
                                               DataBindingCallback.Mode.PARTS,
                                               null));               

        msg = soapContext.getMessage();
        assertNotNull(msg);

        //Test the Header Part Only
        assertNotNull(msg.getSOAPHeader());
        assertTrue(msg.getSOAPHeader().hasChildNodes());
        list = msg.getSOAPHeader().getChildNodes();
        assertEquals(1, list.getLength());
        headerElement = (Element)list.item(0);
        //TestHeader3 has no child elements
        assertTrue(headerElement.hasChildNodes());
        list = headerElement.getChildNodes();
        assertEquals(1, list.getLength());
        headerElement = (Element)list.item(0);
        assertTrue(headerElement.hasChildNodes());
        list = headerElement.getChildNodes();
        assertEquals(1, list.getLength());
        Text text = (Text)list.item(0);
        assertEquals(arg1.getRequestType(), text.getData());
    }
View Full Code Here


        assertEquals(2, params.length);
        assertTrue(params[1].getClass().isAssignableFrom(Holder.class));
        Holder<?> holder = (Holder<?>)params[1];
        assertNotNull(holder.value);
        assertTrue(holder.value.getClass().isAssignableFrom(TestHeader3.class));
        TestHeader3 header3 = (TestHeader3)holder.value;
        assertNull(header3.getRequestType());
    }
View Full Code Here

    }

    public void testInOutHeader() throws Exception {
       
        try {
            TestHeader3 in = new TestHeader3();
            String val = new String(TestHeader3.class.getSimpleName());
            Holder<TestHeader3> inoutHeader = new Holder<TestHeader3>();
            for (int idx = 0; idx < 2; idx++) {
                val += idx;               
                in.setRequestType(val);
                inoutHeader.value = new TestHeader3();
                TestHeader3Response returnVal = proxy.testHeader3(in, inoutHeader);
                //inoutHeader copied to return
                //in copied to inoutHeader
                assertNotNull(returnVal);
                assertNull(returnVal.getResponseType());
                assertEquals(val, inoutHeader.value.getRequestType());
               
                in.setRequestType(null);
                inoutHeader.value.setRequestType(val);
                returnVal = proxy.testHeader3(in, inoutHeader);
                assertNotNull(returnVal);
                assertEquals(val, returnVal.getResponseType());
                assertNull(inoutHeader.value.getRequestType());
View Full Code Here

TOP

Related Classes of org.objectweb.header_test.types.TestHeader3

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.