use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapLockTest method testLock.
@Test
public void testLock() throws Exception {
final MultiMap mm = client.getMultiMap(randomString());
final Object key = "Key";
mm.lock(key);
assertTrue(mm.isLocked(key));
}
use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapTest method testRemove_whenKeyNotExist.
@Test
public void testRemove_whenKeyNotExist() {
final MultiMap mm = client.getMultiMap(randomString());
Collection coll = mm.remove("NOT_THERE");
assertTrue(coll.isEmpty());
}
use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapTest method testKeySet.
@Test
public void testKeySet() {
final int maxKeys = 23;
final MultiMap mm = client.getMultiMap(randomString());
Set expected = new TreeSet();
for (int key = 0; key < maxKeys; key++) {
mm.put(key, 1);
expected.add(key);
}
assertEquals(expected, mm.keySet());
}
use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapTest method testContainsValue_whenSearchValueNull.
@Test(expected = NullPointerException.class)
public void testContainsValue_whenSearchValueNull() {
final MultiMap mm = client.getMultiMap(randomString());
mm.containsValue(null);
}
use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapTest method testContainsEntry.
@Test
public void testContainsEntry() {
final MultiMap mm = client.getMultiMap(randomString());
mm.put("key1", "value1");
assertTrue(mm.containsEntry("key1", "value1"));
assertFalse(mm.containsEntry("key1", "NOT_THERE"));
assertFalse(mm.containsEntry("NOT_THERE", "NOT_THERE"));
assertFalse(mm.containsEntry("NOT_THERE", "value1"));
}
Aggregations