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

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


      .getLogger(TPReturnTpurcodeService.class);

  public Response tpservice(TPSVCINFO svcinfo) throws ConnectionException {
    log.info("testtpreturn_service_tpurcode");
    int len = 1;
    Buffer toReturn = (X_OCTET) svcinfo.getConnection().tpalloc("X_OCTET",
        null, len);
    if (TestTPConversation.strcmp(svcinfo.getBuffer(), "24") == 0) {
      return new Response(Connection.TPSUCCESS, 24, toReturn, 0);
    } else {
      return new Response(Connection.TPSUCCESS, 77, toReturn, 0);
View Full Code Here


            svcinfo.getSession().tprecv(0);
            fail = true;
            break;
          } catch (ResponseException e) {
            if (e.getEvent() == Connection.TPEV_SENDONLY) {
              Buffer rcvbuf = e.getReceived();
              if (TestTPConversation.strcmp("yo" + i, rcvbuf) != 0) {
                fail = true;
                break;
              }
            } else {
View Full Code Here

  public Response tpservice(TPSVCINFO svcinfo) throws ConnectionException {
    log.info("testtpsend_tpsendonly_service");
    int result = svcinfo.getSession().tpsend(svcinfo.getBuffer(),
        Connection.TPRECVONLY);
    try {
      Buffer tprecv = svcinfo.getSession().tprecv(0);
    } catch (ConnectionException e) {
      if (e.getTperrno() != Connection.TPEEVENT) {
        log.error("ConnectionException: ", e);
        throw e;
      }
View Full Code Here

        sendbuf, Connection.TPRECVONLY);
    long revent = 0;
    log.info("Started conversation");
    for (int i = 0; i < interationCount; i++) {
      try {
        Buffer result = cd.tprecv(0);
        fail("Did not get sendonly event");
      } catch (ResponseException e) {
        assertTrue(e.getTperrno() == Connection.TPEEVENT);
        assertTrue(e.getEvent() == Connection.TPEV_SENDONLY);
        Buffer rcvbuf = e.getReceived();
        String expectedResult = ("hi" + i);
        assertTrue(strcmp(expectedResult, rcvbuf) == 0);

        sendbuf.setByteArray(("yo" + i).getBytes());
        // btlogger((char*) "test_conversation:%s:", sendbuf);
        int result = cd.tpsend(sendbuf, Connection.TPRECVONLY);
        assertTrue(result != -1);
      }
    }
    log.info("Conversed");
    try {
      cd.tprecv(0);
      fail("Expected event");
    } catch (ResponseException e) {
      assertTrue(e.getTperrno() == Connection.TPEEVENT);
      Buffer rcvbuf = e.getReceived();
      String expectedResult = ("hi" + interationCount);
      log.info("Expected: " + expectedResult + " Received: "
          + new String(((X_OCTET) rcvbuf).getByteArray()));
      assertTrue(strcmp(expectedResult, rcvbuf) == 0);
    }
View Full Code Here

    log.info("test_short_conversation");
    cd = connection.tpconnect(RunServer.getServiceNameTestTPConversa2(),
        null, Connection.TPRECVONLY);
    assertTrue(cd != null);

    Buffer rcvbuf = cd.tprecv(0);
    assertTrue(rcvbuf != null);
    assertTrue(strcmp("hi0", rcvbuf) == 0);

    try {
      cd.tprecv(0);
View Full Code Here

    // TODO long event = 0; /* X_C_TYPE and subtype inq_buf. The structure
    // */
    Session cd; /* contains a character array named input and an */
    /* array of integers named output. */
    /* allocate typed buffer */
    Buffer ptr = connection.tpalloc("X_C_TYPE", "inq_buf", 0);

    /* populate typed buffer with input data */
    ((X_C_TYPE) ptr).setByteArray("input",
        "retrieve all accounts with balances less than 0".getBytes());
    // TODO tx_begin(); /* start global transaction */
 
View Full Code Here

    }
  }

  public void test_tpacall_x_octet_not_exist() throws ConnectionException {
    log.info("test_tpacall_x_octet_not_exist");
    Buffer sendbuf = connection.tpalloc("X_OCTET", null, 25);

    try {
      connection.tpacall("GREETSVC", sendbuf, Connection.TPNOREPLY);
    } catch (ConnectionException e) {
      assertTrue(e.getTperrno() == Connection.TPENOENT);
View Full Code Here

        JABTransaction.resume(tx);
      } else {
        log.debug("service_request tx same as current");
      }

      Buffer request = requestMessage.getBuffer();
      log.debug("service_request tpcall");
      Response response = connection.tpcall(serviceName, request,
          noTimeout ? Connection.TPNOTIME : 0);
      responseMessage = new JABMessage(response);
      log.debug("service_request responsed");
View Full Code Here

  private static final Logger log = LogManager
      .getLogger(RollbackOnlyTprecvTPEVDISCONIMMService.class);

  public Response tpservice(TPSVCINFO svcinfo) throws ConnectionException {
    log.info("test_tprecv_TPEV_DISCONIMM_service");
    Buffer status = svcinfo.getSession().tprecv(0);
    TXINFO txinfo = new TXINFO();
    int inTx = TX.tx_info(txinfo);
    boolean rbkOnly = (txinfo.transaction_state == TX.TX_ROLLBACK_ONLY);
    log.info("status=%d, inTx=%d, rbkOnly=%d" + status + " " + inTx + " "
        + rbkOnly);
View Full Code Here

TOP

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

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.