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

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


  public DebitAdapterService() throws ConfigurationException {
    super();
  }

  public Response tpservice(TPSVCINFO svcinfo) throws ConnectionException {
    X_COMMON rcv = (X_COMMON) svcinfo.getBuffer();
    long acct_no = rcv.getLong("acct_no");
    short amount = rcv.getShort("amount");

    String resp = "NAMINGERROR";
    try {
      Context ctx = new InitialContext();
      DebitRemote bean = (DebitRemote) ctx.lookup("DebitBean/remote");
View Full Code Here


  public CreditAdapterService() throws ConfigurationException {
    super();
  }

  public Response tpservice(TPSVCINFO svcinfo) throws ConnectionException {
    X_COMMON rcv = (X_COMMON) svcinfo.getBuffer();
    long acct_no = rcv.getLong("acct_no");
    short amount = rcv.getShort("amount");

    String resp = "NAMINGERROR";
    try {
      Context ctx = new InitialContext();
      CreditRemote bean = (CreditRemote) ctx.lookup("CreditBean/remote");
View Full Code Here

  }

  // 9.1.2
  public void test_tpalloc_x_common() throws ConnectionException {
    log.info("test_tpalloc_x_common");
    X_COMMON dptr = (X_COMMON) connection.tpalloc("X_COMMON", "deposit", 0);
    m_allocated = dptr;

    // ASSIGN SOME VALUES
    dptr.setLong("acct_no", 12345678);
    dptr.setShort("amount", (short) 50);
    dptr.setShort("balance", (short) 0);
    dptr.setByteArray("status", "c".getBytes());
    dptr.setShort("status_len", (short) 0);

    // CHECK THE ASSIGNATIONS
    assertTrue(dptr.getLong("acct_no") == 12345678);
    assertTrue(dptr.getShort("amount") == 50);
    assertTrue(dptr.getShort("balance") == 0);
    assertTrue(Arrays.equals(dptr.getByteArray("status"), "c".getBytes()));
    assertTrue(dptr.getShort("status_len") == 0);
  }
View Full Code Here

    assertTrue(dptr.getShort("status_len") == 0);
  }

  public void test_tpalloc_x_common_bigsubtype() throws ConnectionException {
    log.info("test_tpalloc_x_common_bigsubtype");
    X_COMMON dptr = (X_COMMON) connection.tpalloc("X_COMMON",
        "abcdefghijklmnop", 0);
    m_allocated = dptr;

    assertTrue(m_allocated.getType().equals("X_COMMON"));
    assertFalse(m_allocated.getSubtype().equals("abcdefghijklmnopq"));
View Full Code Here

  public Response tpservice(TPSVCINFO svcinfo) throws ConnectionException {

    log.info("test_tpcall_x_common_service");
    boolean ok = false;
    X_COMMON dptr = (X_COMMON) svcinfo.getBuffer();

    if (dptr.getLong("acct_no") == 12345678
        && dptr.getShort("amount") == 50) {
      ok = true;
    }

    int len = 60;
    X_OCTET toReturn = (X_OCTET) svcinfo.getConnection().tpalloc("X_OCTET",
View Full Code Here

  public void test_tpcall_x_common() throws ConnectionException {
    log.info("TestTPCall::test_tpcall_x_common");
    server.tpadvertisetpcallXCommon();

    X_COMMON dptr = (X_COMMON) connection.tpalloc("X_COMMON", "deposit", 0);

    dptr.setLong("acct_no", 12345678);
    dptr.setShort("amount", (short) 50);

    Response rcvbuf = connection.tpcall(
        RunServer.getServiceNametpcallXCommon(), dptr, 0);
    assertTrue(rcvbuf.getRcode() == 22);
    byte[] received = ((X_OCTET) rcvbuf.getBuffer()).getByteArray();
View Full Code Here

  }

  // 9.1.2
  public void test_tpalloc_x_common() throws ConnectionException {
    log.info("test_tpalloc_x_common");
    X_COMMON dptr = (X_COMMON) connection.tpalloc("X_COMMON", "deposit", 0);
    m_allocated = dptr;

    // ASSIGN SOME VALUES
    dptr.setLong("acct_no", 12345678);
    dptr.setShort("amount", (short) 50);
    dptr.setShort("balance", (short) 0);
    dptr.setByteArray("status", "c".getBytes());
    dptr.setShort("status_len", (short) 0);

    // CHECK THE ASSIGNATIONS
    assertTrue(dptr.getLong("acct_no") == 12345678);
    assertTrue(dptr.getShort("amount") == 50);
    assertTrue(dptr.getShort("balance") == 0);
    assertTrue(Arrays.equals(dptr.getByteArray("status"), "c".getBytes()));
    assertTrue(dptr.getShort("status_len") == 0);
  }
View Full Code Here

    assertTrue(dptr.getShort("status_len") == 0);
  }

  public void test_tpalloc_x_common_bigsubtype() throws ConnectionException {
    log.info("test_tpalloc_x_common_bigsubtype");
    X_COMMON dptr = (X_COMMON) connection.tpalloc("X_COMMON",
        "abcdefghijklmnop", 0);
    m_allocated = dptr;

    assertTrue(m_allocated.getType().equals("X_COMMON"));
    assertFalse(m_allocated.getSubtype().equals("abcdefghijklmnopq"));
View Full Code Here

  public void test_tpcall_x_common() throws ConnectionException {
    log.info("TestTPCall::test_tpcall_x_common");
    server.tpadvertisetpcallXCommon();

    X_COMMON dptr = (X_COMMON) connection.tpalloc("X_COMMON", "deposit", 0);

    dptr.setLong("acct_no", 12345678);
    dptr.setShort("amount", (short) 50);

    Response rcvbuf = connection.tpcall(
        RunServer.getServiceNametpcallXCommon(), dptr, 0);
    assertTrue(rcvbuf.getRcode() == 22);
    byte[] received = ((X_OCTET) rcvbuf.getBuffer()).getByteArray();
View Full Code Here

      .getLogger(RollbackOnlyTpcallTPEOTYPEService.class);

  public Response tpservice(TPSVCINFO svcinfo) throws ConnectionException {
    log.info("test_tpcall_TPEOTYPE_service");
    int len = 60;
    X_COMMON toReturn = (X_COMMON) svcinfo.getConnection().tpalloc(
        "X_COMMON", "test", len);
    toReturn.setByteArray("key", "test_tpcall_TPEOTYPE_service".getBytes());
    return new Response(Connection.TPSUCCESS, 0, toReturn, 0);
  }
View Full Code Here

TOP

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

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.