Package org.springframework.beans

Examples of org.springframework.beans.PropertyValue


        CommonsAttributes.class);
    registry.registerBeanDefinition(BeanName.ATTRIBUTES, attributes);
  }

  private PropertyValue getAttributesProperty() {
    return new PropertyValue("attributes", new RuntimeBeanReference(
        BeanName.ATTRIBUTES));
  }
View Full Code Here


    Class clazz = getCacheManagerClass();
    RootBeanDefinition cacheManager = new RootBeanDefinition(clazz);
    MutablePropertyValues cacheManagerProperties = new MutablePropertyValues();
    cacheManager.setPropertyValues(cacheManagerProperties);

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

    BeanDefinition cacheProviderFacade = registry
        .getBeanDefinition(cacheProviderFacadeId);
View Full Code Here

      ResourceEditor resourceEditor = new ResourceEditor();
      resourceEditor.setAsText(configLocation);
      resource = (Resource) resourceEditor.getValue();
    }

    return new PropertyValue("configLocation", resource);
  }
View Full Code Here

  /**
   * Asserts that the cache provider facade definition has a reference to the
   * definition of a cache manager factory.
   */
  private void assertCacheProviderFacadeHasCacheManagerAsProperty() {
    PropertyValue cacheManagerProperty = cacheProviderFacade
        .getPropertyValues().getPropertyValue("cacheManager");

    RuntimeBeanReference cacheManager = (RuntimeBeanReference) cacheManagerProperty
        .getValue();
    assertEquals(BeanName.CACHE_MANAGER, cacheManager.getBeanName());
  }
View Full Code Here

    BeanDefinition proxyDefinition = registry
        .getBeanDefinition(proxyElementBuilder.id);

    // verify property "target" is correct.
    PropertyValue target = proxyDefinition.getPropertyValues()
        .getPropertyValue("target");
    assertEquals(holder, target.getValue());
    assertCacheProxyFactoryBeanDefinitionIsCorrect(proxyDefinition);

    beanReferenceParserControl.verify();
  }
View Full Code Here

  private void assertCacheProxyFactoryBeanDefinitionIsCorrect(
      BeanDefinition cacheProxyFactoryBeanDefinition) {

    // verify cache proxy factory bean.
    PropertyValue expected = propertySource.getCacheKeyGeneratorProperty();
    ConfigAssert.assertBeanDefinitionHasProperty(
        cacheProxyFactoryBeanDefinition, expected);

    // verify property "cacheProviderFacade" is correct.
    expected = new PropertyValue("cacheProviderFacade",
        new RuntimeBeanReference("cacheProvider"));
    ConfigAssert.assertBeanDefinitionHasProperty(
        cacheProxyFactoryBeanDefinition, expected);

    // verify rest of properties.
View Full Code Here

   */
  public static void assertPropertyIsPresent(
      MutablePropertyValues propertyValues, PropertyValue expectedPropertyValue) {

    String propertyName = expectedPropertyValue.getName();
    PropertyValue actualPropertyValue = propertyValues
        .getPropertyValue(propertyName);

    Assert.assertNotNull("Property " + StringUtils.quote(propertyName)
        + " not found", actualPropertyValue);

    Object expectedValue = expectedPropertyValue.getValue();
    Object actualValue = actualPropertyValue.getValue();
    String message = "<Property " + StringUtils.quote(propertyName) + ">";

    assertEquals(message, expectedValue, actualValue);
  }
View Full Code Here

  }

  private void assertAttributesPropertyIsPresent(
      MutablePropertyValues propertyValues) {

    PropertyValue expected = new PropertyValue("attributes",
        new RuntimeBeanReference(ATTRIBUTES_BEAN_NAME));
    ConfigAssert.assertPropertyIsPresent(propertyValues, expected);
  }
View Full Code Here

  protected void tearDown() {
    parserControl.verify();
  }

  private void assertFailQuietlyEnabledIsCorrect(Boolean expected) {
    PropertyValue expectedPropertyValue = new PropertyValue(
        "failQuietlyEnabled", expected);
    ConfigAssert.assertBeanDefinitionHasProperty(getCacheProviderFacade(),
        expectedPropertyValue);
  }
View Full Code Here

    assertFailQuietlyEnabledIsCorrect(Boolean.TRUE);
  }

  private void assertSerializableFactoryPropertyIsCorrect(
      SerializableFactory expected) {
    PropertyValue expectedPropertyValue = new PropertyValue(
        "serializableFactory", expected);
    ConfigAssert.assertBeanDefinitionHasProperty(getCacheProviderFacade(),
        expectedPropertyValue);
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.PropertyValue

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.