SGF-56
+ add flag to disable bean-factory-locator
This commit is contained in:
@@ -61,4 +61,5 @@ public class CacheIntegrationTest extends RecreatingContextTest{
|
||||
public void testCacheWithXml() throws Exception {
|
||||
Cache cache = ctx.getBean("cache-with-xml", Cache.class);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,12 +17,14 @@
|
||||
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 org.junit.Test;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.data.gemfire.CacheFactoryBean;
|
||||
import org.springframework.data.gemfire.GemfireBeanFactoryLocator;
|
||||
import org.springframework.data.gemfire.RecreatingContextTest;
|
||||
import org.springframework.data.gemfire.TestUtils;
|
||||
|
||||
@@ -61,4 +63,17 @@ public class CacheNamespaceTest extends RecreatingContextTest {
|
||||
assertEquals(ctx.getBean("props"), TestUtils.readField("properties", cfb));
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void testNoBeanFactory() throws Exception {
|
||||
assertTrue(ctx.containsBean("no-bl"));
|
||||
CacheFactoryBean cfb = (CacheFactoryBean) ctx.getBean("&no-bl");
|
||||
GemfireBeanFactoryLocator locator = new GemfireBeanFactoryLocator();
|
||||
try {
|
||||
assertNotNull(locator.useBeanFactory("cache-with-name"));
|
||||
locator.useBeanFactory("no-bl");
|
||||
} finally {
|
||||
locator.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user