Package com.hazelcast.core

Examples of com.hazelcast.core.MultiMap.lock()


    @Test(expected = NullPointerException.class)
    public void testLock_whenNullKey() {
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(1);
        MultiMap multiMap = getMultiMap(factory.newInstances(), randomString());

        multiMap.lock(null);
    }

    @Test(expected = NullPointerException.class)
    public void testUnlock_whenNullKey() {
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(1);
View Full Code Here


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

    @Test(expected = NullPointerException.class)
    public void testLock_whenKeyNull() throws Exception {
View Full Code Here

    }

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

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

    @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));
    }

    @Test
View Full Code Here

    @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

    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));
    }

    @Test(expected = IllegalMonitorStateException.class)
View Full Code Here

    @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));
    }

    @Test
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));
    }

    @Test
    public void testTryLock() throws Exception {
View Full Code Here

    @Test
    public void testTryLock_whenLockedBySelf() throws Exception {
        final MultiMap mm = client.getMultiMap(randomString());
        final Object key = "Key";
        mm.lock(key);
        assertTrue(mm.tryLock(key));
    }

    @Test
    public void testTryLock_whenLockedByOther() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.