Package org.springframework.beans

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


    assertSame(tb, beanRegistry.getSingleton("tb"));
    assertEquals(1, beanRegistry.getSingletonCount());
    assertEquals(1, beanRegistry.getSingletonNames().length);
    assertTrue(Arrays.asList(beanRegistry.getSingletonNames()).contains("tb"));
    assertFalse(tb.wasDestroyed());

    beanRegistry.destroySingletons();
    assertEquals(0, beanRegistry.getSingletonCount());
    assertEquals(0, beanRegistry.getSingletonNames().length);
    assertTrue(tb.wasDestroyed());
View Full Code Here


    assertFalse(tb.wasDestroyed());

    beanRegistry.destroySingletons();
    assertEquals(0, beanRegistry.getSingletonCount());
    assertEquals(0, beanRegistry.getSingletonNames().length);
    assertTrue(tb.wasDestroyed());
  }

}
View Full Code Here

    assertEquals("inner1", innerForConstructor.getName());
    assertEquals(6, innerForConstructor.getAge());

    xbf.destroySingletons();
    assertTrue(inner1.wasDestroyed());
    assertTrue(inner2.wasDestroyed());
    assertTrue(innerFactory.getName() == null);
    assertTrue(inner5.wasDestroyed());
  }

  public void testInnerBeansWithoutDestroy() {
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

      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

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.