use of com.hazelcast.client.ClientService in project hazelcast by hazelcast.
the class HazelcastOSGiInstanceTest method getClientServiceCalledSuccessfullyOverOSGiInstance.
@Test
public void getClientServiceCalledSuccessfullyOverOSGiInstance() {
ClientService mockClientService = mock(ClientService.class);
HazelcastInstance mockHazelcastInstance = mock(HazelcastInstance.class);
HazelcastOSGiInstance hazelcastOSGiInstance = createHazelcastOSGiInstance(mockHazelcastInstance);
when(mockHazelcastInstance.getClientService()).thenReturn(mockClientService);
assertEquals(mockClientService, hazelcastOSGiInstance.getClientService());
verify(mockHazelcastInstance).getClientService();
}
use of com.hazelcast.client.ClientService in project hazelcast by hazelcast.
the class PhoneHomeClientsTest method addClientListener.
private void addClientListener(Node node) {
ClientService clientService = node.getNodeEngine().getHazelcastInstance().getClientService();
clientService.addClientListener(new ClientListener() {
@Override
public void clientConnected(Client client) {
}
@Override
public void clientDisconnected(Client client) {
disconnectedClientCount.incrementAndGet();
}
});
}
Aggregations