+ more integration tests
This commit is contained in:
Costin Leau
2011-08-24 21:23:04 +03:00
parent 6944092255
commit a05543b447
4 changed files with 33 additions and 2 deletions

View File

@@ -27,6 +27,7 @@ import org.springframework.data.gemfire.CacheFactoryBean;
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;
/**
* @author Costin Leau
@@ -59,7 +60,7 @@ public class CacheNamespaceTest extends RecreatingContextTest {
assertTrue(ctx.containsBean("cache-with-xml"));
CacheFactoryBean cfb = (CacheFactoryBean) ctx.getBean("&cache-with-xml");
Resource res = TestUtils.readField("cacheXml", cfb);
assertEquals("cache.xml", res.getFilename());
assertEquals("gemfire-cache.xml", res.getFilename());
assertEquals(ctx.getBean("props"), TestUtils.readField("properties", cfb));
}
@@ -76,4 +77,19 @@ public class CacheNamespaceTest extends RecreatingContextTest {
}
}
@Test
public void testBasicClientCache() throws Exception {
assertTrue(ctx.containsBean("client-cache"));
ClientCacheFactoryBean cfb = (ClientCacheFactoryBean) ctx.getBean("&client-cache");
assertNull(TestUtils.readField("cacheXml", cfb));
assertNull(TestUtils.readField("properties", cfb));
}
@Test
public void testBasicClientCacheWithXml() throws Exception {
assertTrue(ctx.containsBean("client-cache-with-xml"));
ClientCacheFactoryBean cfb = (ClientCacheFactoryBean) ctx.getBean("&client-cache-with-xml");
Resource res = TestUtils.readField("cacheXml", cfb);
assertEquals("gemfire-client-cache.xml", res.getFilename());
}
}

View File

@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<!DOCTYPE client-cache PUBLIC
"-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
"http://www.gemstone.com/dtd/cache6_5.dtd">
<client-cache>
<region name="myRegion" refid="PROXY"/>
<!-- you can override or add to the PROXY attributes by adding
a region-attributes sub element here -->
</client-cache>

View File

@@ -16,11 +16,15 @@
<gfe:cache id="cache-with-name"/>
<gfe:cache id="cache-with-xml" cache-xml-location="classpath:cache.xml" properties-ref="props"/>
<gfe:cache id="cache-with-xml" cache-xml-location="classpath:gemfire-cache.xml" properties-ref="props"/>
<util:properties id="props">
<prop key="disable-tcp">false</prop>
</util:properties>
<gfe:cache id="no-bl" use-bean-factory-locator="false" />
<gfe:client-cache id="client-cache"/>
<gfe:client-cache id="client-cache-with-xml" cache-xml-location="classpath:gemfire-client-cache.xml"/>
</beans>