Package org.springframework.beans

Examples of org.springframework.beans.GenericIntegerBean


    bf.registerSingleton("resource1", new UrlResource("http://localhost:8080"));
    bf.registerSingleton("resource2", new UrlResource("http://localhost:9090"));

    RootBeanDefinition rbd = new RootBeanDefinition(GenericIntegerBean.class, RootBeanDefinition.AUTOWIRE_BY_TYPE);
    bf.registerBeanDefinition("genericBean", rbd);
    GenericIntegerBean gb = (GenericIntegerBean) bf.getBean("genericBean");

    assertEquals(new UrlResource("http://localhost:8080"), gb.getResourceList().get(0));
    assertEquals(new UrlResource("http://localhost:9090"), gb.getResourceList().get(1));
  }
View Full Code Here


    assertEquals(new URL("http://localhost:8080"), map.values().iterator().next());
  }

  public void testGenericallyTypedIntegerBean() throws Exception {
    XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("genericBeanTests.xml", getClass()));
    GenericIntegerBean gb = (GenericIntegerBean) bf.getBean("integerBean");
    assertEquals(new Integer(10), gb.getGenericProperty());
    assertEquals(new Integer(20), gb.getGenericListProperty().get(0));
    assertEquals(new Integer(30), gb.getGenericListProperty().get(1));
  }
View Full Code Here

    bf.registerSingleton("resource1", new UrlResource("http://localhost:8080"));
    bf.registerSingleton("resource2", new UrlResource("http://localhost:9090"));

    RootBeanDefinition rbd = new RootBeanDefinition(GenericIntegerBean.class, RootBeanDefinition.AUTOWIRE_BY_TYPE);
    bf.registerBeanDefinition("genericBean", rbd);
    GenericIntegerBean gb = (GenericIntegerBean) bf.getBean("genericBean");

    assertEquals(new UrlResource("http://localhost:8080"), gb.getResourceList().get(0));
    assertEquals(new UrlResource("http://localhost:9090"), gb.getResourceList().get(1));
  }
View Full Code Here

    assertEquals(new URL("http://localhost:8080"), map.values().iterator().next());
  }

  public void testGenericallyTypedIntegerBean() throws Exception {
    XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("genericBeanTests.xml", getClass()));
    GenericIntegerBean gb = (GenericIntegerBean) bf.getBean("integerBean");
    assertEquals(new Integer(10), gb.getGenericProperty());
    assertEquals(new Integer(20), gb.getGenericListProperty().get(0));
    assertEquals(new Integer(30), gb.getGenericListProperty().get(1));
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.GenericIntegerBean

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.