Examples of ObjectMessageContextImpl


Examples of org.objectweb.celtix.context.ObjectMessageContextImpl

        assertNotNull(ret);
        assertTrue(ret.getObject().getTypeCodeKind().value() == TCKind._tk_short);
    }

    public void testMarshalMultipleOutParams() throws Exception {
        ObjectMessageContextImpl objContext = null;
        CorbaMessageContextImpl corbaContext = null;
        Class[] params = null;
       
        // First try call the operation using a void return type
        // Since the call has more than one out parameter, they should be mapped to the parameters
        params = new Class[2];
        params[0] = new Holder<Short>().getClass();
        params[1] = new Holder<Short>().getClass();
       
        objContext = new ObjectMessageContextImpl();
        objContext.setMethod(paramModesClass.getMethod("testMultipleOutParams", params));
        Object[] paramObjs = new Object[2];
        paramObjs[0] = new Holder<Short>((short)123);
        paramObjs[1] = new Holder<Short>((short)456);
        objContext.setMessageObjects(paramObjs);
       
        corbaContext = new CorbaMessageContextImpl(new GenericMessageContext());
        corbaContext.put(ObjectMessageContext.MESSAGE_INPUT, true);
       
        bindingImpl.marshal(objContext,
                            corbaContext,
                            new JAXBDataBindingCallback(objContext.getMethod(),
                                                        DataBindingCallback.Mode.MESSAGE,
                                                        null));
       
        // Verify that everything was marshalled correctly
        CorbaStreamable[] streamables = corbaContext.getMessage().getStreamableArguments();
        assertTrue(streamables.length == 2);
        CorbaStreamable param0 = streamables[0];
        assertTrue(param0.getObject().getTypeCodeKind().value() == TCKind._tk_short);
        assertTrue(param0.getMode() == ARG_OUT.value);
        CorbaStreamable param1 = streamables[1];
        assertTrue(param1.getObject().getTypeCodeKind().value() == TCKind._tk_short);
        assertTrue(param1.getMode() == ARG_OUT.value);

        // Now try the call with a return value
        objContext = new ObjectMessageContextImpl();
        objContext.setMethod(paramModesClass.getMethod("testMultipleOutParamsWithReturn", params));
        objContext.setMessageObjects(paramObjs);
       
        corbaContext = new CorbaMessageContextImpl(new GenericMessageContext());
        corbaContext.put(ObjectMessageContext.MESSAGE_INPUT, true);
       
        bindingImpl.marshal(objContext,
                            corbaContext,
                            new JAXBDataBindingCallback(objContext.getMethod(),
                                                        DataBindingCallback.Mode.MESSAGE,
                                                        null));
       
        // Verify that everything was marshalled correctly
        streamables = corbaContext.getMessage().getStreamableArguments();
View Full Code Here

Examples of org.objectweb.celtix.context.ObjectMessageContextImpl

        assertNotNull(ret);
        assertTrue(ret.getObject().getTypeCodeKind().value() == TCKind._tk_short);
    }

    public void testMarshalMultipleInOutParams() throws Exception {
        ObjectMessageContextImpl objContext = null;
        CorbaMessageContextImpl corbaContext = null;
        Class[] params = null;
       
        // First try call the operation using a void return type
        params = new Class[2];
        params[0] = new Holder<Short>().getClass();
        params[1] = new Holder<Short>().getClass();
       
        objContext = new ObjectMessageContextImpl();
        objContext.setMethod(paramModesClass.getMethod("testMultipleInOutParams", params));
        Object[] paramObjs = new Object[2];
        paramObjs[0] = new Holder<Short>((short)123);
        paramObjs[1] = new Holder<Short>((short)456);
        objContext.setMessageObjects(paramObjs);
       
        corbaContext = new CorbaMessageContextImpl(new GenericMessageContext());
        corbaContext.put(ObjectMessageContext.MESSAGE_INPUT, true);
       
        bindingImpl.marshal(objContext,
                            corbaContext,
                            new JAXBDataBindingCallback(objContext.getMethod(),
                                                        DataBindingCallback.Mode.MESSAGE,
                                                        null));
       
        // Verify that everything was marshalled correctly
        CorbaStreamable[] streamables = corbaContext.getMessage().getStreamableArguments();
        assertTrue(streamables.length == 2);
        CorbaStreamable param0 = streamables[0];
        assertTrue(param0.getObject().getTypeCodeKind().value() == TCKind._tk_short);
        assertTrue(param0.getMode() == ARG_INOUT.value);
        CorbaStreamable param1 = streamables[1];
        assertTrue(param1.getObject().getTypeCodeKind().value() == TCKind._tk_short);
        assertTrue(param1.getMode() == ARG_INOUT.value);

        // Now try the call with a return value
        objContext = new ObjectMessageContextImpl();
        objContext.setMethod(paramModesClass.getMethod("testMultipleInOutParamsWithReturn", params));
        objContext.setMessageObjects(paramObjs);
       
        corbaContext = new CorbaMessageContextImpl(new GenericMessageContext());
        corbaContext.put(ObjectMessageContext.MESSAGE_INPUT, true);
       
        bindingImpl.marshal(objContext,
                            corbaContext,
                            new JAXBDataBindingCallback(objContext.getMethod(),
                                                        DataBindingCallback.Mode.MESSAGE,
                                                        null));
       
        // Verify that everything was marshalled correctly
        streamables = corbaContext.getMessage().getStreamableArguments();
View Full Code Here

Examples of org.objectweb.celtix.context.ObjectMessageContextImpl

        assertNotNull(ret);
        assertTrue(ret.getObject().getTypeCodeKind().value() == TCKind._tk_short);
    }

    public void testMarshalMultipleMixedParams() throws Exception {
        ObjectMessageContextImpl objContext = null;
        CorbaMessageContextImpl corbaContext = null;
        Class[] params = null;
       
        // First try call the operation using a void return type
        params = new Class[3];
        params[0] = short.class;
        params[1] = new Holder<Short>().getClass();
        params[2] = new Holder<Short>().getClass();
       
        objContext = new ObjectMessageContextImpl();
        objContext.setMethod(paramModesClass.getMethod("testMultipleMixedParams", params));
        Object[] paramObjs = new Object[3];
        paramObjs[0] = (short)123;
        paramObjs[1] = new Holder<Short>((short)456);
        paramObjs[2] = new Holder<Short>((short)789);
        objContext.setMessageObjects(paramObjs);
       
        corbaContext = new CorbaMessageContextImpl(new GenericMessageContext());
        corbaContext.put(ObjectMessageContext.MESSAGE_INPUT, true);
       
        bindingImpl.marshal(objContext,
                            corbaContext,
                            new JAXBDataBindingCallback(objContext.getMethod(),
                                                        DataBindingCallback.Mode.MESSAGE,
                                                        null));
       
        // Verify that everything was marshalled correctly
        CorbaStreamable[] streamables = corbaContext.getMessage().getStreamableArguments();
        assertTrue(streamables.length == 3);
        CorbaStreamable param0 = streamables[0];
        assertTrue(param0.getObject().getTypeCodeKind().value() == TCKind._tk_short);
        assertTrue(param0.getMode() == ARG_IN.value);
        CorbaStreamable param1 = streamables[1];
        assertTrue(param1.getObject().getTypeCodeKind().value() == TCKind._tk_short);
        assertTrue(param1.getMode() == ARG_OUT.value);
        CorbaStreamable param2 = streamables[2];
        assertTrue(param2.getObject().getTypeCodeKind().value() == TCKind._tk_short);
        assertTrue(param2.getMode() == ARG_INOUT.value);

        // Now try the call with a return value
        objContext = new ObjectMessageContextImpl();
        objContext.setMethod(paramModesClass.getMethod("testMultipleMixedParamsWithReturn", params));
        objContext.setMessageObjects(paramObjs);
       
        corbaContext = new CorbaMessageContextImpl(new GenericMessageContext());
        corbaContext.put(ObjectMessageContext.MESSAGE_INPUT, true);
       
        bindingImpl.marshal(objContext,
                            corbaContext,
                            new JAXBDataBindingCallback(objContext.getMethod(),
                                                        DataBindingCallback.Mode.MESSAGE,
                                                        null));
       
        // Verify that everything was marshalled correctly
        streamables = corbaContext.getMessage().getStreamableArguments();
View Full Code Here

Examples of org.objectweb.celtix.context.ObjectMessageContextImpl

        assertNotNull(ret);
        assertTrue(ret.getObject().getTypeCodeKind().value() == TCKind._tk_short);
    }
   
    public void testMarshalReturn() throws Exception {
        ObjectMessageContextImpl objContext = null;
        CorbaMessageContextImpl corbaContext = null;
        Class[] params = null;
       
        objContext = new ObjectMessageContextImpl();
        objContext.setMethod(paramModesClass.getMethod("testReturn", params));
       
        corbaContext = new CorbaMessageContextImpl(new GenericMessageContext());
        corbaContext.put(ObjectMessageContext.MESSAGE_INPUT, true);
       
        bindingImpl.marshal(objContext,
                            corbaContext,
                            new JAXBDataBindingCallback(objContext.getMethod(),
                                                        DataBindingCallback.Mode.MESSAGE,
                                                        null));
       
        CorbaStreamable ret = corbaContext.getMessage().getStreamableReturn();
        assertNotNull(ret);
View Full Code Here

Examples of org.objectweb.celtix.context.ObjectMessageContextImpl

   
    protected void setUp() throws Exception {
        super.setUp();
       
        testUtils = new TestUtils();
        objContext = new ObjectMessageContextImpl();
   
        java.util.Properties props = System.getProperties();
        props.put("org.omg.CORBA.ORBClass", "org.apache.yoko.orb.CORBA.ORB");
        props.put("org.omg.CORBA.ORBSingletonClass", "org.apache.yoko.orb.CORBA.ORBSingleton");
        props.put("yoko.orb.id", "Yoko-Server-Binding");
View Full Code Here

Examples of org.objectweb.celtix.context.ObjectMessageContextImpl

    public void testGetDataBindingCallback() throws Exception {
        CeltixService celtixService = createCeltixService();

        QName operationName = new QName("greetMe");
        ObjectMessageContextImpl ctx = new ObjectMessageContextImpl();
        ctx.setMessageObjects(new String[]{"Celtix"});
        ServerDataBindingCallback callback1 = celtixService.getDataBindingCallback(operationName, ctx, PARTS);
        assertNotNull(callback1);

        callback1.invoke(ctx);
        Object rtn = (String) ctx.getReturn();
        assertEquals("Hello Celtix", rtn);

    }
View Full Code Here

Examples of org.objectweb.celtix.context.ObjectMessageContextImpl

public class CeltixInvokerTestCase extends TestCase {

    public void testProcessingInputWithoutInOut() throws Exception {
        String wsdlLocation = "/wsdl/hello_world_doc_lit.wsdl";
        String operationName = "greetMe";
        ObjectMessageContextImpl inputCtx = new ObjectMessageContextImpl();
        CeltixInvoker invoker = createCeltixInvoker(wsdlLocation,
            operationName, inputCtx);

        Object[] args = new Object[1];
        args[0] = new String("hello");
        invoker.invokeTarget(args);

        // Check the input object after processing is correct
        // Should be no change for input if only IN parameters involved
        Object[] myrtn = (Object[]) inputCtx.getMessageObjects();

        assertEquals("hello", myrtn[0]);
    }
View Full Code Here

Examples of org.objectweb.celtix.context.ObjectMessageContextImpl

    }

    public void testProcessingInputWithInOut() throws Exception {
        String wsdlLocation = "/wsdl/hello_world_doc_lit_inout.wsdl";
        String operationName = "greetMe";
        ObjectMessageContextImpl inputCtx = new ObjectMessageContextImpl();
        CeltixInvoker invoker = createCeltixInvoker(wsdlLocation,
            operationName, inputCtx);

        Object[] args = new Object[1];
        String inputvalue = new String("hello");
        args[0] = inputvalue;
        Object result = invoker.invokeTarget(args);

        // Check the input object after processing is correct
        // input should be wrapped as Holder type if it is INOUT parameter
        Object[] myrtn = (Object[]) inputCtx.getMessageObjects();

        //FIXME: this does not work for the wrapped doc/lit case due to a bug in Celtix
        //assertTrue("input is not Holder type", myrtn[0] instanceof Holder);
    }
View Full Code Here

Examples of org.objectweb.celtix.context.ObjectMessageContextImpl

            .createMock(SOAPClientBinding.class);
        clientBinding.createObjectContext();
        EasyMock.expectLastCall().andReturn(inputCtx);
        clientBinding.invoke(EasyMock.isA(ObjectMessageContextImpl.class),
            EasyMock.isA(SCADataBindingCallback.class));
        EasyMock.expectLastCall().andReturn(new ObjectMessageContextImpl());
        EasyMock.replay(clientBinding);

        SOAPBindingFactory bindingFactory = EasyMock.createNiceMock(SOAPBindingFactory.class);
        bindingFactory.createClientBinding(EasyMock.isA(EndpointReferenceType.class));
        EasyMock.expectLastCall().andReturn(clientBinding);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.