Search in sources :

Example 1 with DoubleMessage

use of org.goldenorb.types.message.DoubleMessage in project goldenorb by jzachr.

the class SampleDoubleMessageTest method testRPC.

@Test
public void testRPC() {
    DoubleMessage dm1 = client.sendAndReceiveMessage(dm0, DESTINATION_VALUE, new DoubleWritable(MESSAGE_VALUE));
    assertTrue(dm0.get() == client.getMessage().get());
    assertEquals(dm0.getDestinationVertex(), client.getMessage().getDestinationVertex());
    assertEquals(dm1.getDestinationVertex(), DESTINATION_VALUE);
    assertTrue(((DoubleWritable) dm1.getMessageValue()).get() == MESSAGE_VALUE);
}
Also used : DoubleMessage(org.goldenorb.types.message.DoubleMessage) DoubleWritable(org.apache.hadoop.io.DoubleWritable) Test(org.junit.Test)

Example 2 with DoubleMessage

use of org.goldenorb.types.message.DoubleMessage in project goldenorb by jzachr.

the class SampleDoubleMessageTest method startServer.

/**
 * 
 */
@SuppressWarnings("unchecked")
@Before
public void startServer() throws IOException {
    server = new RPCServer<DoubleMessage, DoubleWritable>(SERVER_PORT);
    server.start();
    Configuration conf = new Configuration();
    InetSocketAddress addr = new InetSocketAddress("localhost", SERVER_PORT);
    if (client == null)
        client = (RPCProtocol<DoubleMessage, DoubleWritable>) RPC.waitForProxy(RPCProtocol.class, RPCProtocol.versionID, addr, conf);
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) DoubleMessage(org.goldenorb.types.message.DoubleMessage) InetSocketAddress(java.net.InetSocketAddress) DoubleWritable(org.apache.hadoop.io.DoubleWritable) Before(org.junit.Before)

Aggregations

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