Package org.springframework.osgi.util.internal

Examples of org.springframework.osgi.util.internal.MapBasedDictionary


  protected void tearDown() throws Exception {
    dict = null;
  }

  public void testDictionaryWithNullMap() {
    dict = new MapBasedDictionary((Map) null);
    assertTrue(dict.isEmpty());
  }
View Full Code Here


  public void testDictionaryWithDictionary() {
    Dictionary dict = new Properties();
    dict.put("joe", "satriani");

    Dictionary wrapper = new MapBasedDictionary(dict);
    assertEquals(wrapper, dict);
  }
View Full Code Here

  public void testPutAllDictionary() {
    Dictionary dict = new Properties();
    dict.put("joe", "satriani");

    MapBasedDictionary wrapper = new MapBasedDictionary();
    wrapper.putAll(dict);
    assertEquals(wrapper, dict);
  }
View Full Code Here

  public void testValues() throws Exception {
    Dictionary dict = new Properties();
    dict.put("joe", "satriani");

    MapBasedDictionary wrapper = new MapBasedDictionary();
    wrapper.putAll(dict);

    Enumeration enm1 = dict.elements();
    Enumeration enm2 = wrapper.elements();

    while (enm1.hasMoreElements()) {
      assertTrue(enm2.hasMoreElements());
      assertEquals(enm1.nextElement(), enm2.nextElement());
    }
View Full Code Here

  public void testClear() throws Exception {
    Dictionary dict = new Properties();
    dict.put("joe", "satriani");

    MapBasedDictionary wrapper = new MapBasedDictionary();
    wrapper.putAll(dict);
    assertEquals(1, wrapper.size());
    wrapper.clear();
    assertEquals(0, wrapper.size());
  }
View Full Code Here

  public void testContainsKey() throws Exception {
    Dictionary dict = new Properties();
    dict.put("joe", "satriani");

    MapBasedDictionary wrapper = new MapBasedDictionary();
    wrapper.putAll(dict);
    assertTrue(wrapper.containsKey("joe"));
  }
View Full Code Here

  public void testValue() throws Exception {
    Dictionary dict = new Properties();
    dict.put("joe", "satriani");

    MapBasedDictionary wrapper = new MapBasedDictionary();
    wrapper.putAll(dict);
    assertTrue(wrapper.containsValue("satriani"));
  }
View Full Code Here

    wrapper.putAll(dict);
    assertTrue(wrapper.containsValue("satriani"));
  }

  public void testHashCode() throws Exception {
    MapBasedDictionary wrapper1 = new MapBasedDictionary();
    MapBasedDictionary wrapper2 = new MapBasedDictionary();
    assertEquals(wrapper1.hashCode(), wrapper2.hashCode());
    wrapper1.put(new Object(), new Object());
    assertFalse(wrapper1.hashCode() == wrapper2.hashCode());
  }
View Full Code Here

    CustomListener.REG_CALLS = 0;
    CustomListener.UNREG_CALLS = 0;
    CustomListener.REG_PROPS = new ArrayList();
    CustomListener.UNREG_PROPS = new ArrayList();
    props = new MapBasedDictionary(0);
  }
View Full Code Here

TOP

Related Classes of org.springframework.osgi.util.internal.MapBasedDictionary

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.