Package org.springframework.tests.sample.beans

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


  @Test
  public void simpleValue() throws Exception {
    DefaultListableBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml");
    String name = "simple";
    //    beanFactory.getBean("simple1", DummyBean.class);
    DummyBean nameValue = beanFactory.getBean(name, DummyBean.class);
    assertEquals("simple", nameValue.getValue());
  }
View Full Code Here


  @Test
  public void simpleRef() throws Exception {
    DefaultListableBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml");
    String name = "simple-ref";
    //    beanFactory.getBean("name-value1", TestBean.class);
    DummyBean nameValue = beanFactory.getBean(name, DummyBean.class);
    assertEquals(beanFactory.getBean("name"), nameValue.getValue());
  }
View Full Code Here

  @Test
  public void nameRef() throws Exception {
    DefaultListableBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml");
    TestBean nameValue = beanFactory.getBean("name-value", TestBean.class);
    DummyBean nameRef = beanFactory.getBean("name-ref", DummyBean.class);

    assertEquals("some-name", nameRef.getName());
    assertEquals(nameValue, nameRef.getSpouse());
  }
View Full Code Here

  }

  @Test
  public void typeIndexedValue() throws Exception {
    DefaultListableBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml");
    DummyBean typeRef = beanFactory.getBean("indexed-value", DummyBean.class);

    assertEquals("at", typeRef.getName());
    assertEquals("austria", typeRef.getValue());
    assertEquals(10, typeRef.getAge());
  }
View Full Code Here

  }

  @Test
  public void typeIndexedRef() throws Exception {
    DefaultListableBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml");
    DummyBean typeRef = beanFactory.getBean("indexed-ref", DummyBean.class);

    assertEquals("some-name", typeRef.getName());
    assertEquals(beanFactory.getBean("name-value"), typeRef.getSpouse());
  }
View Full Code Here

  }

  @Test
  public void constructorWithNameEndingInRef() throws Exception {
    DefaultListableBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml");
    DummyBean derivedBean = beanFactory.getBean("beanWithRefConstructorArg", DummyBean.class);
    assertEquals(10, derivedBean.getAge());
    assertEquals("silly name", derivedBean.getName());
  }
View Full Code Here

TOP

Related Classes of org.springframework.tests.sample.beans.DummyBean

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.