Package org.springframework.tests.sample.beans

Examples of org.springframework.tests.sample.beans.HasMap


    assertEquals(hasMap.getProps().getClass(), Properties.class);
  }

  @Test
  public void testPopulatedProps() throws Exception {
    HasMap hasMap = (HasMap) this.beanFactory.getBean("props");
    assertTrue(hasMap.getProps().size() == 2);
    assertTrue(hasMap.getProps().get("foo").equals("bar"));
    assertTrue(hasMap.getProps().get("2").equals("TWO"));
  }
View Full Code Here


    assertTrue(hasMap.getProps().get("2").equals("TWO"));
  }

  @Test
  public void testObjectArray() throws Exception {
    HasMap hasMap = (HasMap) this.beanFactory.getBean("objectArray");
    assertTrue(hasMap.getObjectArray().length == 2);
    assertTrue(hasMap.getObjectArray()[0].equals("one"));
    assertTrue(hasMap.getObjectArray()[1].equals(this.beanFactory.getBean("jenny")));
  }
View Full Code Here

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

  @Test
  public void testClassArray() throws Exception {
    HasMap hasMap = (HasMap) this.beanFactory.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));
  }

  @Test
  public void testIntegerArray() throws Exception {
    HasMap hasMap = (HasMap) this.beanFactory.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

    assertTrue(hasMap.getIntegerArray()[2].intValue() == 2);
  }

  @Test
  public void testProps() throws Exception {
    HasMap hasMap = (HasMap) this.beanFactory.getBean("props");
    assertEquals(2, hasMap.getProps().size());
    assertEquals("bar", hasMap.getProps().getProperty("foo"));
    assertEquals("TWO", hasMap.getProps().getProperty("2"));

    HasMap hasMap2 = (HasMap) this.beanFactory.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.tests.sample.beans.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.