Package org.springframework.beans.factory

Examples of org.springframework.beans.factory.HasMap


    assertTrue(hasMap.getObjectArray()[1].equals(xbf.getBean("jenny")));
  }

  public void testClassArray() throws Exception {
    XmlBeanFactory xbf = new XmlBeanFactory(new ClassPathResource("collections.xml", getClass()));
    HasMap hasMap = (HasMap) xbf.getBean("classArray");
    assertTrue(hasMap.getClassArray().length == 2);
    assertTrue(hasMap.getClassArray()[0].equals(String.class));
    assertTrue(hasMap.getClassArray()[1].equals(Exception.class));
  }
View Full Code Here


    assertTrue(hasMap.getClassArray()[1].equals(Exception.class));
  }

  public void testIntegerArray() throws Exception {
    XmlBeanFactory xbf = new XmlBeanFactory(new ClassPathResource("collections.xml", getClass()));
    HasMap hasMap = (HasMap) xbf.getBean("integerArray");
    assertTrue(hasMap.getIntegerArray().length == 3);
    assertTrue(hasMap.getIntegerArray()[0].intValue() == 0);
    assertTrue(hasMap.getIntegerArray()[1].intValue() == 1);
    assertTrue(hasMap.getIntegerArray()[2].intValue() == 2);
  }
View Full Code Here

  }

  public void testProps() throws Exception {
    XmlBeanFactory xbf = new XmlBeanFactory(new ClassPathResource("collections.xml", getClass()));

    HasMap hasMap = (HasMap) xbf.getBean("props");
    assertEquals(2, hasMap.getProps().size());
    assertEquals("bar", hasMap.getProps().getProperty("foo"));
    assertEquals("TWO", hasMap.getProps().getProperty("2"));

    HasMap hasMap2 = (HasMap) xbf.getBean("propsViaMap");
    assertEquals(2, hasMap2.getProps().size());
    assertEquals("bar", hasMap2.getProps().getProperty("foo"));
    assertEquals("TWO", hasMap2.getProps().getProperty("2"));
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.HasMap

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.