Search in sources :

Example 1 with FloatMessage

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

the class SampleFloatMessageTest method testRPC.

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

Example 2 with FloatMessage

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

the class SampleFloatMessageTest method startServer.

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

Aggregations

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