test_class.file: socket.io-server/src/test/java/io/socket/socketio/server/SocketIoSocketTest.java
test_class.identifier: SocketIoSocketTest
test_case.body: @Test
      public void test_joinRoom() {
          final LocalAdapterFactory adapterFactory = new LocalAdapterFactory();
  
          final EngineIoServer engineIoServer = new EngineIoServer();
          final SocketIoServer server = Mockito.spy(new SocketIoServer(
                  engineIoServer,
                  SocketIoServerOptions.newFromDefault().setAdapterFactory(adapterFactory)));
          final SocketIoNamespace namespace = server.namespace("/");
  
          final Emitter.Listener connectionListener = Mockito.mock(Emitter.Listener.class);
          Mockito.doAnswer(invocation -> {
              final Object[] args = invocation.getArguments();
              final SocketIoSocket socket = (SocketIoSocket) args[0];
              final SocketIoAdapter adapter = adapterFactory.adapter;
  
              // Join foo
              Mockito.reset(adapter);
              socket.joinRoom("foo");
              Mockito.verify(adapter, Mockito.times(1))
                      .add(Mockito.eq("foo"), Mockito.eq(socket));
  
              // Join bar
              Mockito.reset(adapter);
              socket.joinRoom("bar");
              Mockito.verify(adapter, Mockito.times(1))
                      .add(Mockito.eq("bar"), Mockito.eq(socket));
  
              // Duplicate join foo
              Mockito.reset(adapter);
              socket.joinRoom("foo");
              Mockito.verify(adapter, Mockito.times(0))
                      .add(Mockito.eq("foo"), Mockito.eq(socket));
              return null;
          }).when(connectionListener).call(Mockito.any());
          namespace.on("connection", connectionListener);
  
          final EngineIoWebSocketImpl webSocket = new EngineIoWebSocketImpl();
          engineIoServer.handleWebSocket(webSocket);
  
          Mockito.verify(connectionListener, Mockito.times(1))
                  .call(Mockito.any(SocketIoSocket.class));
      }
