Package org.springframework.context.support

Examples of org.springframework.context.support.GenericApplicationContext.containsBean()


    postProcessor.setBeanFactory(context.getBeanFactory());
    postProcessor.afterPropertiesSet();
    TestBean testBean = new TestBean();
    postProcessor.postProcessAfterInitialization(testBean, "testBean");
    context.refresh();
    assertTrue(context.containsBean("testBean.test.onContainerStart"));
    Object endpoint = context.getBean("testBean.test.onContainerStart");
    assertTrue(endpoint instanceof ContainerHandler);
    context.stop();
  }
View Full Code Here


    int beanCount = scanner.scan(BASE_PACKAGE);
    assertEquals(9, beanCount);
    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
  }

  public void testSimpleScanWithDefaultFiltersAndOverridingBean() {
    GenericApplicationContext context = new GenericApplicationContext();
View Full Code Here

    assertEquals(9, beanCount);
    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
  }

  public void testSimpleScanWithDefaultFiltersAndOverridingBean() {
    GenericApplicationContext context = new GenericApplicationContext();
    context.registerBeanDefinition("stubFooDao", new RootBeanDefinition(TestBean.class));
View Full Code Here

    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context);
    scanner.setIncludeAnnotationConfig(false);
    int beanCount = scanner.scan(BASE_PACKAGE);
    assertEquals(8, beanCount);
    assertEquals(9, context.getBeanDefinitionCount());
    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
  }
View Full Code Here

    scanner.setIncludeAnnotationConfig(false);
    int beanCount = scanner.scan(BASE_PACKAGE);
    assertEquals(8, beanCount);
    assertEquals(9, context.getBeanDefinitionCount());
    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
  }
View Full Code Here

    int beanCount = scanner.scan(BASE_PACKAGE);
    assertEquals(8, beanCount);
    assertEquals(9, context.getBeanDefinitionCount());
    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
  }

  public void testSimpleScanWithDefaultFiltersAndOverriddenCompatibleNamedBean() {
View Full Code Here

    assertEquals(8, beanCount);
    assertEquals(9, context.getBeanDefinitionCount());
    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
  }

  public void testSimpleScanWithDefaultFiltersAndOverriddenCompatibleNamedBean() {
    GenericApplicationContext context = new GenericApplicationContext();
View Full Code Here

    assertEquals(9, context.getBeanDefinitionCount());
    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
  }

  public void testSimpleScanWithDefaultFiltersAndOverriddenCompatibleNamedBean() {
    GenericApplicationContext context = new GenericApplicationContext();
    RootBeanDefinition bd = new RootBeanDefinition(NamedStubDao.class);
View Full Code Here

    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context);
    scanner.setIncludeAnnotationConfig(false);
    int beanCount = scanner.scan(BASE_PACKAGE);
    assertEquals(8, beanCount);
    assertEquals(9, context.getBeanDefinitionCount());
    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
  }
View Full Code Here

    scanner.setIncludeAnnotationConfig(false);
    int beanCount = scanner.scan(BASE_PACKAGE);
    assertEquals(8, beanCount);
    assertEquals(9, context.getBeanDefinitionCount());
    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
  }
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.