Examples of BeanDefinition


Examples of org.springframework.beans.factory.config.BeanDefinition

    }
   
    @Test
    public void testFeatureServiceFactoryPropertiesWithEnvironment() {
        setupContext("test-feature-service-context-with-env.xml");
        BeanDefinition beanDefinition = context.getBeanDefinition("featureServiceFactory");

        // Test ContextProviders setup
        PropertyValue environmentProperty = beanDefinition.getPropertyValues().getPropertyValue("environment");
        assertNotNull(environmentProperty);
       
        assertTrue(environmentProperty.getValue() instanceof BeanReference);
        assertEquals("environmentBean", ((BeanReference)environmentProperty.getValue()).getBeanName());
    }
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

   
   
    @Test
    public void testCreateFeatureServiceBean() {
        assertNotNull(context.containsBeanDefinition("featureService"));
        BeanDefinition beanDefinition = context.getBeanDefinition("featureService");
        assertEquals("featureServiceFactory", beanDefinition.getFactoryBeanName());
        assertEquals("createFeatureService", beanDefinition.getFactoryMethodName());
       
        FeatureService featureService = context.getBean("featureService", FeatureService.class);
        assertNotNull(featureService);
    }
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

    String beanName = holder.getBeanName();

    if (registerInnerBean && StringUtils.hasText(beanName)) {
      BeanDefinitionRegistry registry = parserContext.getRegistry();
      BeanDefinition beanDefinition = holder.getBeanDefinition();
      registry.registerBeanDefinition(beanName, beanDefinition);

      return new RuntimeBeanReference(beanName);
    }
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

   * @see CachingListenerValidator#validate(Object, int, ParserContext)
   */
  public void validate(Object cachingListener, int index,
      ParserContext parserContext) throws IllegalStateException {
    BeanDefinitionRegistry registry = parserContext.getRegistry();
    BeanDefinition beanDefinition = null;

    if (cachingListener instanceof RuntimeBeanReference) {
      String beanName = ((RuntimeBeanReference) cachingListener).getBeanName();
      beanDefinition = registry.getBeanDefinition(beanName);

View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

  public CachingListenerValidatorImplTests(String name) {
    super(name);
  }

  public void testValidateWithBeanDefinitionHolder() {
    BeanDefinition beanDefinition = createCachingListenerBeanDefinition();
    BeanDefinitionHolder holder = createBeanDefinitionHolder(beanDefinition);

    validator.validate(holder, 0, parserContext);
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

    validator.validate(holder, 0, parserContext);
  }

  public void testValidateWithBeanDefinitionNotDescribingCachingListener() {
    BeanDefinition beanDefinition = new RootBeanDefinition(String.class);
    BeanDefinitionHolder holder = createBeanDefinitionHolder(beanDefinition);

    assertValidationThrowsException(holder);
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

  public void testValidateWithObjectNotBeingReferenceOrHolder() {
    assertValidationThrowsException("cachingListener");
  }

  public void testValidateWithRuntimeBeanReference() {
    BeanDefinition beanDefinition = createCachingListenerBeanDefinition();
    String beanName = CACHING_LISTENER_BEAN_NAME;
    registry.registerBeanDefinition(beanName, beanDefinition);
    RuntimeBeanReference reference = new RuntimeBeanReference(beanName);

    validator.validate(reference, 0, parserContext);
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

        definition.getConstructorArgumentValues(), 0,
        RuntimeBeanReference.class);
  }

  private void assertCachingInterceptorIsRegistered() {
    BeanDefinition definition = registry
        .getBeanDefinition(MetadataCachingInterceptor.class.getName());

    ConfigAssert.assertBeanDefinitionHasProperty(definition, propertySource
        .getCacheKeyGeneratorProperty());
    ConfigAssert.assertBeanDefinitionHasProperty(definition, propertySource
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

        definition.getConstructorArgumentValues(), 0,
        RuntimeBeanReference.class);
  }

  private void assertFlushingInterceptorIsRegistered() {
    BeanDefinition definition = registry
        .getBeanDefinition(MetadataFlushingInterceptor.class.getName());

    ConfigAssert.assertBeanDefinitionHasProperty(definition, propertySource
        .getCacheProviderFacadeProperty());
    ConfigAssert.assertBeanDefinitionHasProperty(definition, propertySource
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

    PropertyValue configLocation = parseConfigLocationProperty(element);
    cacheManagerProperties.addPropertyValue(configLocation);
    registry.registerBeanDefinition(id, cacheManager);

    BeanDefinition cacheProviderFacade = registry
        .getBeanDefinition(cacheProviderFacadeId);
    cacheProviderFacade.getPropertyValues().addPropertyValue("cacheManager",
        new RuntimeBeanReference(id));
  }
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.