Search in sources :

Example 1 with MsgAllocatorDirect

use of zmq.msg.MsgAllocatorDirect in project jeromq by zeromq.

the class TestZMQ method testSocketMsgAllocator.

@Test
public void testSocketMsgAllocator() {
    final Socket socket = ctx.socket(SocketType.STREAM);
    assertThat(socket, notNullValue());
    MsgAllocator allocator = new MsgAllocatorDirect();
    boolean set = socket.setMsgAllocator(allocator);
    assertThat(set, is(true));
    // TODO
    socket.close();
}
Also used : MsgAllocator(zmq.msg.MsgAllocator) MsgAllocatorDirect(zmq.msg.MsgAllocatorDirect) Socket(org.zeromq.ZMQ.Socket) Test(org.junit.Test)

Example 2 with MsgAllocatorDirect

use of zmq.msg.MsgAllocatorDirect in project jeromq by zeromq.

the class OptionsTest method testAllocator.

@Test
public void testAllocator() {
    options.setSocketOpt(ZMQ.ZMQ_MSG_ALLOCATOR, new MsgAllocatorDirect());
    assertThat(options.getSocketOpt(ZMQ.ZMQ_MSG_ALLOCATOR), is((Object) options.allocator));
}
Also used : MsgAllocatorDirect(zmq.msg.MsgAllocatorDirect) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 MsgAllocatorDirect (zmq.msg.MsgAllocatorDirect)2 Socket (org.zeromq.ZMQ.Socket)1 MsgAllocator (zmq.msg.MsgAllocator)1