use of org.goldenorb.types.message.BooleanMessage in project goldenorb by jzachr.
the class SampleBooleanMessageTest method testRPC.
@Test
public void testRPC() {
BooleanMessage bm1 = client.sendAndReceiveMessage(bm0, DESTINATION_VALUE, new BooleanWritable(MESSAGE_VALUE));
assertEquals(bm0.get(), client.getMessage().get());
assertEquals(bm0.getDestinationVertex(), client.getMessage().getDestinationVertex());
assertEquals(bm1.getDestinationVertex(), DESTINATION_VALUE);
assertEquals(((BooleanWritable) bm1.getMessageValue()).get(), MESSAGE_VALUE);
}
use of org.goldenorb.types.message.BooleanMessage in project goldenorb by jzachr.
the class SampleBooleanMessageTest method startServer.
/**
*
*/
@SuppressWarnings("unchecked")
@Before
public void startServer() throws IOException {
server = new RPCServer<BooleanMessage, BooleanWritable>(SERVER_PORT);
server.start();
Configuration conf = new Configuration();
InetSocketAddress addr = new InetSocketAddress("localhost", SERVER_PORT);
if (client == null)
client = (RPCProtocol<BooleanMessage, BooleanWritable>) RPC.waitForProxy(RPCProtocol.class, RPCProtocol.versionID, addr, conf);
}
Aggregations