Package org.apache.tuscany.sca.binding.corba.provider.service

Examples of org.apache.tuscany.sca.binding.corba.provider.service.ComponentInvocationProxy


    public void test_nonCorbaServants() {
        try {
            NonCorbaServant ncs = new NonCorbaServant();
            TestRuntimeComponentService service = new TestRuntimeComponentService(ncs);
            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
            InvocationProxy proxy = new ComponentInvocationProxy((RuntimeEndpoint) service.getEndpoints().get(0), javaClass);
            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
            bindServant(servant, "NonCorbaServant");
            // it's non corba servant so we don't have stubs to test them
            DynaCorbaRequest request = new DynaCorbaRequest(bindReference("NonCorbaServant"), "setString");
            request.addArgument(TestConstants.STR_1);
            request.setOutputType(String.class);
            DynaCorbaResponse response = request.invoke();
            assertTrue(response.getContent().equals(TestConstants.STR_1));
        } catch (Exception e) {
            e.printStackTrace();
            fail();
        }

        try {
            NonCorbaServant ncs = new NonCorbaServant();
            TestRuntimeComponentService service = new TestRuntimeComponentService(ncs);
            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
            InvocationProxy proxy = new ComponentInvocationProxy((RuntimeEndpoint) service.getEndpoints().get(0), javaClass);
            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
            bindServant(servant, "NonCorbaServant");
            // it's non corba servant so we don't have stubs to test them
            DynaCorbaRequest request = new DynaCorbaRequest(bindReference("NonCorbaServant"), "throwException");
            request.addExceptionType(NonCorbaException.class);
View Full Code Here


    public void test_systemException_BAD_PARAM() {
        try {
            CalcServant calc = new CalcServant();
            TestRuntimeComponentService service = new TestRuntimeComponentService(calc);
            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
            InvocationProxy proxy = new ComponentInvocationProxy((RuntimeEndpoint) service.getEndpoints().get(0), javaClass);
            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
            String[] ids = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/TestObject:1.0"};
            servant.setIds(ids);
            bindServant(servant, "Calc");
            DynaCorbaRequest request = new DynaCorbaRequest(bindReference("Calc"), "div");
View Full Code Here

        try {
            InvalidTypesServant its = new InvalidTypesServant();
            TestRuntimeComponentService service = new TestRuntimeComponentService(its);
            //expecting exception...
            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
            InvocationProxy proxy = new ComponentInvocationProxy((RuntimeEndpoint) service.getEndpoints().get(0), javaClass);
            new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
            fail();
        } catch (Exception e) {
            if (e instanceof RequestConfigurationException) {
                assertTrue(true);
View Full Code Here

    public void test_arraysPassing() {
        try {
            ArraysUnionsTuscanyServant arraysUnions = new ArraysUnionsTuscanyServant();
            TestRuntimeComponentService service = new TestRuntimeComponentService(arraysUnions);
            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
            InvocationProxy proxy = new ComponentInvocationProxy((RuntimeEndpoint) service.getEndpoints().get(0), javaClass);
            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
            String[] ids = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/arrays_unions/ArraysUnionsTests:1.0"};
            servant.setIds(ids);
            bindServant(servant, "ArraysUnions");
            Object reference = bindReference("ArraysUnions");
View Full Code Here

     * @see org.apache.tuscany.sca.provider.ServiceBindingProvider#start()
     */
    public void start() {
        try {
            Class<?> javaClass = ((JavaInterface)endpoint.getComponentTypeServiceInterfaceContract().getInterface()).getJavaClass();
            InvocationProxy proxy = new ComponentInvocationProxy(endpoint, javaClass);
            servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
            servant.setIds(new String[] {binding.getId()});
            host.registerServant(binding.getCorbaname(), servant);
        } catch (Exception e) {
            throw new ServiceRuntimeException(e);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.corba.provider.service.ComponentInvocationProxy

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.