Search in sources :

Example 36 with MultiMap

use of com.hazelcast.multimap.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.multimap.MultiMap) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 37 with MultiMap

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

the class ClientMultiMapTest method testLocalKeySet.

@Test(expected = UnsupportedOperationException.class)
public void testLocalKeySet() {
    final MultiMap mm = client.getMultiMap(randomString());
    mm.localKeySet();
}
Also used : MultiMap(com.hazelcast.multimap.MultiMap) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 38 with MultiMap

use of com.hazelcast.multimap.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());
}
Also used : MultiMap(com.hazelcast.multimap.MultiMap) Collection(java.util.Collection) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 39 with MultiMap

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

the class ClientMultiMapTest method testVoidDelete.

@Test
public void testVoidDelete() {
    String key = "key";
    MultiMap mm = client.getMultiMap(randomString());
    mm.put(key, 4);
    assertTrue(!mm.get(key).isEmpty());
    mm.delete(key);
    assertTrue(mm.get(key).isEmpty());
}
Also used : MultiMap(com.hazelcast.multimap.MultiMap) HazelcastTestSupport.randomString(com.hazelcast.test.HazelcastTestSupport.randomString) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 40 with MultiMap

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

the class ClientMultiMapTest method testContainsKey_whenKeyNotExists.

@Test
public void testContainsKey_whenKeyNotExists() {
    final MultiMap mm = client.getMultiMap(randomString());
    assertFalse(mm.containsKey("NOT_THERE"));
}
Also used : MultiMap(com.hazelcast.multimap.MultiMap) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

MultiMap (com.hazelcast.multimap.MultiMap)93 Test (org.junit.Test)93 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)92 QuickTest (com.hazelcast.test.annotation.QuickTest)92 HazelcastTestSupport.randomString (com.hazelcast.test.HazelcastTestSupport.randomString)11 TransactionContext (com.hazelcast.transaction.TransactionContext)8 TransactionalMultiMap (com.hazelcast.transaction.TransactionalMultiMap)8 CountDownLatch (java.util.concurrent.CountDownLatch)7 Collection (java.util.Collection)6 Set (java.util.Set)5 TreeSet (java.util.TreeSet)5 AssertTask (com.hazelcast.test.AssertTask)4 UUID (java.util.UUID)4 HazelcastInstance (com.hazelcast.core.HazelcastInstance)3 EntryAdapter (com.hazelcast.core.EntryAdapter)2 EntryEvent (com.hazelcast.core.EntryEvent)2 EntryListener (com.hazelcast.core.EntryListener)2 ArrayList (java.util.ArrayList)2 ClientConnectionRegistration (com.hazelcast.client.impl.spi.impl.listener.ClientConnectionRegistration)1 TestHazelcastFactory (com.hazelcast.client.test.TestHazelcastFactory)1