Package java.util

Examples of java.util.HashMap.containsValue()


    public void testMap() {
        Map map = new HashMap(ColorEnum.getEnumMap());

        assertNotNull(map);
        assertTrue(map.containsValue(ColorEnum.RED));
        assertTrue(map.containsValue(ColorEnum.GREEN));
        assertTrue(map.containsValue(ColorEnum.BLUE));
        assertSame(ColorEnum.RED, map.get("Red"));
        assertSame(ColorEnum.GREEN, map.get("Green"));
        assertSame(ColorEnum.BLUE, map.get("Blue"));
        assertEquals(map.keySet().size(), ColorEnum.getEnumList().size());
View Full Code Here


        Map map = new HashMap(ColorEnum.getEnumMap());

        assertNotNull(map);
        assertTrue(map.containsValue(ColorEnum.RED));
        assertTrue(map.containsValue(ColorEnum.GREEN));
        assertTrue(map.containsValue(ColorEnum.BLUE));
        assertSame(ColorEnum.RED, map.get("Red"));
        assertSame(ColorEnum.GREEN, map.get("Green"));
        assertSame(ColorEnum.BLUE, map.get("Blue"));
        assertEquals(map.keySet().size(), ColorEnum.getEnumList().size());
    }
View Full Code Here

                    Assert.fail("Prefix mapping for 'xml' must not be exported.");
                }

                String uri = (String) prefixes.get(prefix);
                checkCondition("Exported uri " + uri + " is not a registered namespace.",
                        sessionNamespaces.containsValue(uri));
                checkCondition("Exported prefix " + prefix + " does not match " +
                        "current namespacce mapping in Session",
                        sessionNamespaces.containsKey(prefix));
            }
        } catch (RepositoryException re) {
View Full Code Here

                    Assert.fail("Prefix mapping for 'xml' must not be exported.");
                }

                String uri = (String) prefixes.get(prefix);
                checkCondition("Exported uri " + uri + " is not a registered namespace.",
                        sessionNamespaces.containsValue(uri));
                checkCondition("Exported prefix " + prefix + " does not match " +
                        "current namespacce mapping in Session",
                        sessionNamespaces.containsKey(prefix));
            }
        } catch (RepositoryException re) {
View Full Code Here

        Map entries = new HashMap();

        Color c = new Color( "blah", 0, entries );

        assertTrue( entries.containsKey("blah") );
        assertTrue( entries.containsValue(c) );

        OtherColor c2 = new OtherColor( "blah", 0, entries );
        assertTrue( entries.containsKey("blah") );
        assertFalse( entries.containsValue(c) );
        assertTrue( entries.containsValue(c2) );
View Full Code Here

        assertTrue( entries.containsKey("blah") );
        assertTrue( entries.containsValue(c) );

        OtherColor c2 = new OtherColor( "blah", 0, entries );
        assertTrue( entries.containsKey("blah") );
        assertFalse( entries.containsValue(c) );
        assertTrue( entries.containsValue(c2) );
    }

    public void testEquals()
    {
View Full Code Here

        assertTrue( entries.containsValue(c) );

        OtherColor c2 = new OtherColor( "blah", 0, entries );
        assertTrue( entries.containsKey("blah") );
        assertFalse( entries.containsValue(c) );
        assertTrue( entries.containsValue(c2) );
    }

    public void testEquals()
    {
        assertTrue( Color.RED.equals( Color.RED ) );
View Full Code Here

        Map entries = new HashMap();

        Color c = new Color( "blah", entries );

        assertTrue( entries.containsKey("blah") );
        assertTrue( entries.containsValue(c) );

        OtherColor c2 = new OtherColor( "blah", entries );
        assertTrue( entries.containsKey("blah") );
        assertFalse( entries.containsValue(c) );
        assertTrue( entries.containsValue(c2) );
View Full Code Here

        assertTrue( entries.containsKey("blah") );
        assertTrue( entries.containsValue(c) );

        OtherColor c2 = new OtherColor( "blah", entries );
        assertTrue( entries.containsKey("blah") );
        assertFalse( entries.containsValue(c) );
        assertTrue( entries.containsValue(c2) );
    }

    public void testEquals()
    {
View Full Code Here

        assertTrue( entries.containsValue(c) );

        OtherColor c2 = new OtherColor( "blah", entries );
        assertTrue( entries.containsKey("blah") );
        assertFalse( entries.containsValue(c) );
        assertTrue( entries.containsValue(c2) );
    }

    public void testEquals()
    {
        assertTrue( Color.RED.equals( Color.RED ) );
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.