Reverting type resolution in C++ to Java types, e.g. byte and char instead of just...
[iot2.git] / iotjava / iotrmi / Java / basics / TestClass_Stub.java
1 import java.util.Arrays;
2 import iotruntime.master.CommunicationHandler;
3
4 public class TestClass_Stub {
5
6         public static void main(String[] args) throws Exception {
7
8                 CommunicationHandler comHan = new CommunicationHandler(true);
9                 int numOfPorts = 1;
10                 int[] ports = comHan.getCallbackPorts(numOfPorts);
11
12                 int port = 5010;
13                 String address = "localhost";
14                 //String address = "128.195.136.170";   // dc-9.calit2.uci.edu
15                 int rev = 0;
16
17                 System.out.println("Allocated ports: " + Arrays.toString(ports));
18
19                 TestClassComplete_Stub tcstub = new TestClassComplete_Stub(port, address, rev, ports);
20                 System.out.println("Return value: " + tcstub.getByte((byte)68));
21                 System.out.println("Return value: " + tcstub.getShort((short)1234));
22                 System.out.println("Return value: " + tcstub.getLong(12345678l));
23                 System.out.println("Return value: " + tcstub.getFloat(12.345f));
24                 System.out.println("Return value: " + tcstub.getDouble(12345.678));
25                 System.out.println("Return value: " + tcstub.getBoolean(true));
26                 System.out.println("Return value: " + tcstub.getChar('c'));
27
28                 System.out.println("Return value: " + tcstub.getA());
29                 System.out.println("Return value: " + tcstub.setAndGetA(123));
30                 System.out.println("Return value: " + tcstub.setACAndGetA("string", 123));
31                 System.out.println("Return value: " + tcstub.sumArray(new String[] { "123", "456", "987" }));
32         }
33 }