Package org.springframework.tests.sample.beans

Examples of org.springframework.tests.sample.beans.DerivedTestBean.wasDestroyed()


      assertEquals(session.getAttribute(name), bean);
      assertSame(bean, this.beanFactory.getBean(name));

      requestAttributes.requestCompleted();
      session.invalidate();
      assertTrue(bean.wasDestroyed());
    }
    finally {
      RequestContextHolder.setRequestAttributes(null);
    }
  }
View Full Code Here


      assertEquals(session.getAttribute(name), bean);
      assertSame(bean, this.beanFactory.getBean(name));

      requestAttributes.requestCompleted();
      serializedState = session.serializeState();
      assertFalse(bean.wasDestroyed());
    }
    finally {
      RequestContextHolder.setRequestAttributes(null);
    }
View Full Code Here

      assertEquals(session.getAttribute(name), bean);
      assertSame(bean, this.beanFactory.getBean(name));

      requestAttributes.requestCompleted();
      session.invalidate();
      assertTrue(bean.wasDestroyed());

      if (beanNameReset) {
        assertNull(bean.getBeanName());
      }
      else {
View Full Code Here

  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() {
    DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
View Full Code Here

      DerivedTestBean bean = (DerivedTestBean) this.beanFactory.getBean(name);
      assertSame(bean, request.getAttribute(name));
      assertSame(bean, this.beanFactory.getBean(name));

      requestAttributes.requestCompleted();
      assertTrue(bean.wasDestroyed());
    }
    finally {
      RequestContextHolder.setRequestAttributes(null);
    }
  }
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.