@Test(timeout = 5000) public void testSendData() throws InterruptedException { byte[] data = new byte[] { 1, 2, 3 }; Mockito.stub(connector.send(Matchers.any(ZMsg.class), Matchers.any(ZMQ.Socket.class))).toReturn(true); Assert.assertTrue(connector.SendData(data)); }
public boolean SendData(byte[] data) { ZMsg msg = new ZMsg(); msg.add(data); ZMQ.Socket sendSocket = context.socket(ZMQ.PUSH); sendSocket.setIdentity("shim".getBytes()); sendSocket.connect(CONTROL_ADDRESS); send(msg, sendSocket); sendSocket.close(); return true; }
ZeroMQBaseConnector implements Runnable { public boolean SendData(byte[] data) { ZMsg msg = new ZMsg(); msg.add(data); ZMQ.Socket sendSocket = context.socket(ZMQ.PUSH); sendSocket.setIdentity("shim".getBytes()); sendSocket.connect(CONTROL_ADDRESS); send(msg, sendSocket); sendSocket.close(); return true; } }
ZeroMQBaseConnector implements Runnable { public boolean SendData(byte[] data) { ZMsg msg = new ZMsg(); msg.add(data); ZMQ.Socket sendSocket = context.socket(ZMQ.PUSH); sendSocket.setIdentity("shim".getBytes()); sendSocket.connect(CONTROL_ADDRESS); send(msg, sendSocket); sendSocket.close(); return true; } ZeroMQBaseConnector(); }
ZeroMQBaseConnector implements Runnable { public boolean SendData(byte[] data) { ZMsg msg = new ZMsg(); msg.add(data); ZMQ.Socket sendSocket = context.socket(ZMQ.PUSH); sendSocket.setIdentity("shim".getBytes()); sendSocket.connect(CONTROL_ADDRESS); send(msg, sendSocket); sendSocket.close(); return true; } ZeroMQBaseConnector(); void setContext(ZMQ.Context cont); void Start(); void Stop(); boolean send(String data, ZMQ.Socket socket); boolean send(ZMsg message, ZMQ.Socket socket); void RegisterCoreListener(ICoreListener listener); boolean SendData(byte[] data); @Override void run(); void setPort(int port); int getPort(); void setAddress(String address); String getAddress(); }
ZeroMQBaseConnector implements Runnable { public boolean SendData(byte[] data) { ZMsg msg = new ZMsg(); msg.add(data); ZMQ.Socket sendSocket = context.socket(ZMQ.PUSH); sendSocket.setIdentity("shim".getBytes()); sendSocket.connect(CONTROL_ADDRESS); send(msg, sendSocket); sendSocket.close(); return true; } ZeroMQBaseConnector(); void setContext(ZMQ.Context cont); void Start(); void Stop(); boolean send(String data, ZMQ.Socket socket); boolean send(ZMsg message, ZMQ.Socket socket); void RegisterCoreListener(ICoreListener listener); boolean SendData(byte[] data); @Override void run(); void setPort(int port); int getPort(); void setAddress(String address); String getAddress();  }