Package java.util

Examples of java.util.Map.containsKey()


  public void testSimpleReverse() {
    A source = new A();
    source.setB(new B());
    Map dest = mapper.map(source, HashMap.class, NULL);
    assertNotNull(dest);
    assertTrue(dest.containsKey("key"));
    assertNotNull(dest.get("key"));
  }

  @Test
  public void testNull() {
View Full Code Here


  public void testNullReverse() {
    A source = new A();
    source.setB(null);
    Map dest = mapper.map(source, HashMap.class, NULL);
    assertNotNull(dest);
    assertTrue(dest.containsKey("key"));
    assertNull(dest.get("key"));
  }

  @Test
  public void testNullReverse_NoNullMApping() {
View Full Code Here

  public void testNullReverse_NoNullMApping() {
    A source = new A();
    source.setB(null);
    Map dest = mapper.map(source, HashMap.class, NOT_NULL);
    assertNotNull(dest);
    assertFalse(dest.containsKey("key"));
  }

  @Test
  public void testNullSet() {
    NamesArray namesArray = new NamesArray();
View Full Code Here

                int groupId = item.getGroupId();
                int itemType = item.getItemType();

                if (itemType == SSIItem.TYPE_GROUP) {

                    if (!groupNameMap.containsKey(new Integer(groupId))) {
                        groupMap.put(item.getItemName(), new LinkedList());
                        groupNameMap.put(new Integer(groupId), item.getItemName());
                    }
                   
                } else if (itemType == SSIItem.TYPE_BUDDY) {
View Full Code Here

   {
      cache1.put(fqn, key, "value");

      // test that this has propagated.
      Map map = loader1.get(fqn);
      assertTrue("Should contain key", map.containsKey(key));
      assertEquals("value", map.get(key));
      assertEquals(1, map.size());

      map = loader2.get(fqn);
      assertTrue("Should contain key", map.containsKey(key));
View Full Code Here

      assertTrue("Should contain key", map.containsKey(key));
      assertEquals("value", map.get(key));
      assertEquals(1, map.size());

      map = loader2.get(fqn);
      assertTrue("Should contain key", map.containsKey(key));
      assertEquals("value", map.get(key));
      assertEquals(1, map.size());

      cache1.evict(fqn);
View Full Code Here

      cache1.evict(fqn);

      // now cache 1 should not have this but cache 2 should.
      // loader1 looks at cache2 while loader2 looks at cache1
      map = loader1.get(fqn);
      assertTrue(map.containsKey(key));
      assertEquals("value", map.get(key));
      assertEquals(1, map.size());

      assertNull("Expecting null", loader2.get(fqn));
      map = loader2.get(fqn);
View Full Code Here

      // calling a get on cache1 should cause the loader to retrieve the node from cache2
      assertEquals("value", cache1.get(fqn, key));
      // and now loader2 should see it
      map = loader2.get(fqn);
      assertTrue(map.containsKey(key));
      assertEquals("value", map.get(key));
      assertEquals(1, map.size());
   }

   public void testGetChildrenNames() throws Exception
View Full Code Here

      Map map2 = serializeAndDeserialize(map);

      assert map2 instanceof FastCopyHashMap;
      assert map2.size() == map.size();
      for (Object key : map.keySet()) assert map2.containsKey(key);
   }

   public void testNonexistentKey() throws Exception
   {
      Map map = new FastCopyHashMap();
View Full Code Here

            return null;
            }
        }

        // Look for key at the end
        if(node.containsKey(DESCRIPTOR_KEY)) {
            // This is the end - return descriptor
            return (FunctionDescriptor) node.get(DESCRIPTOR_KEY);
        }
        // No descriptor at this location in tree
        return null;
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.