Search in sources :

Example 56 with MultiMap

use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.

the class ClientMultiMapTest method testContainsValue_whenExists.

@Test
public void testContainsValue_whenExists() {
    final MultiMap mm = client.getMultiMap(randomString());
    mm.put("key1", "value1");
    assertTrue(mm.containsValue("value1"));
    assertFalse(mm.containsValue("NOT_THERE"));
}
Also used : MultiMap(com.hazelcast.core.MultiMap) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 57 with MultiMap

use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.

the class ClientMultiMapTest method testEmptyKeySet.

@Test
public void testEmptyKeySet() {
    final MultiMap mm = client.getMultiMap(randomString());
    assertEquals(Collections.EMPTY_SET, mm.keySet());
}
Also used : MultiMap(com.hazelcast.core.MultiMap) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 58 with MultiMap

use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.

the class ClientMultiMapTest method testPut_withNullValue.

@Test(expected = NullPointerException.class)
public void testPut_withNullValue() {
    Object key = "key";
    final MultiMap mm = client.getMultiMap(randomString());
    mm.put(key, null);
}
Also used : MultiMap(com.hazelcast.core.MultiMap) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 59 with MultiMap

use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.

the class ClientMultiMapTest method testGet_whenNotExist.

@Test
public void testGet_whenNotExist() {
    final MultiMap mm = client.getMultiMap(randomString());
    Collection coll = mm.get("NOT_THERE");
    assertTrue(coll.isEmpty());
}
Also used : MultiMap(com.hazelcast.core.MultiMap) Collection(java.util.Collection) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 60 with MultiMap

use of com.hazelcast.core.MultiMap in project hazelcast by hazelcast.

the class ClientMultiMapTest method testEntrySet.

@Test
public void testEntrySet() {
    final int maxKeys = 14;
    final int maxValues = 3;
    final MultiMap mm = client.getMultiMap(randomString());
    for (int key = 0; key < maxKeys; key++) {
        for (int val = 0; val < maxValues; val++) {
            mm.put(key, val);
        }
    }
    assertEquals(maxKeys * maxValues, mm.entrySet().size());
}
Also used : MultiMap(com.hazelcast.core.MultiMap) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

MultiMap (com.hazelcast.core.MultiMap)118 Test (org.junit.Test)117 QuickTest (com.hazelcast.test.annotation.QuickTest)107 ParallelTest (com.hazelcast.test.annotation.ParallelTest)106 HazelcastInstance (com.hazelcast.core.HazelcastInstance)16 HazelcastTestSupport.randomString (com.hazelcast.test.HazelcastTestSupport.randomString)12 Map (java.util.Map)11 Config (com.hazelcast.config.Config)9 TransactionalMultiMap (com.hazelcast.core.TransactionalMultiMap)9 JobTracker (com.hazelcast.mapreduce.JobTracker)9 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)9 HashMap (java.util.HashMap)9 TransactionContext (com.hazelcast.transaction.TransactionContext)8 SlowTest (com.hazelcast.test.annotation.SlowTest)7 CountDownLatch (java.util.concurrent.CountDownLatch)6 AssertTask (com.hazelcast.test.AssertTask)5 Collection (java.util.Collection)5 List (java.util.List)5 Set (java.util.Set)4 TreeSet (java.util.TreeSet)4