Package net.openhft.collections

Examples of net.openhft.collections.SharedHashMap


     * replace(null, x, y) throws NPE
     */
    @Test
    public void testReplaceValue_NullPointerException() throws IOException {
        try {
            SharedHashMap c = newShmIntString(5);
            c.replace(null, "A", "whatever");
            shouldThrow();
        } catch (NullPointerException success) {
        }
    }
View Full Code Here


     * putIfAbsent(x, null) throws NPE
     */
    @Test
    public void testPutIfAbsent2_NullPointerException() throws IOException {
        try {
            SharedHashMap c = newShmIntString(5);
            c.putIfAbsent(notPresent, null);
            shouldThrow();
        } catch (NullPointerException success) {
        }
    }
View Full Code Here

     * replace(x, null) throws NPE
     */
    @Test
    public void testReplace2_NullPointerException() throws IOException {
        try {
            SharedHashMap c = newShmIntString(5);
            c.replace(notPresent, null);
            shouldThrow();
        } catch (NullPointerException success) {
        }
    }
View Full Code Here

     * replace(x, null, y) throws NPE
     */
    @Test
    public void testReplaceValue2_NullPointerException() throws IOException {
        try {
            SharedHashMap c = newShmIntString(5);
            c.replace(notPresent, null, "A");
            shouldThrow();
        } catch (NullPointerException success) {
        }
    }
View Full Code Here

     * replace(x, y, null) throws NPE
     */
    @Test
    public void testReplaceValue3_NullPointerException() throws IOException {
        try {
            SharedHashMap c = newShmIntString(5);
            c.replace(notPresent, "A", null);
            shouldThrow();
        } catch (NullPointerException success) {
        }
    }
View Full Code Here

     * remove(null) throws NPE
     */
    @Test
    public void testRemove1_NullPointerException() throws IOException {
        try {
            SharedHashMap c = newShmStringString(5);
            c.put("sadsdf", "asdads");
            c.remove(null);
            shouldThrow();
        } catch (NullPointerException success) {
        }
    }
View Full Code Here

     * remove(null, x) throws NPE
     */
    @Test
    public void testRemove2_NullPointerException() throws IOException {
        try {
            SharedHashMap c = newShmStringString(5);
            c.put("sadsdf", "asdads");
            c.remove(null, "whatever");
            shouldThrow();
        } catch (NullPointerException success) {
        }
    }
View Full Code Here

    /**
     * remove(x, null) returns false
     */
    @Test
    public void testRemove3() throws IOException {
        SharedHashMap c = newShmStringString(5);
        c.put("sadsdf", "asdads");
        assertFalse(c.remove("sadsdf", null));
    }
View Full Code Here

        }
    }

    static void closeMap(Map map) {
        if (map instanceof SharedHashMap) {
            SharedHashMap shm = (SharedHashMap) map;
            try {
                shm.close();
            } catch (IOException e) {
                throw new RuntimeException("Can't close SHM : " + e);
            }
        }
    }
View Full Code Here

TOP

Related Classes of net.openhft.collections.SharedHashMap

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.