Package org.jboss.narayana.blacktie.jatmibroker.xatmi

Examples of org.jboss.narayana.blacktie.jatmibroker.xatmi.X_OCTET


  }

  public void test3() throws ConnectionException, JABException {
    log.info("TxBlacktieServiceTestCase::test3");
    byte[] args = "test=test3,tx=false".getBytes();
    X_OCTET buffer = (X_OCTET) connection.tpalloc("X_OCTET", null,
        args.length);
    buffer.setByteArray(args);

    Response response = connection.tpcall("TxEchoService", buffer, 0);
    String responseData = new String(
        ((X_OCTET) response.getBuffer()).getByteArray());
    assertEquals("test=test3,tx=false", responseData);
View Full Code Here


  }

  public void test4() throws ConnectionException, JABException {
    log.info("TxBlacktieServiceTestCase::test4");
    byte[] args = "test=test4,tx=false".getBytes();
    X_OCTET buffer = (X_OCTET) connection.tpalloc("X_OCTET", null,
        args.length);
    buffer.setByteArray(args);

    JABTransaction transaction = startTx();
    Response response = connection.tpcall("TxEchoService", buffer, 0);
    String responseData = new String(
        ((X_OCTET) response.getBuffer()).getByteArray());
View Full Code Here

   * blacktie service.
   */
  public void test5() throws ConnectionException, JABException {
    log.info("TxBlacktieServiceTestCase::test5");
    byte[] args = "test=test5,tx=create".getBytes();
    X_OCTET buffer = (X_OCTET) connection.tpalloc("X_OCTET", null,
        args.length);
    buffer.setByteArray(args);

    Response response = connection.tpcall("TxEchoService", buffer, 0);
    String responseData = new String(
        ((X_OCTET) response.getBuffer()).getByteArray());
    assertEquals("test=test5,tx=create", responseData);
View Full Code Here

  public void test_tpacall() throws ConnectionException {
    server.tpadvertiseTestTPACall();
    log.info("test_tpacall");
    byte[] toSend = "test_tpacall".getBytes();
    int sendlen = toSend.length;
    X_OCTET sendbuf = (X_OCTET) connection
        .tpalloc("X_OCTET", null, sendlen);
    sendbuf.setByteArray(toSend);

    int cd = connection.tpacall(RunServer.getServiceNameTestTPACall(),
        sendbuf, Connection.TPNOREPLY);
    assertTrue(cd == 0);
View Full Code Here

  }

  private void processStompCommand(String command, int expectation)
      throws ConnectionException {
    byte[] toSend = command.getBytes();
    X_OCTET buffer = (X_OCTET) connection.tpalloc("X_OCTET", null,
        toSend.length);
    buffer.setByteArray(toSend);

    Response response = connection.tpcall("BTStompAdmin", buffer, 0);

    byte[] responseData = ((X_OCTET) response.getBuffer()).getByteArray();
    assertEquals(expectation, responseData[0]);
View Full Code Here

  }

  private void processDomainCommand(String command, int expectation)
      throws ConnectionException {
    byte[] toSend = command.getBytes();
    X_OCTET buffer = (X_OCTET) connection.tpalloc("X_OCTET", null,
        toSend.length);
    buffer.setByteArray(toSend);

    Response response = connection.tpcall("BTDomainAdmin", buffer, 0);

    byte[] responseData = ((X_OCTET) response.getBuffer()).getByteArray();
    assertEquals(expectation, responseData[0]);
View Full Code Here

      // ok = true;
      // }
    }

    int len = 60;
    X_OCTET toReturn;
    toReturn = (X_OCTET) svcinfo.getConnection().tpalloc("X_OCTET", null,
        len);
    if (ok) {
      toReturn.setByteArray("tpcall_x_octet".getBytes());
    } else {
      StringBuffer buffer = new StringBuffer("fail");
      if (svcinfo.getBuffer() != null) {
        buffer.append(new String(((X_OCTET) svcinfo.getBuffer())
            .getByteArray()));
      } else {
        buffer.append("dud");
      }
      toReturn.setByteArray("fail".getBytes());
    }
    return new Response(Connection.TPSUCCESS, 20, toReturn, 0);
  }
View Full Code Here

    // Do local work
    server.tpadvertiseTestTPReturn();

    int sendlen = "tprnb".length() + 1;
    X_OCTET sendbuf = (X_OCTET) connection
        .tpalloc("X_OCTET", null, sendlen);
    sendbuf.setByteArray("tprnb".getBytes());

    try {
      connection.tpcall(RunServer.getServiceNameTestTPReturn(), sendbuf,
          0);
      fail("Managed to send call");
View Full Code Here

    // Do local work
    server.tpadvertiseTestTPReturn2();

    int sendlen = 3;
    X_OCTET sendbuf = (X_OCTET) connection
        .tpalloc("X_OCTET", null, sendlen);
    sendbuf.setByteArray("24".getBytes());
    Response success = connection.tpcall(
        RunServer.getServiceNameTestTPReturn2(), sendbuf, 0);
    assertTrue(success != null);
    assertTrue(success.getRcode() == 24);

    sendbuf.setByteArray("77".getBytes());
    success = connection.tpcall(RunServer.getServiceNameTestTPReturn2(),
        sendbuf, 0);
    assertTrue(success != null);
    assertTrue(success.getRcode() == 77);
  }
View Full Code Here

    server.tpadvertiseTestTPReturn3();
    server.tpadvertiseTestTPReturn4();

    int sendlen = 2;

    X_OCTET sendbuf = (X_OCTET) connection
        .tpalloc("X_OCTET", null, sendlen);
    sendbuf.setByteArray("X".getBytes());
    try {
      connection.tpcall(RunServer.getServiceNameTestTPReturn(), sendbuf,
          0);
      fail("Did not receive the expected exception");
    } catch (ConnectionException e) {
View Full Code Here

TOP

Related Classes of org.jboss.narayana.blacktie.jatmibroker.xatmi.X_OCTET

Copyright © 2018 www.massapicom. 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.