Search in sources :

Example 1 with BooleanMessage

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);
}
Also used : BooleanMessage(org.goldenorb.types.message.BooleanMessage) BooleanWritable(org.apache.hadoop.io.BooleanWritable) Test(org.junit.Test)

Example 2 with BooleanMessage

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);
}
Also used : BooleanMessage(org.goldenorb.types.message.BooleanMessage) Configuration(org.apache.hadoop.conf.Configuration) BooleanWritable(org.apache.hadoop.io.BooleanWritable) InetSocketAddress(java.net.InetSocketAddress) Before(org.junit.Before)

Aggregations

BooleanWritable (org.apache.hadoop.io.BooleanWritable)2 BooleanMessage (org.goldenorb.types.message.BooleanMessage)2 InetSocketAddress (java.net.InetSocketAddress)1 Configuration (org.apache.hadoop.conf.Configuration)1 Before (org.junit.Before)1 Test (org.junit.Test)1