Package com.hazelcast.core

Examples of com.hazelcast.core.MultiMap


        assertFalse(result);
    }

    @Test
    public void testLock() throws Exception {
        final MultiMap mm = client.getMultiMap(randomString());
        final Object key = "Key";
        mm.lock(key);
        assertTrue(mm.isLocked(key));
    }
View Full Code Here


        assertTrue(mm.isLocked(key));
    }

    @Test(expected = NullPointerException.class)
    public void testLock_whenKeyNull() throws Exception {
        final MultiMap mm = client.getMultiMap(randomString());
        mm.lock(null);
    }
View Full Code Here

        mm.lock(null);
    }

    @Test(expected = NullPointerException.class)
    public void testUnLock_whenNullKey() throws Exception {
        final MultiMap mm = client.getMultiMap(randomString());
        mm.unlock(null);
    }
View Full Code Here

        mm.unlock(null);
    }

    @Test(expected = IllegalMonitorStateException.class)
    public void testUnlock_whenNotLocked() throws Exception {
        final MultiMap mm = client.getMultiMap(randomString());
        mm.unlock("NOT_LOCKED");
    }
View Full Code Here

        mm.unlock("NOT_LOCKED");
    }

    @Test
    public void testUnLock() throws Exception {
        final MultiMap mm = client.getMultiMap(randomString());
        final Object key = "key";

        mm.lock(key);
        mm.unlock(key);
        assertFalse(mm.isLocked(key));
    }
View Full Code Here

        assertFalse(mm.isLocked(key));
    }

    @Test
    public void testUnlock_whenRentrantlyLockedBySelf() throws Exception {
        final MultiMap mm = client.getMultiMap(randomString());
        final Object key = "key";

        mm.lock(key);
        mm.lock(key);
        mm.unlock(key);
        assertTrue(mm.isLocked(key));
    }
View Full Code Here

        assertTrue(mm.isLocked(key));
    }

    @Test(expected = IllegalMonitorStateException.class)
    public void testUnlock_whenLockedByOther() throws Exception {
        final MultiMap mm = client.getMultiMap(randomString());
        final Object key = "key";
        mm.lock(key);

        UnLockThread t = new UnLockThread(mm, key);
        t.start();
        assertJoinable(t);
        throw t.exception;
View Full Code Here

        }
    };

    @Test
    public void testLock_whenAlreadyLockedBySelf() throws Exception {
        final MultiMap mm = client.getMultiMap(randomString());
        final Object key = "Key";
        mm.lock(key);
        mm.lock(key);
        assertTrue(mm.isLocked(key));
    }
View Full Code Here

        assertTrue(mm.isLocked(key));
    }

    @Test
    public void testTryLock() throws Exception {
        final MultiMap mm = client.getMultiMap(randomString());
        Object key = "key";
        assertTrue(mm.tryLock(key));
    }
View Full Code Here

        assertTrue(mm.tryLock(key));
    }

    @Test(expected = NullPointerException.class)
    public void testTryLock_whenNullKey() throws Exception {
        final MultiMap mm = client.getMultiMap(randomString());
        mm.tryLock(null);
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.core.MultiMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.