Package org.springframework.beans.factory.support

Examples of org.springframework.beans.factory.support.DefaultListableBeanFactory.destroyBean()


  @Test
  public void testCreateBean() {
    DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
    TestBean tb = lbf.createBean(TestBean.class);
    assertSame(lbf, tb.getBeanFactory());
    lbf.destroyBean(tb);
  }

  @Test
  public void testCreateBeanWithDisposableBean() {
    DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
View Full Code Here


  @Test
  public void testCreateBeanWithDisposableBean() {
    DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
    DerivedTestBean tb = lbf.createBean(DerivedTestBean.class);
    assertSame(lbf, tb.getBeanFactory());
    lbf.destroyBean(tb);
    assertTrue(tb.wasDestroyed());
  }

  @Test
  public void testConfigureBean() {
View Full Code Here

    ResourceInjectionBean anotherBean = (ResourceInjectionBean) bf.getBean("annotatedBean");
    assertNotSame(anotherBean, bean);
    assertNotSame(anotherBean.getTestBean(), tb);
    assertNotSame(anotherBean.getTestBean2(), tb2);

    bf.destroyBean("annotatedBean", bean);
    assertTrue(bean.destroyCalled);
    assertTrue(bean.destroy2Called);
    assertTrue(bean.destroy3Called);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.