Package org.springframework.beans.factory.support

Examples of org.springframework.beans.factory.support.StaticListableBeanFactory


    dependentBeansBF.preInstantiateSingletons();
    this.listableBeanFactory = child;
  }

  public void testHierarchicalCountBeansWithNonHierarchicalFactory() {
    StaticListableBeanFactory lbf = new StaticListableBeanFactory();
    lbf.addBean("t1", new TestBean());
    lbf.addBean("t2", new TestBean());
    assertTrue(BeanFactoryUtils.countBeansIncludingAncestors(lbf) == 2);
  }
View Full Code Here


    assertTrue(names.contains("testFactory1"));
    assertTrue(names.contains("testFactory2"));
  }

  public void testNoBeansOfType() {
    StaticListableBeanFactory lbf = new StaticListableBeanFactory();
    lbf.addBean("foo", new Object());
    Map beans = BeanFactoryUtils.beansOfTypeIncludingAncestors(lbf, ITestBean.class, true, false);
    assertTrue(beans.isEmpty());
  }
View Full Code Here

    Map beans = BeanFactoryUtils.beansOfTypeIncludingAncestors(lbf, ITestBean.class, true, false);
    assertTrue(beans.isEmpty());
  }

  public void testFindsBeansOfTypeWithStaticFactory() {
    StaticListableBeanFactory lbf = new StaticListableBeanFactory();
    TestBean t1 = new TestBean();
    TestBean t2 = new TestBean();
    DummyFactory t3 = new DummyFactory();
    DummyFactory t4 = new DummyFactory();
    t4.setSingleton(false);
    lbf.addBean("t1", t1);
    lbf.addBean("t2", t2);
    lbf.addBean("t3", t3);
    lbf.addBean("t4", t4);

    Map beans = BeanFactoryUtils.beansOfTypeIncludingAncestors(lbf, ITestBean.class, true, false);
    assertEquals(2, beans.size());
    assertEquals(t1, beans.get("t1"));
    assertEquals(t2, beans.get("t2"));
View Full Code Here

public class FlowModelFlowBuilderTests extends TestCase {
  private FlowModel model;

  protected void setUp() {
    StaticListableBeanFactory beanFactory = new StaticListableBeanFactory();
    beanFactory.addBean("bean", new Object());
    model = new FlowModel();
  }
View Full Code Here

public class XmlFlowModelBuilderTests extends TestCase {

  private FlowModelRegistry registry;

  protected void setUp() {
    StaticListableBeanFactory beanFactory = new StaticListableBeanFactory();
    beanFactory.addBean("bean", new Object());
    registry = new FlowModelRegistryImpl();
  }
View Full Code Here

  private TestNavigationHandler origNavHandler;
  private DelegatingNavigationHandlerProxy delNavHandler;

  protected void setUp() {
    facesContext = new MockFacesContext();
    beanFactory = new StaticListableBeanFactory();
    origNavHandler = new TestNavigationHandler();

    delNavHandler = new DelegatingNavigationHandlerProxy(origNavHandler) {
      protected BeanFactory getBeanFactory(FacesContext facesContext) {
        return beanFactory;
View Full Code Here

  private StaticListableBeanFactory beanFactory;
  private DelegatingPhaseListenerMulticaster delPhaseListener;

  protected void setUp() {
    facesContext = new MockFacesContext();
    beanFactory = new StaticListableBeanFactory();

    delPhaseListener = new DelegatingPhaseListenerMulticaster() {
      protected ListableBeanFactory getBeanFactory(FacesContext facesContext) {
        return beanFactory;
      }
View Full Code Here

  public void testSfsb() throws CreateException {
    MockControl mc = MockControl.createControl(SessionContext.class);
    SessionContext sc = (SessionContext) mc.getMock();
    mc.replay();
   
    final BeanFactory bf = new StaticListableBeanFactory();
    BeanFactoryLocator bfl = new BeanFactoryLocator() {
      public BeanFactoryReference useBeanFactory(String factoryKey)
          throws FatalBeanException {
        return new BeanFactoryReference() {
          public BeanFactory getFactory() {
View Full Code Here

  public void testSlsb() throws Exception {
    MockControl mc = MockControl.createControl(SessionContext.class);
    SessionContext sc = (SessionContext) mc.getMock();
    mc.replay();
   
    final BeanFactory bf = new StaticListableBeanFactory();
    BeanFactoryLocator bfl = new BeanFactoryLocator() {
      public BeanFactoryReference useBeanFactory(String factoryKey) throws FatalBeanException {
        return new BeanFactoryReference() {
          public BeanFactory getFactory() {
            return bf;
View Full Code Here

  public void testJmsMdb() throws Exception {
    MockControl mc = MockControl.createControl(MessageDrivenContext.class);
    MessageDrivenContext sc = (MessageDrivenContext) mc.getMock();
    mc.replay();
 
    final BeanFactory bf = new StaticListableBeanFactory();
    BeanFactoryLocator bfl = new BeanFactoryLocator() {
      public BeanFactoryReference useBeanFactory(String factoryKey) throws FatalBeanException {
        return new BeanFactoryReference() {
          public BeanFactory getFactory() {
            return bf;
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.support.StaticListableBeanFactory

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.