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;
}
}
Aggregations