Package org.springframework.context.support

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


    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
    assertTrue(context.containsBean(AnnotationConfigUtils.AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
    assertTrue(context.containsBean(AnnotationConfigUtils.COMMON_ANNOTATION_PROCESSOR_BEAN_NAME));
    assertTrue(context.containsBean(AnnotationConfigUtils.REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
  }

  public void testCustomAssignableTypeExcludeFilterAndDefaultsWithoutPostProcessors() {
    GenericApplicationContext context = new GenericApplicationContext();
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context, true);
View Full Code Here


    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context, true);
    scanner.setIncludeAnnotationConfig(false);
    scanner.addExcludeFilter(new AssignableTypeFilter(FooService.class));
    int beanCount = scanner.scan(BASE_PACKAGE);
    assertEquals(8, beanCount);
    assertFalse(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
    assertFalse(context.containsBean(AnnotationConfigUtils.AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
View Full Code Here

    scanner.setIncludeAnnotationConfig(false);
    scanner.addExcludeFilter(new AssignableTypeFilter(FooService.class));
    int beanCount = scanner.scan(BASE_PACKAGE);
    assertEquals(8, beanCount);
    assertFalse(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
    assertFalse(context.containsBean(AnnotationConfigUtils.AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
    assertFalse(context.containsBean(AnnotationConfigUtils.COMMON_ANNOTATION_PROCESSOR_BEAN_NAME));
View Full Code Here

    scanner.addExcludeFilter(new AssignableTypeFilter(FooService.class));
    int beanCount = scanner.scan(BASE_PACKAGE);
    assertEquals(8, beanCount);
    assertFalse(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
    assertFalse(context.containsBean(AnnotationConfigUtils.AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
    assertFalse(context.containsBean(AnnotationConfigUtils.COMMON_ANNOTATION_PROCESSOR_BEAN_NAME));
    assertFalse(context.containsBean(AnnotationConfigUtils.REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
View Full Code Here

    int beanCount = scanner.scan(BASE_PACKAGE);
    assertEquals(8, beanCount);
    assertFalse(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
    assertFalse(context.containsBean(AnnotationConfigUtils.AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
    assertFalse(context.containsBean(AnnotationConfigUtils.COMMON_ANNOTATION_PROCESSOR_BEAN_NAME));
    assertFalse(context.containsBean(AnnotationConfigUtils.REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
  }
View Full Code Here

    assertEquals(8, beanCount);
    assertFalse(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
    assertFalse(context.containsBean(AnnotationConfigUtils.AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
    assertFalse(context.containsBean(AnnotationConfigUtils.COMMON_ANNOTATION_PROCESSOR_BEAN_NAME));
    assertFalse(context.containsBean(AnnotationConfigUtils.REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
  }
View Full Code Here

    assertFalse(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
    assertFalse(context.containsBean(AnnotationConfigUtils.AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
    assertFalse(context.containsBean(AnnotationConfigUtils.COMMON_ANNOTATION_PROCESSOR_BEAN_NAME));
    assertFalse(context.containsBean(AnnotationConfigUtils.REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
  }

  public void testMultipleCustomExcludeFiltersAndDefaults() {
View Full Code Here

    assertTrue(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
    assertFalse(context.containsBean(AnnotationConfigUtils.AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
    assertFalse(context.containsBean(AnnotationConfigUtils.COMMON_ANNOTATION_PROCESSOR_BEAN_NAME));
    assertFalse(context.containsBean(AnnotationConfigUtils.REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
  }

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

    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
    assertFalse(context.containsBean(AnnotationConfigUtils.AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
    assertFalse(context.containsBean(AnnotationConfigUtils.COMMON_ANNOTATION_PROCESSOR_BEAN_NAME));
    assertFalse(context.containsBean(AnnotationConfigUtils.REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
  }

  public void testMultipleCustomExcludeFiltersAndDefaults() {
    GenericApplicationContext context = new GenericApplicationContext();
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context, true);
View Full Code Here

    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context, true);
    scanner.addExcludeFilter(new AssignableTypeFilter(FooService.class));
    scanner.addExcludeFilter(new AnnotationTypeFilter(Aspect.class));
    int beanCount = scanner.scan(BASE_PACKAGE);
    assertEquals(11, beanCount);
    assertFalse(context.containsBean("fooServiceImpl"));
    assertFalse(context.containsBean("serviceInvocationCounter"));
    assertTrue(context.containsBean("stubFooDao"));
    assertTrue(context.containsBean("myNamedComponent"));
    assertTrue(context.containsBean("myNamedDao"));
    assertTrue(context.containsBean(AnnotationConfigUtils.AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME));
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.