Testing struct for array and list (Java and C++); fixing bugs
authorrtrimana <rtrimana@uci.edu>
Sat, 3 Dec 2016 00:29:38 +0000 (16:29 -0800)
committerrtrimana <rtrimana@uci.edu>
Sat, 3 Dec 2016 00:29:38 +0000 (16:29 -0800)
config/iotpolicy/testclasspolicy.pol
iotjava/iotpolicy/IoTCompiler.java
iotjava/iotrmi/C++/basics/TestClass.hpp
iotjava/iotrmi/C++/basics/TestClass_Stub.cpp
iotjava/iotrmi/Java/basics/TestClass.java
iotjava/iotrmi/Java/basics/TestClass_Stub.java

index 3c03d53285ae5cde3650cfba81cbd493b011ff80..1d9d47a5dd92f3ad5095dfa14deb7adba5234a9a 100644 (file)
@@ -29,6 +29,8 @@ public interface TestClassInterface {
        public List<Enum> handleEnumList(List<Enum> en);
 
        public Struct handleStruct(Struct str);
+       public Struct[] handleStructArray(Struct str[]);
+       public List<Struct> handleStructList(List<Struct> str);
 
        public int getA();
        public void setA(int _int);
@@ -67,6 +69,8 @@ public interface TestClassInterface {
                method = "handleEnumList(List<Enum> en)";
 
                method = "handleStruct(Struct str)";
+               method = "handleStructArray(Struct str[])";
+               method = "handleStructList(List<Struct> str)";
 
                method = "getA()";
                method = "setA(int _int)";
index 6555f9d9e934034586a93f608d24baf9fc28d745..c23896f3e016fa55e74f052c4bc01c5c4fbdcbf0 100644 (file)
@@ -629,7 +629,7 @@ public class IoTCompiler {
                for (int i = 0; i < methParams.size(); i++) {
                        String paramType = methPrmTypes.get(i);
                        String param = methParams.get(i);
-                       String simpleType = getSimpleType(paramType);
+                       String simpleType = getGenericType(paramType);
                        if (isStructClass(simpleType)) {
                        // Check if this is enum type
                                int methodNumId = intDecl.getMethodNumId(method);
@@ -661,7 +661,7 @@ public class IoTCompiler {
                for (int i = 0; i < methParams.size(); i++) {
                        String paramType = methPrmTypes.get(i);
                        String param = methParams.get(i);
-                       String simpleType = getSimpleType(paramType);
+                       String simpleType = getGenericType(paramType);
                        if (isStructClass(simpleType))
                                return true;
                }
@@ -682,10 +682,10 @@ public class IoTCompiler {
                        if (isStructClass(simpleType)) {
                                int members = getNumOfMembers(simpleType);
                                if (isArray(param)) {                   // An array
-                                       String structLen = param + ".length";
+                                       String structLen = getSimpleArrayType(param) + ".length";
                                        print(members + "*" + structLen);
                                } else if (isList(paramType)) { // A list
-                                       String structLen = param + ".size()";
+                                       String structLen = getSimpleArrayType(param) + ".size()";
                                        print(members + "*" + structLen);
                                } else
                                        print(Integer.toString(members));
@@ -708,15 +708,21 @@ public class IoTCompiler {
                List<String> memTypes = structDecl.getMemberTypes(simpleType);
                List<String> members = structDecl.getMembers(simpleType);
                if (isArray(param)) {                   // An array
-                       println("for(int i = 0; i < " + param + ".length; i++) {");
+                       println("for(int i = 0; i < " + getSimpleIdentifier(param) + ".length; i++) {");
+                       for (int i = 0; i < members.size(); i++) {
+                               String prmType = checkAndGetArray(memTypes.get(i), members.get(i));
+                               println("paramCls[pos] = " + getSimpleType(getEnumType(prmType)) + ".class;");
+                               print("paramObj[pos++] = " + getSimpleIdentifier(param) + "[i].");
+                               print(getSimpleIdentifier(members.get(i)));
+                               println(";");
+                       }
+                       println("}");
                } else if (isList(paramType)) { // A list
-                       println("for(int i = 0; i < " + param + ".size(); i++) {");
-               }
-               if (isArrayOrList(param, paramType)) {  // An array or list
+                       println("for(int i = 0; i < " + getSimpleIdentifier(param) + ".size(); i++) {");
                        for (int i = 0; i < members.size(); i++) {
                                String prmType = checkAndGetArray(memTypes.get(i), members.get(i));
                                println("paramCls[pos] = " + getSimpleType(getEnumType(prmType)) + ".class;");
-                               print("paramObj[pos++] = " + param + "[i].");
+                               print("paramObj[pos++] = " + getSimpleIdentifier(param) + ".get(i).");
                                print(getSimpleIdentifier(members.get(i)));
                                println(";");
                        }
@@ -725,7 +731,7 @@ public class IoTCompiler {
                        for (int i = 0; i < members.size(); i++) {
                                String prmType = checkAndGetArray(memTypes.get(i), members.get(i));
                                println("paramCls[pos] = " + getSimpleType(getEnumType(prmType)) + ".class;");
-                               print("paramObj[pos++] = " + param + ".");
+                               print("paramObj[pos++] = " + getSimpleIdentifier(param) + ".");
                                print(getSimpleIdentifier(members.get(i)));
                                println(";");
                        }
@@ -1229,7 +1235,7 @@ public class IoTCompiler {
                        for (int i = 0; i < methParams.size(); i++) {
                                String paramType = methPrmTypes.get(i);
                                String param = methParams.get(i);
-                               String simpleType = getSimpleType(paramType);
+                               String simpleType = getGenericType(paramType);
                                if (isStructClass(simpleType)) {
                                        int methodNumId = intDecl.getMethodNumId(method);
                                        String helperMethod = methodNumId + "struct" + i;
@@ -1514,14 +1520,13 @@ public class IoTCompiler {
                StructDecl structDecl = getStructDecl(simpleType);
                List<String> memTypes = structDecl.getMemberTypes(simpleType);
                List<String> members = structDecl.getMembers(simpleType);
-               if (isArrayOrList(param, paramType)) {  // An array or list
+               println("int pos = 0;");
+               if (isArrayOrList(paramType, param)) {  // An array or list
                        int methodNumId = intDecl.getMethodNumId(method);
                        String counter = "struct" + methodNumId + "Size" + iVar;
                        println("for(int i = 0; i < " + counter + "; i++) {");
                }
-               println("int pos = 0;");
-               if (isArrayOrList(param, paramType)) {  // An array or list
-                       println("for(int i = 0; i < retLen; i++) {");
+               if (isArrayOrList(paramType, param)) {  // An array or list
                        for (int i = 0; i < members.size(); i++) {
                                String prmType = checkAndGetArray(memTypes.get(i), members.get(i));
                                println("paramCls[pos] = " + getSimpleType(getEnumType(prmType)) + ".class;");
@@ -1566,7 +1571,7 @@ public class IoTCompiler {
                                StructDecl structDecl = getStructDecl(simpleType);
                                List<String> members = structDecl.getMembers(simpleType);
                                List<String> memTypes = structDecl.getMemberTypes(simpleType);
-                               if (isArrayOrList(param, paramType)) {  // An array or list
+                               if (isArrayOrList(paramType, param)) {  // An array or list
                                        println("for(int i = 0; i < " + counter + "; i++) {");
                                }
                                if (isArray(param)) {   // An array
@@ -1622,7 +1627,7 @@ public class IoTCompiler {
                StructDecl structDecl = getStructDecl(simpleType);
                List<String> memTypes = structDecl.getMemberTypes(simpleType);
                List<String> members = structDecl.getMembers(simpleType);
-               if (isArrayOrList(retType, retType)) {  // An array or list
+               if (isArray(retType)) { // An array or list
                        println("for(int i = 0; i < retLen; i++) {");
                        for (int i = 0; i < members.size(); i++) {
                                String prmType = checkAndGetArray(memTypes.get(i), members.get(i));
@@ -1632,6 +1637,16 @@ public class IoTCompiler {
                                println(";");
                        }
                        println("}");
+               } else if (isList(retType)) {   // An array or list
+                       println("for(int i = 0; i < retLen; i++) {");
+                       for (int i = 0; i < members.size(); i++) {
+                               String prmType = checkAndGetArray(memTypes.get(i), members.get(i));
+                               println("retCls[retPos] = " + getSimpleType(getEnumType(prmType)) + ".class;");
+                               print("retObj[retPos++] = retStruct.get(i).");
+                               print(getEnumParam(memTypes.get(i), getSimpleIdentifier(members.get(i)), i));
+                               println(";");
+                       }
+                       println("}");
                } else {        // Just one struct element
                        for (int i = 0; i < members.size(); i++) {
                                String prmType = checkAndGetArray(memTypes.get(i), members.get(i));
@@ -1821,7 +1836,7 @@ public class IoTCompiler {
                                for (int i = 0; i < methParams.size(); i++) { // Print size variables
                                        String paramType = methPrmTypes.get(i);
                                        String param = methParams.get(i);
-                                       String simpleType = getSimpleType(paramType);
+                                       String simpleType = getGenericType(paramType);
                                        if (isStructClass(simpleType)) {
                                                if (!begin) {   // Generate comma for not the beginning variable
                                                        print(", "); begin = false;
@@ -1876,7 +1891,7 @@ public class IoTCompiler {
                        for (int i = 0; i < methParams.size(); i++) {
                                String paramType = methPrmTypes.get(i);
                                String param = methParams.get(i);
-                               String simpleType = getSimpleType(paramType);
+                               String simpleType = getGenericType(paramType);
                                if (isStructClass(simpleType)) {
                                        int methodNumId = intDecl.getMethodNumId(method);
                                        print("public int ___");
@@ -1907,7 +1922,7 @@ public class IoTCompiler {
                        for (int i = 0; i < methParams.size(); i++) {
                                String paramType = methPrmTypes.get(i);
                                String param = methParams.get(i);
-                               String simpleType = getSimpleType(paramType);
+                               String simpleType = getGenericType(paramType);
                                if (isStructClass(simpleType)) {
                                        int methodNumId = intDecl.getMethodNumId(method);
                                        print("public int ___");
@@ -1937,7 +1952,7 @@ public class IoTCompiler {
                        for (int i = 0; i < methParams.size(); i++) {
                                String paramType = methPrmTypes.get(i);
                                String param = methParams.get(i);
-                               String simpleType = getSimpleType(paramType);
+                               String simpleType = getGenericType(paramType);
                                if (isStructClass(simpleType)) {
                                        int methodNumId = intDecl.getMethodNumId(method);
                                        println("int struct" + methodNumId + "Size" + i + " = 0;");
@@ -1959,7 +1974,7 @@ public class IoTCompiler {
                for (int i = 0; i < methParams.size(); i++) {
                        String paramType = methPrmTypes.get(i);
                        String param = methParams.get(i);
-                       String simpleType = getSimpleType(paramType);
+                       String simpleType = getGenericType(paramType);
                        boolean begin = true;
                        if (isStructClass(simpleType)) {
                                structExist = true;
@@ -1988,7 +2003,7 @@ public class IoTCompiler {
                        for (int i = 0; i < methParams.size(); i++) {
                                String paramType = methPrmTypes.get(i);
                                String param = methParams.get(i);
-                               String simpleType = getSimpleType(paramType);
+                               String simpleType = getGenericType(paramType);
                                if (isStructClass(simpleType)) {
                                        int methodNumId = intDecl.getMethodNumId(method);
                                        print("case ");
@@ -2017,7 +2032,7 @@ public class IoTCompiler {
                        for (int i = 0; i < methParams.size(); i++) {
                                String paramType = methPrmTypes.get(i);
                                String param = methParams.get(i);
-                               String simpleType = getSimpleType(paramType);
+                               String simpleType = getGenericType(paramType);
                                if (isStructClass(simpleType)) {
                                        int methodNumId = intDecl.getMethodNumId(method);
                                        print("case ");
@@ -2197,7 +2212,7 @@ public class IoTCompiler {
                                for (int i = 0; i < methParams.size(); i++) { // Print size variables
                                        String paramType = methPrmTypes.get(i);
                                        String param = methParams.get(i);
-                                       String simpleType = getSimpleType(paramType);
+                                       String simpleType = getGenericType(paramType);
                                        if (isStructClass(simpleType)) {
                                                if (!begin) {   // Generate comma for not the beginning variable
                                                        print(", "); begin = false;
@@ -2738,7 +2753,7 @@ public class IoTCompiler {
                for (int i = 0; i < methParams.size(); i++) {
                        String paramType = methPrmTypes.get(i);
                        String param = methParams.get(i);
-                       String simpleType = getSimpleType(paramType);
+                       String simpleType = getGenericType(paramType);
                        if (isStructClass(simpleType)) {
                        // Check if this is enum type
                                println("int numParam" + i + " = 1;");
@@ -2748,7 +2763,7 @@ public class IoTCompiler {
                                println("string retTypeStruct" + i + " = \"void\";");
                                println("string paramClsStruct" + i + "[] = { \"int\" };");
                                print("int structLen" + i + " = ");
-                               if (isArrayOrList(param, paramType)) {  // An array
+                               if (isArrayOrList(paramType, param)) {  // An array
                                        println(getSimpleArrayType(param) + ".size();");
                                } else {        // Just one element
                                        println("1;");
@@ -2775,8 +2790,8 @@ public class IoTCompiler {
                        String simpleType = getGenericType(paramType);
                        if (isStructClass(simpleType)) {
                                int members = getNumOfMembers(simpleType);
-                               if (isArrayOrList(param, paramType)) {                  // An array
-                                       String structLen = param + ".size()";
+                               if (isArrayOrList(paramType, param)) {  // An array or list
+                                       String structLen = getSimpleIdentifier(param) + ".size()";
                                        print(members + "*" + structLen);
                                } else
                                        print(Integer.toString(members));
@@ -2798,14 +2813,14 @@ public class IoTCompiler {
                StructDecl structDecl = getStructDecl(simpleType);
                List<String> memTypes = structDecl.getMemberTypes(simpleType);
                List<String> members = structDecl.getMembers(simpleType);
-               if (isArrayOrList(param, paramType)) {  // An array or list
-                       println("for(int i = 0; i < " + param + ".size(); i++) {");
+               if (isArrayOrList(paramType, param)) {  // An array or list
+                       println("for(int i = 0; i < " + getSimpleIdentifier(param) + ".size(); i++) {");
                }
-               if (isArrayOrList(param, paramType)) {  // An array or list
+               if (isArrayOrList(paramType, param)) {  // An array or list
                        for (int i = 0; i < members.size(); i++) {
                                String prmTypeC = checkAndGetCplusArgClsType(memTypes.get(i), members.get(i));
                                println("paramCls[pos] = \"" + prmTypeC + "\";");
-                               print("paramObj[pos++] = &" + param + "[i].");
+                               print("paramObj[pos++] = &" + getSimpleIdentifier(param) + "[i].");
                                print(getSimpleIdentifier(members.get(i)));
                                println(";");
                        }
@@ -3403,7 +3418,7 @@ public class IoTCompiler {
                        for (int i = 0; i < methParams.size(); i++) {
                                String paramType = methPrmTypes.get(i);
                                String param = methParams.get(i);
-                               String simpleType = getSimpleType(paramType);
+                               String simpleType = getGenericType(paramType);
                                if (isStructClass(simpleType)) {
                                        int methodNumId = intDecl.getMethodNumId(method);
                                        String helperMethod = methodNumId + "struct" + i;
@@ -3796,11 +3811,9 @@ public class IoTCompiler {
                List<String> members = structDecl.getMembers(simpleType);
                int methodNumId = intDecl.getMethodNumId(method);
                String counter = "struct" + methodNumId + "Size" + iVar;
-               if (isArrayOrList(param, paramType)) {  // An array or list
-                       println("for(int i = 0; i < " + counter + "; i++) {");
-               }
+               println("int pos = 0;");
                // Set up variables
-               if (isArrayOrList(param, paramType)) {  // An array or list
+               if (isArrayOrList(paramType, param)) {  // An array or list
                        for (int i = 0; i < members.size(); i++) {
                                String prmTypeC = checkAndGetCplusType(memTypes.get(i));
                                String prmType = checkAndGetCplusArrayType(prmTypeC, members.get(i));
@@ -3813,9 +3826,10 @@ public class IoTCompiler {
                                println(getSimpleType(getEnumType(prmType)) + " param" + i + ";");
                        }
                }
-               println("int pos = 0;");
-               if (isArrayOrList(param, paramType)) {  // An array or list
-                       println("for(int i = 0; i < retLen; i++) {");
+               if (isArrayOrList(paramType, param)) {  // An array or list
+                       println("for(int i = 0; i < " + counter + "; i++) {");
+               }
+               if (isArrayOrList(paramType, param)) {  // An array or list
                        for (int i = 0; i < members.size(); i++) {
                                String prmTypeC = checkAndGetCplusArgClsType(memTypes.get(i), members.get(i));
                                println("paramCls[pos] = \"" + prmTypeC + "\";");
@@ -3846,15 +3860,15 @@ public class IoTCompiler {
                                int methodNumId = intDecl.getMethodNumId(method);
                                String counter = "struct" + methodNumId + "Size" + i;
                                // Declaration
-                               if (isArrayOrList(param, paramType)) {  // An array or list
-                                       println("vector<" + simpleType + "> paramStruct" + i + ";");
+                               if (isArrayOrList(paramType, param)) {  // An array or list
+                                       println("vector<" + simpleType + "> paramStruct" + i + "(" + counter + ");");
                                } else
                                        println(simpleType + " paramStruct" + i + ";");
                                // Initialize members
                                StructDecl structDecl = getStructDecl(simpleType);
                                List<String> members = structDecl.getMembers(simpleType);
                                List<String> memTypes = structDecl.getMemberTypes(simpleType);
-                               if (isArrayOrList(param, paramType)) {  // An array or list
+                               if (isArrayOrList(paramType, param)) {  // An array or list
                                        println("for(int i = 0; i < " + counter + "; i++) {");
                                        for (int j = 0; j < members.size(); j++) {
                                                print("paramStruct" + i + "[i]." + getSimpleIdentifier(members.get(j)));
@@ -3993,7 +4007,7 @@ public class IoTCompiler {
                                for (int i = 0; i < methParams.size(); i++) { // Print size variables
                                        String paramType = methPrmTypes.get(i);
                                        String param = methParams.get(i);
-                                       String simpleType = getSimpleType(paramType);
+                                       String simpleType = getGenericType(paramType);
                                        if (isStructClass(simpleType)) {
                                                if (!begin) {   // Generate comma for not the beginning variable
                                                        print(", "); begin = false;
@@ -4041,7 +4055,7 @@ public class IoTCompiler {
                        for (int i = 0; i < methParams.size(); i++) {
                                String paramType = methPrmTypes.get(i);
                                String param = methParams.get(i);
-                               String simpleType = getSimpleType(paramType);
+                               String simpleType = getGenericType(paramType);
                                if (isStructClass(simpleType)) {
                                        int methodNumId = intDecl.getMethodNumId(method);
                                        print("int ___");
@@ -4076,7 +4090,7 @@ public class IoTCompiler {
                        for (int i = 0; i < methParams.size(); i++) {
                                String paramType = methPrmTypes.get(i);
                                String param = methParams.get(i);
-                               String simpleType = getSimpleType(paramType);
+                               String simpleType = getGenericType(paramType);
                                if (isStructClass(simpleType)) {
                                        int methodNumId = intDecl.getMethodNumId(method);
                                        print("int ___");
@@ -4308,7 +4322,7 @@ public class IoTCompiler {
                                for (int i = 0; i < methParams.size(); i++) { // Print size variables
                                        String paramType = methPrmTypes.get(i);
                                        String param = methParams.get(i);
-                                       String simpleType = getSimpleType(paramType);
+                                       String simpleType = getGenericType(paramType);
                                        if (isStructClass(simpleType)) {
                                                if (!begin) {   // Generate comma for not the beginning variable
                                                        print(", "); begin = false;
index 1892ca068b8c464cfe3b4dadd3bb4de1fdb2bdd2..58a6d2a176cb8fa303090689d06cb4fba227fccc 100644 (file)
@@ -50,6 +50,8 @@ class TestClass : public TestClassInterface {
 
                // Struct
                Struct                          handleStruct(Struct str);
+               vector<Struct>          handleStructArray(vector<Struct> vecStr);
+               vector<Struct>          handleStructList(vector<Struct> vecStr);
 
                int                                     getA();
                void                            setA(int _int);
@@ -310,7 +312,7 @@ Struct TestClass::handleStruct(Struct str) {
 }
 
 
-/*vector<Struct> TestClass::handleStruct(vector<Struct> vecStr) {
+vector<Struct> TestClass::handleStructArray(vector<Struct> vecStr) {
 
        for (Struct str : vecStr) {
 
@@ -325,7 +327,25 @@ Struct TestClass::handleStruct(Struct str) {
        vecStr.push_back(test);
 
        return vecStr;
-}*/
+}
+
+
+vector<Struct> TestClass::handleStructList(vector<Struct> vecStr) {
+
+       for (Struct str : vecStr) {
+
+               cout << "Name: " << str.name << endl;
+               cout << "Value: " << str.value << endl;
+               cout << "Year: " << str.year << endl;
+       }
+       Struct test;
+       test.name = "Trimananda";
+       test.value = 1.33;
+       test.year = 2016;
+       vecStr.push_back(test);
+
+       return vecStr;
+}
 
 
 string TestClass::sumArray(vector<string> newA) {
index c65cd640fe2fb7d23fb5fa531338e6cf13703798..96011d19f6f3e3b07fa156a28f5567e19642e15c 100644 (file)
@@ -109,6 +109,25 @@ int main(int argc, char *argv[])
        cout << "Name: " << resStr.name << endl;
        cout << "Value:" << resStr.value << endl;
        cout << "Year" << resStr.year << endl;
+       Struct str2;
+       str2.name = "Trimananda";
+       str2.value = 0.124;
+       str2.year = 2017;
+       vector<Struct> vecStr;
+       vecStr.push_back(str);
+       vecStr.push_back(str2);
+       vector<Struct> vecRetStr = tcStub->handleStructArray(vecStr);
+       for (Struct st : vecRetStr) {
+               cout << "Name: " << st.name << endl;
+               cout << "Value:" << st.value << endl;
+               cout << "Year" << st.year << endl;
+       }
+       vector<Struct> vecRetStr2 = tcStub->handleStructList(vecStr);
+       for (Struct st : vecRetStr2) {
+               cout << "Name: " << st.name << endl;
+               cout << "Value:" << st.value << endl;
+               cout << "Year" << st.year << endl;
+       }
 
        cout << "==== OTHERS ====" << endl;
        cout << "Return value: " << tcStub->getA() << endl;
index 8844ffbaa12edd8c8e3805bc59a5bebb2b5eb50f..a5c0c1136741b7388af085066173cca6acb61ef7 100644 (file)
@@ -261,12 +261,12 @@ public class TestClass implements TestClassInterface {
        }
 
 
-       /*public Struct[] handleStruct(Struct[] data) {
+       public Struct[] handleStructArray(Struct str[]) {
 
-               for (Struct str : data) {
-                       System.out.println("Name: " + str.name);
-                       System.out.println("Value: " + str.value);
-                       System.out.println("Year: " + str.year);
+               for (Struct st : str) {
+                       System.out.println("Name: " + st.name);
+                       System.out.println("Value: " + st.value);
+                       System.out.println("Year: " + st.year);
                }
 
                Struct test = new Struct();
@@ -274,10 +274,29 @@ public class TestClass implements TestClassInterface {
                test.value = 1.33f;
                test.year = 2016;
 
-               data[0] = test;
+               str[0] = test;
 
-               return data;
-       }*/
+               return str;
+       }
+
+
+       public List<Struct> handleStructList(List<Struct> str) {
+
+               for (Struct st : str) {
+                       System.out.println("Name: " + st.name);
+                       System.out.println("Value: " + st.value);
+                       System.out.println("Year: " + st.year);
+               }
+
+               Struct test = new Struct();
+               test.name = "Tests";
+               test.value = 1.34f;
+               test.year = 2017;
+
+               str.add(test);
+
+               return str;
+       }
 
 
        // Getters
index 6f999926d39d2ba07da7f535ceb8069097ef2862..01daf3075d08ec97f27c2835945a43affcba7bb2 100644 (file)
@@ -80,6 +80,24 @@ public class TestClass_Stub {
                System.out.println("Name: " + strRes.name);
                System.out.println("Value: " + strRes.value);
                System.out.println("Year: " + strRes.year);
+               Struct str2 = new Struct();
+               str2.name = "Trimananda";
+               str2.value = 0.124f;
+               str2.year = 2017;
+               Struct[] arrStr = { str, str2 };
+               Struct[] arrRet = tcstub.handleStructArray(arrStr);
+               for(Struct st : arrRet) {
+                       System.out.println("Name: " + st.name);
+                       System.out.println("Value: " + st.value);
+                       System.out.println("Year: " + st.year);
+               }
+               List<Struct> stList = new ArrayList(Arrays.asList(arrStr));
+               List<Struct> stRetList = tcstub.handleStructList(stList);
+               for(Struct st : stRetList) {
+                       System.out.println("Name: " + st.name);
+                       System.out.println("Value: " + st.value);
+                       System.out.println("Year: " + st.year);
+               }
 
                System.out.println("==== OTHERS ====");
                System.out.println("Return value: " + tcstub.getA());