Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpSelf.connect()


  @Test(timeout = 4000)
  public void testServiceTimeouts() throws Exception {
    OtpSelf self = new OtpSelf("tmp_connector_"
        + System.currentTimeMillis());
    OtpPeer peer = new OtpPeer("RPCServerTimeout");
    OtpConnection connection = self.connect(peer);
    // delay message sending after connecting
    Thread.sleep(1000);
    // service binding timeout set to 500 so after that time it will give up
    // and close connection
    try {
View Full Code Here


      fail("Exception expected");
    } catch (Exception e) {
      assertEquals(IOException.class, e.getClass());
    }

    connection = self.connect(peer);
    // sending message immediately and encountering no connection close
    connection.send("rex", new OtpErlangString("test"));

  }
View Full Code Here

      self = new OtpSelf(getClientNodeName());
      if (binding.hasCookie()) {
        self.setCookie(binding.getCookie());
      }
      other = new OtpPeer(binding.getNode());
      connection = self.connect(other);
      Method jmethod = ((JavaOperation) msg.getOperation())
          .getJavaMethod();
      OtpErlangList params = TypeHelpersProxy.toErlangAsList(msg
          .getBody(), jmethod.getParameterAnnotations());
      OtpErlangTuple message = MessageHelper.rpcMessage(self.pid(), self
View Full Code Here

  @Test(timeout = 4000)
  public void testServiceTimeouts() throws Exception {
    OtpSelf self = new OtpSelf("tmp_connector_"
        + System.currentTimeMillis());
    OtpPeer peer = new OtpPeer("RPCServerTimeout");
    OtpConnection connection = self.connect(peer);
    // delay message sending after connecting
    Thread.sleep(1000);
    // service binding timeout set to 500 so after that time it will give up
    // and close connection
    try {
View Full Code Here

      fail("Exception expected");
    } catch (Exception e) {
      assertEquals(IOException.class, e.getClass());
    }

    connection = self.connect(peer);
    // sending message immediately and encountering no connection close
    connection.send("rex", new OtpErlangString("test"));

  }
View Full Code Here

    OtpSelf self = new OtpSelf("rabbit-monitor");

    String hostName = NODE_NAME;
    OtpPeer peer = new OtpPeer(hostName);
    connection = self.connect(peer);

    OtpErlangObject[] objectArray = { new OtpErlangBinary("/".getBytes()) };

    connection.sendRPC("rabbit_amqqueue", "info_all", new OtpErlangList(objectArray));
View Full Code Here

  }

  public OtpConnection createConnection() throws Exception {
    OtpSelf self = new OtpSelf("rabbit-monitor-" + counter++);
    OtpPeer peer = new OtpPeer(NODE_NAME);
    return self.connect(peer);
  }

  private void executeRpc(OtpConnection con, boolean recycleConnection, String module, String function)
      throws Exception, UnknownHostException {
    con.sendRPC(module, function, new OtpErlangList());
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.