use of com.hazelcast.client.cp.internal.session.ClientProxySessionManager in project hazelcast by hazelcast.
the class FencedLockClientBasicTest method test_sessionIsClosedOnCPSubsystemReset.
@Test
public void test_sessionIsClosedOnCPSubsystemReset() throws Exception {
lock.lock();
instances[0].getCPSubsystem().getCPSubsystemManagementService().reset().toCompletableFuture().get();
assertTrueEventually(() -> {
HazelcastClientProxy clientProxy = (HazelcastClientProxy) client;
ClientProxySessionManager proxySessionManager = clientProxy.client.getProxySessionManager();
assertEquals(NO_SESSION_ID, proxySessionManager.getSession((RaftGroupId) lock.getGroupId()));
});
}
use of com.hazelcast.client.cp.internal.session.ClientProxySessionManager in project hazelcast by hazelcast.
the class SessionAwareSemaphoreClientBasicTest method testDrain_ReleasesSessionProperly.
@Test
public void testDrain_ReleasesSessionProperly() throws InterruptedException {
int permits = 20;
assertTrue(semaphore.init(permits));
final int drainPermits = semaphore.drainPermits();
HazelcastClientProxy clientProxy = (HazelcastClientProxy) client;
ClientProxySessionManager proxySessionManager = clientProxy.client.getProxySessionManager();
SessionAwareSemaphoreProxy proxy = (SessionAwareSemaphoreProxy) semaphore;
RaftGroupId groupId = (RaftGroupId) proxy.getGroupId();
final long session = proxySessionManager.getSession(groupId);
assertEquals(drainPermits, proxySessionManager.getSessionAcquireCount(groupId, session));
}
Aggregations