Testing callbacks for Java and C++; fixing a few bugs; more bugs to tackle: 1) Need...
[iot2.git] / iotjava / iotrmi / Java / basics / TestClass_Stub.java
index 01daf3075d08ec97f27c2835945a43affcba7bb2..d82c905a2f9d8a97b7badbeaf398e0daa8bcd845 100644 (file)
@@ -28,7 +28,7 @@ public class TestClass_Stub {
                System.out.println("Return value: " + tcstub.getBoolean(true));
                System.out.println("Return value: " + tcstub.getChar('c'));
 
-               System.out.println("==== ARRAY ====");
+/*             System.out.println("==== ARRAY ====");
                byte[] in1 = { 68, 69 };
                System.out.println("Return value: " + Arrays.toString(tcstub.getByteArray(in1)));
                short[] in2 = { (short)1234, (short)1235 };
@@ -98,6 +98,26 @@ public class TestClass_Stub {
                        System.out.println("Value: " + st.value);
                        System.out.println("Year: " + st.year);
                }
+*/
+               System.out.println("==== CALLBACKS ====");
+               CallBackInterface cbSingle = new CallBack(2354);
+               tcstub.registerCallback(cbSingle);
+               System.out.println("Return value from callback: " + tcstub.callBack());
+               //CallBackInterface cbSingle2 = new CallBack(2355);
+               //tcstub.registerCallback(cbSingle2);
+               //System.out.println("Return value from callback: " + tcstub.callBack());
+               /*CallBackInterface cb1 = new CallBack(23);
+               CallBackInterface cb2 = new CallBack(33);
+               CallBackInterface cb3 = new CallBack(43);
+               CallBackInterface[] cb = { cb1, cb2, cb3 };
+               tcstub.registerCallbackArray(cb);
+               System.out.println("Return value from callback: " + tcstub.callBack());*/
+               List<CallBackInterface> cblist = new ArrayList<CallBackInterface>();
+               CallBackInterface cb1 = new CallBack(23); cblist.add(cb1);
+               CallBackInterface cb2 = new CallBack(33); cblist.add(cb2);
+               CallBackInterface cb3 = new CallBack(43); cblist.add(cb3);
+               tcstub.registerCallbackList(cblist);
+               System.out.println("Return value from callback: " + tcstub.callBack());
 
                System.out.println("==== OTHERS ====");
                System.out.println("Return value: " + tcstub.getA());