Package org.apache.tuscany.sca.binding.corba.testing.generated

Examples of org.apache.tuscany.sca.binding.corba.testing.generated.TestObject


     * Tests structures (arguments, return types)
     */
    @Test
    public void test_TestObject_setStruct() {
        try {
            TestObject to = new TestObjectServant();
            TestRuntimeComponentService service = new TestRuntimeComponentService(to);
            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, "TestObject");
            TestObject testObject = TestObjectHelper.narrow(bindReference("TestObject"));
            SomeStruct ss = new SomeStruct();
            SimpleStruct inner = new SimpleStruct();
            inner.field1 = TestConstants.STR_1;
            inner.field2 = TestConstants.INT_1;
            ss.innerStruct = inner;
            ss.str = TestConstants.STR_2;
            ss.str_list = TestConstants.STR_ARR_1;
            ss.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
            ss.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
            SomeStruct result = testObject.setStruct(ss);
            assertTrue(TestConstants.are2DimArraysEqual(result.twoDimSeq, TestConstants.INT_ARRAY_2_DIM));
            assertTrue(TestConstants.are3DimArraysEqual(result.threeDimSeq, TestConstants.INT_ARRAY_3_DIM));
            assertTrue(result.str.equals(ss.str));
            assertTrue(result.innerStruct.field1.equals(ss.innerStruct.field1));
            assertTrue(result.innerStruct.field2 == ss.innerStruct.field2);
View Full Code Here


            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, "InvalidTestObject");
            TestObject to = TestObjectHelper.narrow(bindReference("InvalidTestObject"));
            SomeStruct str = new SomeStruct();
            str.innerStruct = new SimpleStruct();
            str.innerStruct.field1 = "Whatever";
            str.str = "Whatever";
            str.str_list = new String[] {};
            str.threeDimSeq = new int[][][] {};
            str.twoDimSeq = new int[][] {};
            to.setStruct(str);
        } catch (Exception e) {
            if (e instanceof BAD_OPERATION) {
                assertTrue(true);
            } else {
                e.printStackTrace();
View Full Code Here

     * Tests structures (arguments, return types)
     */
    @Test
    public void test_TestObject_setStruct() {
        try {
            TestObject to = new TestObjectServant();
            TestRuntimeComponentService service = new TestRuntimeComponentService(to);
            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 = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/TestObject:1.0"};
            servant.setIds(ids);
            bindServant(servant, "TestObject");
            TestObject testObject = TestObjectHelper.narrow(bindReference("TestObject"));
            SomeStruct ss = new SomeStruct();
            SimpleStruct inner = new SimpleStruct();
            inner.field1 = TestConstants.STR_1;
            inner.field2 = TestConstants.INT_1;
            ss.innerStruct = inner;
            ss.str = TestConstants.STR_2;
            ss.str_list = TestConstants.STR_ARR_1;
            ss.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
            ss.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
            SomeStruct result = testObject.setStruct(ss);
            assertTrue(TestConstants.are2DimArraysEqual(result.twoDimSeq, TestConstants.INT_ARRAY_2_DIM));
            assertTrue(TestConstants.are3DimArraysEqual(result.threeDimSeq, TestConstants.INT_ARRAY_3_DIM));
            assertTrue(result.str.equals(ss.str));
            assertTrue(result.innerStruct.field1.equals(ss.innerStruct.field1));
            assertTrue(result.innerStruct.field2 == ss.innerStruct.field2);
View Full Code Here

            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), 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, "InvalidTestObject");
            TestObject to = TestObjectHelper.narrow(bindReference("InvalidTestObject"));
            SomeStruct str = new SomeStruct();
            str.innerStruct = new SimpleStruct();
            str.innerStruct.field1 = "Whatever";
            str.str = "Whatever";
            str.str_list = new String[] {};
            str.threeDimSeq = new int[][][] {};
            str.twoDimSeq = new int[][] {};
            to.setStruct(str);
        } catch (Exception e) {
            if (e instanceof BAD_OPERATION) {
                assertTrue(true);
            } else {
                e.printStackTrace();
View Full Code Here

     * Tests structures (arguments, return types)
     */
    @Test
    public void test_TestObject_setStruct() {
        try {
            TestObject to = new TestObjectServant();
            TestRuntimeComponentService service = new TestRuntimeComponentService(to);
            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, "TestObject");
            TestObject testObject = TestObjectHelper.narrow(bindReference("TestObject"));
            SomeStruct ss = new SomeStruct();
            SimpleStruct inner = new SimpleStruct();
            inner.field1 = TestConstants.STR_1;
            inner.field2 = TestConstants.INT_1;
            ss.innerStruct = inner;
            ss.str = TestConstants.STR_2;
            ss.str_list = TestConstants.STR_ARR_1;
            ss.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
            ss.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
            SomeStruct result = testObject.setStruct(ss);
            assertTrue(TestConstants.are2DimArraysEqual(result.twoDimSeq, TestConstants.INT_ARRAY_2_DIM));
            assertTrue(TestConstants.are3DimArraysEqual(result.threeDimSeq, TestConstants.INT_ARRAY_3_DIM));
            assertTrue(result.str.equals(ss.str));
            assertTrue(result.innerStruct.field1.equals(ss.innerStruct.field1));
            assertTrue(result.innerStruct.field2 == ss.innerStruct.field2);
View Full Code Here

            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, "InvalidTestObject");
            TestObject to = TestObjectHelper.narrow(bindReference("InvalidTestObject"));
            SomeStruct str = new SomeStruct();
            str.innerStruct = new SimpleStruct();
            str.innerStruct.field1 = "Whatever";
            str.str = "Whatever";
            str.str_list = new String[] {};
            str.threeDimSeq = new int[][][] {};
            str.twoDimSeq = new int[][] {};
            to.setStruct(str);
        } catch (Exception e) {
            if (e instanceof BAD_OPERATION) {
                assertTrue(true);
            } else {
                e.printStackTrace();
View Full Code Here

     * Tests structures (arguments, return types)
     */
    @Test
    public void test_TestObject_setStruct() {
        try {
            TestObject to = new TestObjectServant();
            TestRuntimeComponentService service = new TestRuntimeComponentService(to);
            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 = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/TestObject:1.0"};
            servant.setIds(ids);
            bindServant(servant, "TestObject");
            TestObject testObject = TestObjectHelper.narrow(bindReference("TestObject"));
            SomeStruct ss = new SomeStruct();
            SimpleStruct inner = new SimpleStruct();
            inner.field1 = TestConstants.STR_1;
            inner.field2 = TestConstants.INT_1;
            ss.innerStruct = inner;
            ss.str = TestConstants.STR_2;
            ss.str_list = TestConstants.STR_ARR_1;
            ss.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
            ss.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
            SomeStruct result = testObject.setStruct(ss);
            assertTrue(TestConstants.are2DimArraysEqual(result.twoDimSeq, TestConstants.INT_ARRAY_2_DIM));
            assertTrue(TestConstants.are3DimArraysEqual(result.threeDimSeq, TestConstants.INT_ARRAY_3_DIM));
            assertTrue(result.str.equals(ss.str));
            assertTrue(result.innerStruct.field1.equals(ss.innerStruct.field1));
            assertTrue(result.innerStruct.field2 == ss.innerStruct.field2);
View Full Code Here

            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), 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, "InvalidTestObject");
            TestObject to = TestObjectHelper.narrow(bindReference("InvalidTestObject"));
            SomeStruct str = new SomeStruct();
            str.innerStruct = new SimpleStruct();
            str.innerStruct.field1 = "Whatever";
            str.str = "Whatever";
            str.str_list = new String[] {};
            str.threeDimSeq = new int[][][] {};
            str.twoDimSeq = new int[][] {};
            to.setStruct(str);
        } catch (Exception e) {
            if (e instanceof BAD_OPERATION) {
                assertTrue(true);
            } else {
                e.printStackTrace();
View Full Code Here

     * Tests structures (arguments, return types)
     */
    @Test
    public void test_TestObject_setStruct() {
        try {
            TestObject to = new TestObjectServant();
            TestRuntimeComponentService service = new TestRuntimeComponentService(to);
            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, "TestObject");
            TestObject testObject = TestObjectHelper.narrow(bindReference("TestObject"));
            SomeStruct ss = new SomeStruct();
            SimpleStruct inner = new SimpleStruct();
            inner.field1 = TestConstants.STR_1;
            inner.field2 = TestConstants.INT_1;
            ss.innerStruct = inner;
            ss.str = TestConstants.STR_2;
            ss.str_list = TestConstants.STR_ARR_1;
            ss.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
            ss.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
            SomeStruct result = testObject.setStruct(ss);
            assertTrue(TestConstants.are2DimArraysEqual(result.twoDimSeq, TestConstants.INT_ARRAY_2_DIM));
            assertTrue(TestConstants.are3DimArraysEqual(result.threeDimSeq, TestConstants.INT_ARRAY_3_DIM));
            assertTrue(result.str.equals(ss.str));
            assertTrue(result.innerStruct.field1.equals(ss.innerStruct.field1));
            assertTrue(result.innerStruct.field2 == ss.innerStruct.field2);
View Full Code Here

            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, "InvalidTestObject");
            TestObject to = TestObjectHelper.narrow(bindReference("InvalidTestObject"));
            SomeStruct str = new SomeStruct();
            str.innerStruct = new SimpleStruct();
            str.innerStruct.field1 = "Whatever";
            str.str = "Whatever";
            str.str_list = new String[] {};
            str.threeDimSeq = new int[][][] {};
            str.twoDimSeq = new int[][] {};
            to.setStruct(str);
        } catch (Exception e) {
            if (e instanceof BAD_OPERATION) {
                assertTrue(true);
            } else {
                e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.corba.testing.generated.TestObject

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.