use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapLockTest method testForceUnlock_whenKeyNull.
@Test(expected = NullPointerException.class)
public void testForceUnlock_whenKeyNull() {
final MultiMap mm = client.getMultiMap(randomString());
mm.forceUnlock(null);
}
use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapLockTest method testUnlock_whenRentrantlyLockedBySelf.
@Test
public void testUnlock_whenRentrantlyLockedBySelf() {
final MultiMap mm = client.getMultiMap(randomString());
final Object key = "key";
mm.lock(key);
mm.lock(key);
mm.unlock(key);
assertTrue(mm.isLocked(key));
}
use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapLockTest method testTryLock_whenNullKey.
@Test(expected = NullPointerException.class)
public void testTryLock_whenNullKey() {
final MultiMap mm = client.getMultiMap(randomString());
mm.tryLock(null);
}
use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapLockTest method testUnLock.
@Test
public void testUnLock() {
final MultiMap mm = client.getMultiMap(randomString());
final Object key = "key";
mm.lock(key);
mm.unlock(key);
assertFalse(mm.isLocked(key));
}
use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ListenerLeakTest method testMultiMapEntryListeners.
@Test
public void testMultiMapEntryListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = newHazelcastClient();
MultiMap multiMap = client.getMultiMap(randomString());
UUID id = multiMap.addEntryListener(mock(EntryListener.class), false);
Collection<ClientConnectionRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(multiMap.removeEntryListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
Aggregations