test_class.file: socket.io-server/src/test/java/io/socket/socketio/server/SocketIoClientTest.java
test_class.identifier: SocketIoClientTest
test_case.body: @Test
      public void test_sendPacket_binary() {
          final EngineIoServer engineIoServer = new EngineIoServer();
          final SocketIoServer socketIoServer = new SocketIoServer(engineIoServer);
  
          final EngineIoWebSocket webSocket = Mockito.spy(new EngineIoWebSocketImpl());
  
          final Emitter.Listener connectionListener = Mockito.mock(Emitter.Listener.class);
          Mockito.doAnswer(invocation -> {
              final Object[] args = invocation.getArguments();
              final EngineIoSocket socket = (EngineIoSocket) args[0];
              final SocketIoClient client = new SocketIoClient(socketIoServer, socket);
  
              final JSONArray packetData = new JSONArray();
              packetData.put("foo");
              packetData.put(1);
              packetData.put(new byte[16]);
  
              final Packet<JSONArray> packet = new Packet<>(Parser.EVENT, packetData);
  
              try {
                  Mockito.reset(webSocket);
                  client.sendPacket(packet);
                  Mockito.verify(webSocket, Mockito.times(1))
                          .write(Mockito.anyString());
                  Mockito.verify(webSocket, Mockito.times(1))
                          .write(Mockito.any(byte[].class));
              } catch (IOException ignore) {
              }
              return null;
          }).when(connectionListener).call(Mockito.any());
          engineIoServer.on("connection", connectionListener);
          engineIoServer.handleWebSocket(webSocket);
  
          Mockito.verify(connectionListener, Mockito.times(1))
                  .call(Mockito.any(EngineIoSocket.class));
      }
