Examples of wasDestroyed()


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

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

    assertFalse(tb.wasDestroyed());

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

}
View Full Code Here

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

    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

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

      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

Examples of org.springframework.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

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

      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

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

      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

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

    FactoryMethods fm2 = (FactoryMethods) xbf.getBean("full");
    assertSame(fm, fm2);

    xbf.destroySingletons();
    assertTrue(tb.wasDestroyed());
  }

  public void testFactoryMethodsWithNullInstance() {
    DefaultListableBeanFactory xbf = new DefaultListableBeanFactory();
    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(xbf);
View Full Code Here

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

      assertNotNull(request.getAttribute(outerBeanName));
      TestBean inner1 = (TestBean) outer1.getSpouse();
      assertSame(outer1, this.beanFactory.getBean(outerBeanName));
      requestAttributes.requestCompleted();
      assertTrue(outer1.wasDestroyed());
      assertTrue(inner1.wasDestroyed());
      request = new MockHttpServletRequest();
      requestAttributes = new ServletRequestAttributes(request);
      RequestContextHolder.setRequestAttributes(requestAttributes);
      TestBean outer2 = (TestBean) this.beanFactory.getBean(outerBeanName);
      assertNotSame(outer1, outer2);
View Full Code Here

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

      assertNull(request.getAttribute(NAME));
      DerivedTestBean bean = ac.getBean(NAME, DerivedTestBean.class);
      assertSame(bean, request.getAttribute(NAME));
      assertSame(bean, ac.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.