Examples of EchoMessage


Examples of org.apache.tajo.rpc.test.TestProtos.EchoMessage

  public void testUnresolvedAddress() throws Exception {
    String hostAndPort = NetUtils.normalizeInetSocketAddress(server.getListenAddress());
    BlockingRpcClient client = new BlockingRpcClient(DummyProtocol.class, NetUtils.createUnresolved(hostAndPort));
    BlockingInterface stub = client.getStub();

    EchoMessage message = EchoMessage.newBuilder()
        .setMessage(MESSAGE).build();
    EchoMessage response2 = stub.echo(null, message);
    assertEquals(MESSAGE, response2.getMessage());
    client.close();
  }
View Full Code Here

Examples of org.apache.tajo.rpc.test.TestProtos.EchoMessage

        assertTrue(8.15d == sum);
      }
    });


    EchoMessage echoMessage = EchoMessage.newBuilder()
        .setMessage(MESSAGE).build();
    RpcCallback<EchoMessage> callback = new RpcCallback<EchoMessage>() {
      @Override
      public void run(EchoMessage parameter) {
        echo = parameter.getMessage();
View Full Code Here

Examples of org.apache.tajo.rpc.test.TestProtos.EchoMessage

    assertTrue(service.getNullCalled);
  }

  @Test
  public void testCallFuture() throws Exception {
    EchoMessage echoMessage = EchoMessage.newBuilder()
        .setMessage(MESSAGE).build();
    CallFuture<EchoMessage> future = new CallFuture<EchoMessage>();
    stub.deley(null, echoMessage, future);

    assertFalse(future.isDone());
View Full Code Here

Examples of org.apache.tajo.rpc.test.TestProtos.EchoMessage

    assertTrue(future.isDone());
  }

  @Test(expected = TimeoutException.class)
  public void testCallFutureTimeout() throws Exception {
    EchoMessage echoMessage = EchoMessage.newBuilder()
        .setMessage(MESSAGE).build();
    CallFuture<EchoMessage> future = new CallFuture<EchoMessage>();
    stub.deley(null, echoMessage, future);

    assertFalse(future.isDone());
View Full Code Here

Examples of org.apache.tajo.rpc.test.TestProtos.EchoMessage

    assertEquals(future.get(1, TimeUnit.SECONDS), echoMessage);
  }

  @Test
  public void testCallFutureDisconnected() throws Exception {
    EchoMessage echoMessage = EchoMessage.newBuilder()
        .setMessage(MESSAGE).build();
    CallFuture<EchoMessage> future = new CallFuture<EchoMessage>();

    server.shutdown();
    server = null;

    stub.echo(future.getController(), echoMessage, future);
    EchoMessage response = future.get();

    assertNull(response);
    assertTrue(future.getController().failed());
    assertTrue(future.getController().errorText() != null);
  }
View Full Code Here

Examples of org.apache.tajo.rpc.test.TestProtos.EchoMessage

  @Test
  public void testUnresolvedAddress() throws Exception {
    String hostAndPort = NetUtils.normalizeInetSocketAddress(server.getListenAddress());
    AsyncRpcClient client = new AsyncRpcClient(DummyProtocol.class, NetUtils.createUnresolved(hostAndPort));
    Interface stub = client.getStub();
    EchoMessage echoMessage = EchoMessage.newBuilder()
        .setMessage(MESSAGE).build();
    CallFuture<EchoMessage> future = new CallFuture<EchoMessage>();
    stub.deley(null, echoMessage, future);

    assertFalse(future.isDone());
View Full Code Here

Examples of org.jacorb.test.listenendpoints.echo_corbaloc.EchoMessage

    }

    @Test
    public void test_ping()
    {
        EchoMessage server = null;
        try
        {
            String ior = setup.getServerIOR();
            assertTrue("test_ping: couldn't pickup server IOR", ior != null && ior.length() > 0);

            int slash = ior.trim().indexOf("/");
            String corbalocObjId = ior.trim().substring(slash);
            assertTrue("test_ping: corbaloc objectID is null", corbalocObjId != null);
            assertTrue("test_ping: corbaloc objID is malformed", corbalocObjId.equals("/EchoServer/EchoPOAP/EchoID") );

            server =
                    EchoMessageHelper.narrow (setup.getServerObject());

            server.ping();

        }
        catch (Exception e)
        {
            fail("test_ping: got an unexpected exception: <" + e.getMessage() + ">");
View Full Code Here

Examples of org.jacorb.test.listenendpoints.echo_corbaloc.EchoMessage

    }

    @Test
    public void test_echo_simple()
    {
        EchoMessage server = null;
        try
        {
            server =
                    EchoMessageHelper.narrow (setup.getServerObject());
            String result = server.echo_simple();
            TestUtils.getLogger().debug("AlternateEndpointTest: " + "test_echo_simple: got resp from server: <" + result + ">");
            assertTrue("test_echo_simple: result is null", result != null);
            assertTrue("test_echo_simple: unexpected result <" + result + ">",
                    result.startsWith("Simple greeting from"));
        }
View Full Code Here

Examples of org.jacorb.test.listenendpoints.echo_corbaloc.EchoMessage

    }

    @Test
    public void test_echo_string()
    {
        EchoMessage server = null;
        try
        {
            String ior = setup.getServerIOR();
            assertTrue("test_ping: couldn't pickup server IOR", ior != null && ior.length() > 0);

            int slash = ior.trim().indexOf("/");
            String corbalocObjId = ior.trim().substring(slash);
            assertTrue("test_ping: corbaloc objectID is null", corbalocObjId != null);
            assertTrue("test_ping: corbaloc objID is malformed", corbalocObjId.equals("/EchoServer/EchoPOAP/EchoID") );

            server =
                    EchoMessageHelper.narrow (setup.getServerObject());

            String outMsg = new String(Integer.toString(1)
                    + "test_echo_string is hailing server with IOR <" + ior + ">");
            long tms_out = System.currentTimeMillis();
            String inMsg = server.echo_string(outMsg);
            long tms_in = System.currentTimeMillis();
            long tms_dif = tms_in - tms_out;
            if (outMsg.equals(inMsg))
            {
                assertTrue("OK: " + tms_dif + "mSec <" + inMsg + ">", true);
View Full Code Here

Examples of org.jacorb.test.listenendpoints.echo_corbaloc.EchoMessage

    }

    @Test
    public void test_echo_wide()
    {
        EchoMessage server = null;
        try
        {
            String ior = setup.getServerIOR();
            assertTrue("test_ping: couldn't pickup server IOR", ior != null && ior.length() > 0);

            int slash = ior.trim().indexOf("/");
            String corbalocObjId = ior.trim().substring(slash);
            assertTrue("test_ping: corbaloc objectID is null", corbalocObjId != null);
            assertTrue("test_ping: corbaloc objID is malformed", corbalocObjId.equals("/EchoServer/EchoPOAP/EchoID") );

            server =
                    EchoMessageHelper.narrow (setup.getServerObject());

            String outMsg = new String(Integer.toString(1) + "test_echo_wide is hailing server with IOR <" + ior + ">");
            long tms_out = System.currentTimeMillis();
            String inMsg = server.echo_string(outMsg);
            long tms_in = System.currentTimeMillis();
            long tms_dif = tms_in - tms_out;
            if (outMsg.equals(inMsg))
            {
                assertTrue("OK: " + tms_dif + "mSec <" + inMsg + ">", true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.