SGF-81 - Fixed parsing of "use-bean-factory-locator" attribute.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user