use of org.apache.hyracks.ipc.api.RPCInterface in project asterixdb by apache.
the class IPCTest method test.
@Test
public void test() throws Exception {
IPCSystem server = createServerIPCSystem();
server.start();
InetSocketAddress serverAddr = server.getSocketAddress();
RPCInterface rpci = new RPCInterface();
IPCSystem client = createClientIPCSystem(rpci);
client.start();
IIPCHandle handle = client.getHandle(serverAddr);
for (int i = 0; i < 100; ++i) {
Assert.assertEquals(rpci.call(handle, Integer.valueOf(i)), Integer.valueOf(2 * i));
}
try {
rpci.call(handle, "Foo");
Assert.assertTrue(false);
} catch (Exception e) {
Assert.assertTrue(true);
}
}
Aggregations