use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapLockTest method testForceUnlock_whenKeyLockedTwice.
@Test
public void testForceUnlock_whenKeyLockedTwice() throws Exception {
final MultiMap mm = client.getMultiMap(randomString());
final Object key = "Key";
mm.lock(key);
mm.lock(key);
mm.forceUnlock(key);
assertFalse(mm.isLocked(key));
}
use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapLockTest method testLockTTL_whenZeroTimeout.
@Test(expected = IllegalArgumentException.class)
public void testLockTTL_whenZeroTimeout() throws Exception {
final MultiMap mm = client.getMultiMap(randomString());
final Object key = "Key";
mm.lock(key, 0, TimeUnit.SECONDS);
}
use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapTest method testContainsKey_whenKeyExists.
@Test
public void testContainsKey_whenKeyExists() {
final MultiMap mm = client.getMultiMap(randomString());
mm.put("key1", "value1");
assertTrue(mm.containsKey("key1"));
}
use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapTest method testPut_WithExistingKeyValue.
@Test
public void testPut_WithExistingKeyValue() {
final Object key = "key1";
final MultiMap mm = client.getMultiMap(randomString());
assertTrue(mm.put(key, 1));
assertFalse(mm.put(key, 1));
}
use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapTest method testContainsValue_whenNotExists.
@Test
public void testContainsValue_whenNotExists() {
final MultiMap mm = client.getMultiMap(randomString());
assertFalse(mm.containsValue("NOT_THERE"));
}
Aggregations