diff --git a/src/main/java/org/springframework/data/gemfire/config/CacheParser.java b/src/main/java/org/springframework/data/gemfire/config/CacheParser.java index 192a0f2f..40b20142 100644 --- a/src/main/java/org/springframework/data/gemfire/config/CacheParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/CacheParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import org.w3c.dom.Element; * Parser for <cache;gt; definitions. * * @author Costin Leau + * @author Oliver Gierke */ class CacheParser extends AbstractSingleBeanDefinitionParser { @@ -48,6 +49,7 @@ class CacheParser extends AbstractSingleBeanDefinitionParser { ParsingUtils.setPropertyValue(element, builder, "pdx-persistent", "pdxPersistent"); ParsingUtils.setPropertyValue(element, builder, "pdx-read-serialized", "pdxReadSerialized"); ParsingUtils.setPropertyValue(element, builder, "pdx-ignore-unread-fields", "pdxIgnoreUnreadFields"); + ParsingUtils.setPropertyValue(element, builder, "use-bean-factory-locator", "useBeanFactoryLocator"); } @Override diff --git a/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java index 614b322e..8b5b2ec5 100644 --- a/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java @@ -16,10 +16,8 @@ package org.springframework.data.gemfire.config; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.CoreMatchers.*; +import static org.junit.Assert.*; import org.junit.Test; import org.springframework.core.io.Resource; @@ -28,6 +26,7 @@ import org.springframework.data.gemfire.GemfireBeanFactoryLocator; import org.springframework.data.gemfire.RecreatingContextTest; import org.springframework.data.gemfire.TestUtils; import org.springframework.data.gemfire.client.ClientCacheFactoryBean; +import org.springframework.test.util.ReflectionTestUtils; /** * @author Costin Leau @@ -72,6 +71,10 @@ public class CacheNamespaceTest extends RecreatingContextTest { public void testNoBeanFactory() throws Exception { assertTrue(ctx.containsBean("no-bl")); CacheFactoryBean cfb = (CacheFactoryBean) ctx.getBean("&no-bl"); + + assertThat((Boolean) ReflectionTestUtils.getField(cfb, "useBeanFactoryLocator"), is(false)); + assertThat(ReflectionTestUtils.getField(cfb, "factoryLocator"), is(nullValue())); + GemfireBeanFactoryLocator locator = new GemfireBeanFactoryLocator(); try { assertNotNull(locator.useBeanFactory("cache-with-name"));