use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientTxnMultiMapTest method testRemove_whenBackedWithList.
@Test
public void testRemove_whenBackedWithList() throws Exception {
final String mapName = multiMapBackedByList + randomString();
final String key = "key";
final String value = "value";
final MultiMap multiMap = server.getMultiMap(mapName);
multiMap.put(key, value);
TransactionContext tx = client.newTransactionContext();
tx.beginTransaction();
TransactionalMultiMap mulitMapTxn = tx.getMultiMap(mapName);
Collection c = mulitMapTxn.remove(key);
assertFalse(c.isEmpty());
tx.commitTransaction();
}
use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientTxnMultiMapTest method testRemoveAll.
@Test
public void testRemoveAll() throws Exception {
final String mapName = randomString();
final String key = "key";
MultiMap multiMap = client.getMultiMap(mapName);
for (int i = 0; i < 10; i++) {
multiMap.put(key, i);
}
TransactionContext tx = client.newTransactionContext();
tx.beginTransaction();
TransactionalMultiMap txnMultiMap = tx.getMultiMap(mapName);
txnMultiMap.remove(key);
tx.commitTransaction();
assertTrue(multiMap.get(key).isEmpty());
}
use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class MBeanTest method testMultiMap.
@Test
public void testMultiMap() throws Exception {
MultiMap map = holder.getHz().getMultiMap("multimap");
map.size();
holder.assertMBeanExistEventually("MultiMap", map.getName());
}
Aggregations