1 import java.util.Arrays;
2 import iotruntime.master.CommunicationHandler;
4 public class TestClass_Stub {
6 public static void main(String[] args) throws Exception {
8 CommunicationHandler comHan = new CommunicationHandler(true);
10 int[] ports = comHan.getCallbackPorts(numOfPorts);
13 String address = "localhost";
14 //String address = "128.195.136.170"; // dc-9.calit2.uci.edu
17 System.out.println("Allocated ports: " + Arrays.toString(ports));
19 TestClassComplete_Stub tcstub = new TestClassComplete_Stub(port, address, rev, ports);
20 System.out.println("==== SINGLE ====");
21 System.out.println("Return value: " + tcstub.getByte((byte)68));
22 System.out.println("Return value: " + tcstub.getShort((short)1234));
23 System.out.println("Return value: " + tcstub.getLong(12345678l));
24 System.out.println("Return value: " + tcstub.getFloat(12.345f));
25 System.out.println("Return value: " + tcstub.getDouble(12345.678));
26 System.out.println("Return value: " + tcstub.getBoolean(true));
27 System.out.println("Return value: " + tcstub.getChar('c'));
29 System.out.println("==== ARRAY ====");
30 byte[] in1 = { 68, 69 };
31 System.out.println("Return value: " + Arrays.toString(tcstub.getByteArray(in1)));
32 short[] in2 = { (short)1234, (short)1235 };
33 System.out.println("Return value: " + Arrays.toString(tcstub.getShortArray(in2)));
34 long[] in3 = { 12345678l, 12356782l };
35 System.out.println("Return value: " + Arrays.toString(tcstub.getLongArray(in3)));
36 float[] in4 = { 12.345f, 12.346f };
37 System.out.println("Return value: " + Arrays.toString(tcstub.getFloatArray(in4)));
38 double[] in5 = { 12345.678, 12345.543 };
39 System.out.println("Return value: " + Arrays.toString(tcstub.getDoubleArray(in5)));
40 boolean[] in6 = { true, false };
41 System.out.println("Return value: " + Arrays.toString(tcstub.getBooleanArray(in6)));
42 char[] in7 = { 'c', 'e' };
43 System.out.println("Return value: " + Arrays.toString(tcstub.getCharArray(in7)));
45 System.out.println("==== OTHERS ====");
46 System.out.println("Return value: " + tcstub.getA());
47 System.out.println("Return value: " + tcstub.setAndGetA(123));
48 System.out.println("Return value: " + tcstub.setACAndGetA("string", 123));
49 System.out.println("Return value: " + tcstub.sumArray(new String[] { "123", "456", "987" }));