test_case.class_method_signature: SocketIoSocketTest.test_joinRoom()
test_case.full_signature: @Test public void test_joinRoom()
test_case.identifier: test_joinRoom
test_case.invocations: spy setAdapterFactory newFromDefault namespace mock call when doAnswer getArguments reset joinRoom add verify times eq eq reset joinRoom add verify times eq eq reset joinRoom add verify times eq eq any on handleWebSocket call verify times any
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_joinRoom()
focal_class.declarator: EMPTY_ARGS = new Object[0]
focal_class.modifier: private static final
focal_class.original_string: private static final Object[] EMPTY_ARGS = new Object[0];
focal_class.type: Object[]
focal_class.var_name: EMPTY_ARGS
focal_class.declarator: mAllEventListeners = new ConcurrentLinkedQueue<>()
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentLinkedQueue<AllEventListener> mAllEventListeners = new ConcurrentLinkedQueue<>();
focal_class.type: ConcurrentLinkedQueue<AllEventListener>
focal_class.var_name: mAllEventListeners
focal_class.declarator: mNamespace
focal_class.modifier: private final
focal_class.original_string: private final SocketIoNamespaceImpl mNamespace;
focal_class.type: SocketIoNamespaceImpl
focal_class.var_name: mNamespace
focal_class.declarator: mClient
focal_class.modifier: private final
focal_class.original_string: private final SocketIoClient mClient;
focal_class.type: SocketIoClient
focal_class.var_name: mClient
focal_class.declarator: mAdapter
focal_class.modifier: private final
focal_class.original_string: private final SocketIoAdapter mAdapter;
focal_class.type: SocketIoAdapter
focal_class.var_name: mAdapter
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: mRooms = new HashSet<>()
focal_class.modifier: private final
focal_class.original_string: private final HashSet<String> mRooms = new HashSet<>();
focal_class.type: HashSet<String>
focal_class.var_name: mRooms
focal_class.declarator: mAcknowledgementCallbacks = new HashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final HashMap<Integer, ReceivedByRemoteAcknowledgementCallback> mAcknowledgementCallbacks = new HashMap<>();
focal_class.type: HashMap<Integer, ReceivedByRemoteAcknowledgementCallback>
focal_class.var_name: mAcknowledgementCallbacks
focal_class.declarator: mConnected
focal_class.modifier: private
focal_class.original_string: private boolean mConnected;
focal_class.type: boolean
focal_class.var_name: mConnected
focal_class.file: socket.io-server/src/main/java/io/socket/socketio/server/SocketIoSocket.java
focal_class.identifier: SocketIoSocket
focal_class.class_method_signature: SocketIoSocket.SocketIoSocket(SocketIoNamespaceImpl namespace, SocketIoClient client)
focal_class.full_signature:   SocketIoSocket(SocketIoNamespaceImpl namespace, SocketIoClient client)
focal_class.identifier: SocketIoSocket
focal_class.parameters: (SocketIoNamespaceImpl namespace, SocketIoClient client)
focal_class.signature:  SocketIoSocket(SocketIoNamespaceImpl namespace, SocketIoClient client)
focal_class.class_method_signature: SocketIoSocket.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: SocketIoSocket.equals(Object obj)
focal_class.full_signature: @Override public boolean equals(Object obj)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object obj)
focal_class.return: boolean
focal_class.signature: boolean equals(Object obj)
focal_class.class_method_signature: SocketIoSocket.getId()
focal_class.full_signature: public String getId()
focal_class.identifier: getId
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getId()
focal_class.class_method_signature: SocketIoSocket.getNamespace()
focal_class.full_signature: public SocketIoNamespace getNamespace()
focal_class.identifier: getNamespace
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: SocketIoNamespace
focal_class.signature: SocketIoNamespace getNamespace()
focal_class.class_method_signature: SocketIoSocket.disconnect(boolean close)
focal_class.full_signature: public void disconnect(boolean close)
focal_class.identifier: disconnect
focal_class.modifiers: public
focal_class.parameters: (boolean close)
focal_class.return: void
focal_class.signature: void disconnect(boolean close)
focal_class.class_method_signature: SocketIoSocket.broadcast(String room, String event, Object... args)
focal_class.full_signature: public void broadcast(String room, String event, Object... args)
focal_class.identifier: broadcast
focal_class.modifiers: public
focal_class.parameters: (String room, String event, Object... args)
focal_class.return: void
focal_class.signature: void broadcast(String room, String event, Object... args)
focal_class.class_method_signature: SocketIoSocket.broadcast(String[] rooms, String event, Object[] args)
focal_class.full_signature: public void broadcast(String[] rooms, String event, Object[] args)
focal_class.identifier: broadcast
focal_class.modifiers: public
focal_class.parameters: (String[] rooms, String event, Object[] args)
focal_class.return: void
focal_class.signature: void broadcast(String[] rooms, String event, Object[] args)
focal_class.class_method_signature: SocketIoSocket.send(String event, Object... args)
focal_class.full_signature: public void send(String event, Object... args)
focal_class.identifier: send
focal_class.modifiers: public
focal_class.parameters: (String event, Object... args)
focal_class.return: void
focal_class.signature: void send(String event, Object... args)
focal_class.class_method_signature: SocketIoSocket.send(String event, Object[] args, ReceivedByRemoteAcknowledgementCallback acknowledgementCallback)
focal_class.full_signature: public void send(String event, Object[] args, ReceivedByRemoteAcknowledgementCallback acknowledgementCallback)
focal_class.identifier: send
focal_class.modifiers: public
focal_class.parameters: (String event, Object[] args, ReceivedByRemoteAcknowledgementCallback acknowledgementCallback)
focal_class.return: void
focal_class.signature: void send(String event, Object[] args, ReceivedByRemoteAcknowledgementCallback acknowledgementCallback)
focal_class.class_method_signature: SocketIoSocket.joinRoom(String... rooms)
focal_class.full_signature: public synchronized void joinRoom(String... rooms)
focal_class.identifier: joinRoom
focal_class.modifiers: public synchronized
focal_class.parameters: (String... rooms)
focal_class.return: void
focal_class.signature: void joinRoom(String... rooms)
focal_class.class_method_signature: SocketIoSocket.leaveRoom(String... rooms)
focal_class.full_signature: public synchronized void leaveRoom(String... rooms)
focal_class.identifier: leaveRoom
focal_class.modifiers: public synchronized
focal_class.parameters: (String... rooms)
focal_class.return: void
focal_class.signature: void leaveRoom(String... rooms)
focal_class.class_method_signature: SocketIoSocket.leaveAllRooms()
focal_class.full_signature: public synchronized void leaveAllRooms()
focal_class.identifier: leaveAllRooms
focal_class.modifiers: public synchronized
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void leaveAllRooms()
focal_class.class_method_signature: SocketIoSocket.registerAllEventListener(AllEventListener listener)
focal_class.full_signature: public void registerAllEventListener(AllEventListener listener)
focal_class.identifier: registerAllEventListener
focal_class.modifiers: public
focal_class.parameters: (AllEventListener listener)
focal_class.return: void
focal_class.signature: void registerAllEventListener(AllEventListener listener)
focal_class.class_method_signature: SocketIoSocket.unregisterAllEventListener(AllEventListener listener)
focal_class.full_signature: public void unregisterAllEventListener(AllEventListener listener)
focal_class.identifier: unregisterAllEventListener
focal_class.modifiers: public
focal_class.parameters: (AllEventListener listener)
focal_class.return: void
focal_class.signature: void unregisterAllEventListener(AllEventListener listener)
focal_class.class_method_signature: SocketIoSocket.onEvent(final Packet packet)
focal_class.full_signature:  void onEvent(final Packet packet)
focal_class.identifier: onEvent
focal_class.parameters: (final Packet packet)
focal_class.return: void
focal_class.signature: void onEvent(final Packet packet)
focal_class.class_method_signature: SocketIoSocket.onAck(Packet packet)
focal_class.full_signature:  void onAck(Packet packet)
focal_class.identifier: onAck
focal_class.parameters: (Packet packet)
focal_class.return: void
focal_class.signature: void onAck(Packet packet)
focal_class.class_method_signature: SocketIoSocket.onPacket(Packet packet)
focal_class.full_signature:  void onPacket(Packet packet)
focal_class.identifier: onPacket
focal_class.parameters: (Packet packet)
focal_class.return: void
focal_class.signature: void onPacket(Packet packet)
focal_class.class_method_signature: SocketIoSocket.onConnect()
focal_class.full_signature:  void onConnect()
focal_class.identifier: onConnect
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void onConnect()
focal_class.class_method_signature: SocketIoSocket.onDisconnect()
focal_class.full_signature:  void onDisconnect()
focal_class.identifier: onDisconnect
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void onDisconnect()
focal_class.class_method_signature: SocketIoSocket.onClose(String reason)
focal_class.full_signature:  void onClose(String reason)
focal_class.identifier: onClose
focal_class.parameters: (String reason)
focal_class.return: void
focal_class.signature: void onClose(String reason)
focal_class.class_method_signature: SocketIoSocket.onError(String error)
focal_class.full_signature:  void onError(String error)
focal_class.identifier: onError
focal_class.parameters: (String error)
focal_class.return: void
focal_class.signature: void onError(String error)
focal_class.class_method_signature: SocketIoSocket.sendPacket(Packet packet)
focal_class.full_signature:  void sendPacket(Packet packet)
focal_class.identifier: sendPacket
focal_class.parameters: (Packet packet)
focal_class.return: void
focal_class.signature: void sendPacket(Packet packet)
focal_class.class_method_signature: SocketIoSocket.unpackEventData(JSONArray data)
focal_class.full_signature: private static Object[] unpackEventData(JSONArray data)
focal_class.identifier: unpackEventData
focal_class.modifiers: private static
focal_class.parameters: (JSONArray data)
focal_class.return: Object[]
focal_class.signature: Object[] unpackEventData(JSONArray data)
focal_class.superclass: extends Emitter
focal_method.body: public synchronized void joinRoom(String... rooms) {
          final ArrayList<String> roomList = new ArrayList<>();
          for (String room : rooms) {
              if (!mRooms.contains(room)) {
                  roomList.add(room);
              }
          }
  
          if (roomList.size() > 0) {
              for (String room : roomList) {
                  mAdapter.add(room, this);
                  mRooms.add(room);
              }
          }
      }
focal_method.class_method_signature: SocketIoSocket.joinRoom(String... rooms)
focal_method.full_signature: public synchronized void joinRoom(String... rooms)
focal_method.identifier: joinRoom
focal_method.invocations: contains add size add add
focal_method.modifiers: public synchronized
focal_method.parameters: (String... rooms)
focal_method.return: void
focal_method.signature: void joinRoom(String... rooms)