Package org.springframework.beans.factory.config

Examples of org.springframework.beans.factory.config.ListFactoryBean


* @since 19.12.2004
*/
public class XmlBeanCollectionTests extends TestCase {

  public void testCollectionFactoryDefaults() throws Exception {
    ListFactoryBean listFactory = new ListFactoryBean();
    listFactory.setSourceList(new LinkedList());
    listFactory.afterPropertiesSet();
    assertTrue(listFactory.getObject() instanceof ArrayList);

    SetFactoryBean setFactory = new SetFactoryBean();
    setFactory.setSourceSet(new TreeSet());
    setFactory.afterPropertiesSet();
    assertTrue(setFactory.getObject() instanceof LinkedHashSet);
View Full Code Here


        new ClassPathResource("collections.xml", getClass()));
  }

  @Test
  public void testCollectionFactoryDefaults() throws Exception {
    ListFactoryBean listFactory = new ListFactoryBean();
    listFactory.setSourceList(new LinkedList());
    listFactory.afterPropertiesSet();
    assertTrue(listFactory.getObject() instanceof ArrayList);

    SetFactoryBean setFactory = new SetFactoryBean();
    setFactory.setSourceSet(new TreeSet());
    setFactory.afterPropertiesSet();
    assertTrue(setFactory.getObject() instanceof LinkedHashSet);
View Full Code Here

    public @Bean Object stringBean() {
      return "foo";
    }

    public @Bean FactoryBean<?> factoryBean() {
      ListFactoryBean fb = new ListFactoryBean();
      fb.setSourceList(Arrays.asList("element1", "element2"));
      return fb;
    }
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.config.ListFactoryBean

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.