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

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


            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


            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[][][] {};
View Full Code Here

     */
    @Test
    public void test_TestObject_setStruct() {
        DynaCorbaRequest request = new DynaCorbaRequest(refTestObject, "setStruct");

        SomeStruct struct = new SomeStruct();
        SimpleStruct inner = new SimpleStruct();
        inner.field1 = TestConstants.STR_1;
        inner.field2 = TestConstants.INT_1;
        struct.innerStruct = inner;
        struct.str_list = TestConstants.STR_ARR_2;
        struct.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
        struct.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
        struct.str = TestConstants.STR_1;

        try {
            request.addArgument(struct);
            request.setOutputType(SomeStruct.class);
            DynaCorbaResponse response = request.invoke();
            SomeStruct result = (SomeStruct)response.getContent();
            assertTrue(TestConstants.are2DimArraysEqual(result.twoDimSeq, TestConstants.INT_ARRAY_2_DIM));
            assertTrue(TestConstants.are3DimArraysEqual(result.threeDimSeq, TestConstants.INT_ARRAY_3_DIM));
            assertEquals(TestConstants.STR_1, result.str);
            assertEquals(TestConstants.STR_ARR_2[0], result.str_list[0]);
            assertEquals(TestConstants.STR_ARR_2[1], result.str_list[1]);
View Full Code Here

    /**
     * Tests passing multiple complex attributes.
     */
    @Test
    public void test_TestObject_pickStructFromArgs() {
        SomeStruct arg1 = new SomeStruct();
        SomeStruct arg2 = new SomeStruct();
        SomeStruct arg3 = new SomeStruct();

        SimpleStruct inner = new SimpleStruct();
        inner.field1 = TestConstants.STR_1;
        inner.field2 = TestConstants.INT_1;

        arg1.innerStruct = inner;
        arg2.innerStruct = inner;
        arg3.innerStruct = inner;

        arg1.str = TestConstants.STR_1;
        arg2.str = TestConstants.STR_2;
        arg3.str = TestConstants.STR_3;

        arg1.str_list = TestConstants.STR_ARR_1;
        arg2.str_list = TestConstants.STR_ARR_2;
        arg3.str_list = TestConstants.STR_ARR_2;

        arg1.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
        arg2.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
        arg3.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;

        arg1.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
        arg2.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
        arg3.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;

        DynaCorbaRequest request = new DynaCorbaRequest(refTestObject, "pickStructFromArgs");
        try {

            request.setOutputType(SomeStruct.class);
            request.addArgument(arg1);
            request.addArgument(arg2);
            request.addArgument(arg3);
            request.addArgument(1);
            DynaCorbaResponse response = request.invoke();
            SomeStruct result = (SomeStruct)response.getContent();

            // just make sure that servant returned right structure
            assertTrue(result.str.equals(TestConstants.STR_1));
        } catch (Exception e) {
            fail("Exception occured during tests " + e);
View Full Code Here

     */
    @Test
    public void test_TestObject_setStruct() {
        DynaCorbaRequest request = new DynaCorbaRequest(refTestObject, "setStruct");

        SomeStruct struct = new SomeStruct();
        SimpleStruct inner = new SimpleStruct();
        inner.field1 = TestConstants.STR_1;
        inner.field2 = TestConstants.INT_1;
        struct.innerStruct = inner;
        struct.str_list = TestConstants.STR_ARR_2;
        struct.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
        struct.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
        struct.str = TestConstants.STR_1;

        try {
            request.addArgument(struct);
            request.setOutputType(SomeStruct.class);
            DynaCorbaResponse response = request.invoke();
            SomeStruct result = (SomeStruct)response.getContent();
            assertTrue(TestConstants.are2DimArraysEqual(result.twoDimSeq, TestConstants.INT_ARRAY_2_DIM));
            assertTrue(TestConstants.are3DimArraysEqual(result.threeDimSeq, TestConstants.INT_ARRAY_3_DIM));
            assertEquals(TestConstants.STR_1, result.str);
            assertEquals(TestConstants.STR_ARR_2[0], result.str_list[0]);
            assertEquals(TestConstants.STR_ARR_2[1], result.str_list[1]);
View Full Code Here

    /**
     * Tests passing multiple complex attributes.
     */
    @Test
    public void test_TestObject_pickStructFromArgs() {
        SomeStruct arg1 = new SomeStruct();
        SomeStruct arg2 = new SomeStruct();
        SomeStruct arg3 = new SomeStruct();

        SimpleStruct inner = new SimpleStruct();
        inner.field1 = TestConstants.STR_1;
        inner.field2 = TestConstants.INT_1;

        arg1.innerStruct = inner;
        arg2.innerStruct = inner;
        arg3.innerStruct = inner;

        arg1.str = TestConstants.STR_1;
        arg2.str = TestConstants.STR_2;
        arg3.str = TestConstants.STR_3;

        arg1.str_list = TestConstants.STR_ARR_1;
        arg2.str_list = TestConstants.STR_ARR_2;
        arg3.str_list = TestConstants.STR_ARR_2;

        arg1.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
        arg2.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
        arg3.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;

        arg1.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
        arg2.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
        arg3.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;

        DynaCorbaRequest request = new DynaCorbaRequest(refTestObject, "pickStructFromArgs");
        try {

            request.setOutputType(SomeStruct.class);
            request.addArgument(arg1);
            request.addArgument(arg2);
            request.addArgument(arg3);
            request.addArgument(1);
            DynaCorbaResponse response = request.invoke();
            SomeStruct result = (SomeStruct)response.getContent();

            // just make sure that servant returned right structure
            assertTrue(result.str.equals(TestConstants.STR_1));
        } catch (Exception e) {
            fail("Exception occured during tests " + e);
View Full Code Here

            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

            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[][][] {};
View Full Code Here

     */
    @Test
    public void test_TestObject_setStruct() {
        DynaCorbaRequest request = new DynaCorbaRequest(refTestObject, "setStruct");

        SomeStruct struct = new SomeStruct();
        SimpleStruct inner = new SimpleStruct();
        inner.field1 = TestConstants.STR_1;
        inner.field2 = TestConstants.INT_1;
        struct.innerStruct = inner;
        struct.str_list = TestConstants.STR_ARR_2;
        struct.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
        struct.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
        struct.str = TestConstants.STR_1;

        try {
            request.addArgument(struct);
            request.setOutputType(SomeStruct.class);
            DynaCorbaResponse response = request.invoke();
            SomeStruct result = (SomeStruct)response.getContent();
            assertTrue(TestConstants.are2DimArraysEqual(result.twoDimSeq, TestConstants.INT_ARRAY_2_DIM));
            assertTrue(TestConstants.are3DimArraysEqual(result.threeDimSeq, TestConstants.INT_ARRAY_3_DIM));
            assertEquals(TestConstants.STR_1, result.str);
            assertEquals(TestConstants.STR_ARR_2[0], result.str_list[0]);
            assertEquals(TestConstants.STR_ARR_2[1], result.str_list[1]);
View Full Code Here

    /**
     * Tests passing multiple complex attributes.
     */
    @Test
    public void test_TestObject_pickStructFromArgs() {
        SomeStruct arg1 = new SomeStruct();
        SomeStruct arg2 = new SomeStruct();
        SomeStruct arg3 = new SomeStruct();

        SimpleStruct inner = new SimpleStruct();
        inner.field1 = TestConstants.STR_1;
        inner.field2 = TestConstants.INT_1;

        arg1.innerStruct = inner;
        arg2.innerStruct = inner;
        arg3.innerStruct = inner;

        arg1.str = TestConstants.STR_1;
        arg2.str = TestConstants.STR_2;
        arg3.str = TestConstants.STR_3;

        arg1.str_list = TestConstants.STR_ARR_1;
        arg2.str_list = TestConstants.STR_ARR_2;
        arg3.str_list = TestConstants.STR_ARR_2;

        arg1.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
        arg2.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
        arg3.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;

        arg1.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
        arg2.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
        arg3.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;

        DynaCorbaRequest request = new DynaCorbaRequest(refTestObject, "pickStructFromArgs");
        try {

            request.setOutputType(SomeStruct.class);
            request.addArgument(arg1);
            request.addArgument(arg2);
            request.addArgument(arg3);
            request.addArgument(1);
            DynaCorbaResponse response = request.invoke();
            SomeStruct result = (SomeStruct)response.getContent();

            // just make sure that servant returned right structure
            assertTrue(result.str.equals(TestConstants.STR_1));
        } catch (Exception e) {
            fail("Exception occured during tests " + e);
View Full Code Here

TOP

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

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.