Search in sources :

Example 1 with BT_NBF

use of org.jboss.narayana.blacktie.jatmibroker.xatmi.BT_NBF in project narayana by jbosstm.

the class TestNBF method test_nbf.

public void test_nbf() throws ConnectionException, ConfigurationException {
    log.info("test_nbf");
    server.tpadvertiseTestNBF();
    try {
        BT_NBF buffer = (BT_NBF) connection.tpalloc("BT_NBF", "employee");
        assertTrue(buffer.btaddattribute("name", "zhfeng"));
        assertTrue(buffer.btaddattribute("id", new Long(1001)));
        Response resp = connection.tpcall(RunServer.getServiceNameNBF(), buffer, 0);
        assertTrue(resp != null);
        BT_NBF rcvbuf = (BT_NBF) resp.getBuffer();
        assertTrue(rcvbuf != null);
        log.info(rcvbuf);
        Long id = (Long) rcvbuf.btgetattribute("id", 0);
        assertTrue(id.longValue() == 1234);
        String name = (String) rcvbuf.btgetattribute("name", 0);
        assertTrue(name == null);
    } catch (ConnectionException e) {
        log.warn("call service faild with " + e);
        throw e;
    }
}
Also used : Response(org.jboss.narayana.blacktie.jatmibroker.xatmi.Response) BT_NBF(org.jboss.narayana.blacktie.jatmibroker.xatmi.BT_NBF) ConnectionException(org.jboss.narayana.blacktie.jatmibroker.xatmi.ConnectionException)

Aggregations

BT_NBF (org.jboss.narayana.blacktie.jatmibroker.xatmi.BT_NBF)1 ConnectionException (org.jboss.narayana.blacktie.jatmibroker.xatmi.ConnectionException)1 Response (org.jboss.narayana.blacktie.jatmibroker.xatmi.Response)1