test_case.class_method_signature: SocketIoClientTest.test_sendPacket_binary()
test_case.full_signature: @Test public void test_sendPacket_binary()
test_case.identifier: test_sendPacket_binary
test_case.invocations: spy mock call when doAnswer getArguments put put put reset sendPacket write verify times anyString write verify times any any on handleWebSocket call verify times any
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_sendPacket_binary()
focal_class.declarator: mServer
focal_class.modifier: private final
focal_class.original_string: private final SocketIoServer mServer;
focal_class.type: SocketIoServer
focal_class.var_name: mServer
focal_class.declarator: mConnection
focal_class.modifier: private final
focal_class.original_string: private final EngineIoSocket mConnection;
focal_class.type: EngineIoSocket
focal_class.var_name: mConnection
focal_class.declarator: mEncoder
focal_class.modifier: private final
focal_class.original_string: private final Parser.Encoder mEncoder;
focal_class.type: Parser.Encoder
focal_class.var_name: mEncoder
focal_class.declarator: mDecoder
focal_class.modifier: private final
focal_class.original_string: private final Parser.Decoder mDecoder;
focal_class.type: Parser.Decoder
focal_class.var_name: mDecoder
focal_class.declarator: mId
focal_class.modifier: private final
focal_class.original_string: private final String mId;
focal_class.type: String
focal_class.var_name: mId
focal_class.declarator: mSockets = new ConcurrentHashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<String, SocketIoSocket> mSockets = new ConcurrentHashMap<>();
focal_class.type: Map<String, SocketIoSocket>
focal_class.var_name: mSockets
focal_class.declarator: mNamespaceSockets = new ConcurrentHashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<String, SocketIoSocket> mNamespaceSockets = new ConcurrentHashMap<>();
focal_class.type: Map<String, SocketIoSocket>
focal_class.var_name: mNamespaceSockets
focal_class.file: socket.io-server/src/main/java/io/socket/socketio/server/SocketIoClient.java
focal_class.identifier: SocketIoClient
focal_class.class_method_signature: SocketIoClient.SocketIoClient(SocketIoServer server, EngineIoSocket connection)
focal_class.full_signature:   SocketIoClient(SocketIoServer server, EngineIoSocket connection)
focal_class.identifier: SocketIoClient
focal_class.parameters: (SocketIoServer server, EngineIoSocket connection)
focal_class.signature:  SocketIoClient(SocketIoServer server, EngineIoSocket connection)
focal_class.class_method_signature: SocketIoClient.getId()
focal_class.full_signature:  String getId()
focal_class.identifier: getId
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getId()
focal_class.class_method_signature: SocketIoClient.sendPacket(final Packet packet)
focal_class.full_signature:  void sendPacket(final Packet packet)
focal_class.identifier: sendPacket
focal_class.parameters: (final Packet packet)
focal_class.return: void
focal_class.signature: void sendPacket(final Packet packet)
focal_class.class_method_signature: SocketIoClient.connect(String namespace)
focal_class.full_signature:  void connect(String namespace)
focal_class.identifier: connect
focal_class.parameters: (String namespace)
focal_class.return: void
focal_class.signature: void connect(String namespace)
focal_class.class_method_signature: SocketIoClient.remove(SocketIoSocket socket)
focal_class.full_signature:  void remove(SocketIoSocket socket)
focal_class.identifier: remove
focal_class.parameters: (SocketIoSocket socket)
focal_class.return: void
focal_class.signature: void remove(SocketIoSocket socket)
focal_class.class_method_signature: SocketIoClient.disconnect()
focal_class.full_signature:  void disconnect()
focal_class.identifier: disconnect
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void disconnect()
focal_class.class_method_signature: SocketIoClient.getConnection()
focal_class.full_signature:  EngineIoSocket getConnection()
focal_class.identifier: getConnection
focal_class.parameters: ()
focal_class.return: EngineIoSocket
focal_class.signature: EngineIoSocket getConnection()
focal_class.class_method_signature: SocketIoClient.close()
focal_class.full_signature: private void close()
focal_class.identifier: close
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: SocketIoClient.setup()
focal_class.full_signature: private void setup()
focal_class.identifier: setup
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void setup()
focal_class.class_method_signature: SocketIoClient.destroy()
focal_class.full_signature: private void destroy()
focal_class.identifier: destroy
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void destroy()
focal_class.class_method_signature: SocketIoClient.doConnect(String namespace)
focal_class.full_signature: private void doConnect(String namespace)
focal_class.identifier: doConnect
focal_class.modifiers: private
focal_class.parameters: (String namespace)
focal_class.return: void
focal_class.signature: void doConnect(String namespace)
focal_class.class_method_signature: SocketIoClient.onClose(String reason)
focal_class.full_signature: private void onClose(String reason)
focal_class.identifier: onClose
focal_class.modifiers: private
focal_class.parameters: (String reason)
focal_class.return: void
focal_class.signature: void onClose(String reason)
focal_class.class_method_signature: SocketIoClient.onError(String error)
focal_class.full_signature: private void onError(String error)
focal_class.identifier: onError
focal_class.modifiers: private
focal_class.parameters: (String error)
focal_class.return: void
focal_class.signature: void onError(String error)
focal_method.body: void sendPacket(final Packet packet) {
          if (mConnection.getReadyState() == ReadyState.OPEN) {
              mEncoder.encode(packet, objects -> {
                  // TODO: Check for volatile flag
  
                  for (Object item : objects) {
                      final io.socket.engineio.parser.Packet engineIoPacket = new io.socket.engineio.parser.Packet(io.socket.engineio.parser.Packet.MESSAGE);
                      engineIoPacket.data = item;
                      mConnection.send(engineIoPacket);
                  }
              });
          }
      }
focal_method.class_method_signature: SocketIoClient.sendPacket(final Packet packet)
focal_method.full_signature:  void sendPacket(final Packet packet)
focal_method.identifier: sendPacket
focal_method.invocations: getReadyState encode send
focal_method.parameters: (final Packet packet)
focal_method.return: void
focal_method.signature: void sendPacket(final Packet packet)