Examples of Calc


Examples of org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc

            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
            String[] ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc:1.0"};
            servant.setIds(ids);
            bindServant(servant, "Calc");
            Calc calcClient = CalcHelper.narrow(bindReference("Calc"));
            calcClient.div(1, 0);
            fail();
        } catch (Exception e) {
            if (e instanceof DivByZero) {
                assertTrue(true);
            } else {
                e.printStackTrace();
                fail();
            }
        }

        try {
            CalcServant calc = new CalcServant();
            TestRuntimeComponentService service = new TestRuntimeComponentService(calc);
            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
            String[] ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc:1.0"};
            servant.setIds(ids);
            bindServant(servant, "Calc");
            Calc calcClient = CalcHelper.narrow(bindReference("Calc"));
            calcClient.divForSmallArgs(255, 255);
            fail();
        } catch (Exception e) {
            if (e instanceof NotSupported) {
                assertTrue(true);
            } else {
View Full Code Here

Examples of org.apache.tuscany.sca.binding.corba.testing.exceptions.Calc

            InvocationProxy proxy = new ComponentInvocationProxy((RuntimeEndpoint) service.getEndpoints().get(0), javaClass);
            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
            String[] ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc:1.0"};
            servant.setIds(ids);
            bindServant(servant, "Calc");
            Calc calcClient = CalcHelper.narrow(bindReference("Calc"));
            calcClient.div(1, 0);
            fail();
        } catch (Exception e) {
            if (e instanceof DivByZero) {
                assertTrue(true);
            } else {
                e.printStackTrace();
                fail();
            }
        }

        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 = {"IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc:1.0"};
            servant.setIds(ids);
            bindServant(servant, "Calc");
            Calc calcClient = CalcHelper.narrow(bindReference("Calc"));
            calcClient.divForSmallArgs(255, 255);
            fail();
        } catch (Exception e) {
            if (e instanceof NotSupported) {
                assertTrue(true);
            } else {
View Full Code Here

Examples of project.bottom.Calc

        project.library.Util.useUtilClass();

        System.out.println("a=" + a);
        System.out.println("b=" + b);

        Calc calc = new Calc();
        return calc.sum(a, b);
    }
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.