use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapTest method testValueCount_whenKeyNotThere.
@Test
public void testValueCount_whenKeyNotThere() {
final Object key = "key1";
final MultiMap mm = client.getMultiMap(randomString());
assertEquals(0, mm.valueCount("NOT_THERE"));
}
use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapTest method testPutMultiValuesToKey.
@Test
public void testPutMultiValuesToKey() {
final Object key = "key1";
final MultiMap mm = client.getMultiMap(randomString());
mm.put(key, 1);
assertTrue(mm.put(key, 2));
}
use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapTest method testValues_whenEmptyCollection.
@Test
public void testValues_whenEmptyCollection() {
final MultiMap mm = client.getMultiMap(randomString());
assertEquals(Collections.EMPTY_LIST, mm.values());
}
use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapTest method testRemoveKey.
@Test
public void testRemoveKey() {
final Object key = "key";
final int maxItemsPerKey = 44;
final MultiMap mm = client.getMultiMap(randomString());
Set expeted = new TreeSet();
for (int i = 0; i < maxItemsPerKey; i++) {
mm.put(key, i);
expeted.add(i);
}
Set resultSet = new TreeSet(mm.remove(key));
assertEquals(expeted, resultSet);
assertEquals(0, mm.size());
}
use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapLockTest method testForceUnlock_whenKeyLocked.
@Test
public void testForceUnlock_whenKeyLocked() throws Exception {
final MultiMap mm = client.getMultiMap(randomString());
final Object key = "Key";
mm.lock(key);
mm.forceUnlock(key);
assertFalse(mm.isLocked(key));
}
Aggregations