Updating docs in progress and changed default bean names to camelCase
This commit is contained in:
@@ -45,6 +45,7 @@ public class SubRegionTest extends RecreatingContextTest {
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
private void testBasic() throws Exception {
|
||||
CacheFactoryBean cfb = new CacheFactoryBean();
|
||||
cfb.setBeanName("gemfireCache");
|
||||
cfb.setUseBeanFactoryLocator(false);
|
||||
cfb.afterPropertiesSet();
|
||||
GemFireCache cache = cfb.getObject();
|
||||
|
||||
@@ -58,8 +58,11 @@ public class CacheNamespaceTest extends RecreatingContextTest {
|
||||
}
|
||||
|
||||
private void testBasicCache() throws Exception {
|
||||
assertTrue(ctx.containsBean("gemfireCache"));
|
||||
//Check alias is registered
|
||||
assertTrue(ctx.containsBean("gemfire-cache"));
|
||||
CacheFactoryBean cfb = (CacheFactoryBean) ctx.getBean("&gemfire-cache");
|
||||
//
|
||||
CacheFactoryBean cfb = (CacheFactoryBean) ctx.getBean("&gemfireCache");
|
||||
assertNull(TestUtils.readField("cacheXml", cfb));
|
||||
assertNull(TestUtils.readField("properties", cfb));
|
||||
}
|
||||
|
||||
@@ -21,6 +21,10 @@ import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -64,6 +68,20 @@ public class ClientRegionNamespaceTest {
|
||||
testOverflowToDisk();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDown() {
|
||||
|
||||
for (String name : new File(".").list(new FilenameFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
return name.startsWith("BACKUP");
|
||||
}
|
||||
})) {
|
||||
new File(name).delete();
|
||||
}
|
||||
}
|
||||
|
||||
private void testBasicClient() throws Exception {
|
||||
assertTrue(context.containsBean("simple"));
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
@@ -80,6 +81,16 @@ public class DiskStoreAndEvictionRegionParsingTest {
|
||||
file.delete();
|
||||
}
|
||||
diskStoreDir.delete();
|
||||
|
||||
for (String name : new File(".").list(new FilenameFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
return name.startsWith("BACKUPds");
|
||||
}
|
||||
})) {
|
||||
new File(name).delete();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -98,7 +109,7 @@ public class DiskStoreAndEvictionRegionParsingTest {
|
||||
assertEquals(9999, diskStore1.getTimeInterval());
|
||||
assertEquals(10, diskStore1.getMaxOplogSize());
|
||||
assertEquals(diskStoreDir, diskStore1.getDiskDirs()[0]);
|
||||
Cache cache = context.getBean("gemfire-cache", Cache.class);
|
||||
Cache cache = context.getBean("gemfireCache", Cache.class);
|
||||
assertSame(diskStore1, cache.findDiskStore("diskStore1"));
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class DynamicRegionNamespaceTest extends RecreatingContextTest {
|
||||
DynamicRegionFactory drf = DynamicRegionFactory.get();
|
||||
assertFalse(drf.isOpen());
|
||||
assertNull(drf.getConfig());
|
||||
ctx.getBean("gemfire-cache", Cache.class);
|
||||
ctx.getBean("gemfireCache", Cache.class);
|
||||
assertTrue(drf.isOpen());
|
||||
DynamicRegionFactory.Config config = drf.getConfig();
|
||||
assertFalse(config.persistBackup);
|
||||
|
||||
@@ -80,7 +80,7 @@ public class GemfireV6GatewayNamespaceTest extends RecreatingContextTest {
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private void testGatewaysInGemfire() {
|
||||
Cache cache = ctx.getBean("gemfire-cache", Cache.class);
|
||||
Cache cache = ctx.getBean("gemfireCache", Cache.class);
|
||||
GatewayHub gwh = cache.getGatewayHub("gateway-hub");
|
||||
assertNotNull(gwh);
|
||||
|
||||
|
||||
@@ -19,11 +19,14 @@ import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.data.gemfire.RecreatingContextTest;
|
||||
@@ -74,6 +77,19 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
|
||||
}
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDown() {
|
||||
for (String name : new File(".").list(new FilenameFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
return name.startsWith("BACKUP");
|
||||
}
|
||||
})) {
|
||||
new File(name).delete();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -45,7 +45,7 @@ public class IndexNamespaceTest {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
Cache cache = (Cache) context.getBean("gemfire-cache");
|
||||
Cache cache = (Cache) context.getBean("gemfireCache");
|
||||
if (cache.getRegion(name) == null) {
|
||||
cache.createRegionFactory().create("test-index");
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class JndiBindingsTest extends RecreatingContextTest {
|
||||
|
||||
@Test
|
||||
public void testJndiBindings() throws Exception {
|
||||
Cache cache = ctx.getBean("gemfire-cache", Cache.class);
|
||||
Cache cache = ctx.getBean("gemfireCache", Cache.class);
|
||||
assertNotNull(cache.getJNDIContext().lookup("java:/SimpleDataSource"));
|
||||
GemFireBasicDataSource ds = (GemFireBasicDataSource) cache.getJNDIContext().lookup("java:/SimpleDataSource");
|
||||
assertEquals("org.apache.derby.jdbc.EmbeddedDriver", ds.getJDBCDriver());
|
||||
|
||||
@@ -52,9 +52,12 @@ public class PoolNamespaceTest {
|
||||
}
|
||||
|
||||
private void testBasicClient() throws Exception {
|
||||
assertTrue(context.containsBean("gemfirePool"));
|
||||
//Check old style alias also registered
|
||||
assertTrue(context.containsBean("gemfire-pool"));
|
||||
assertEquals(context.getBean("gemfire-pool"), PoolManager.find("gemfire-pool"));
|
||||
PoolFactoryBean pfb = (PoolFactoryBean) context.getBean("&gemfire-pool");
|
||||
|
||||
assertEquals(context.getBean("gemfirePool"), PoolManager.find("gemfirePool"));
|
||||
PoolFactoryBean pfb = (PoolFactoryBean) context.getBean("&gemfirePool");
|
||||
Collection<PoolConnection> locators = TestUtils.readField("locators", pfb);
|
||||
assertEquals(1, locators.size());
|
||||
PoolConnection locator = locators.iterator().next();
|
||||
|
||||
@@ -49,7 +49,7 @@ public class TxEventHandlersTest {
|
||||
@Autowired
|
||||
TestWriter txWriter;
|
||||
|
||||
@Resource(name = "gemfire-cache")
|
||||
@Resource(name = "gemfireCache")
|
||||
Cache cache;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
|
||||
@@ -35,8 +35,11 @@ public class TxManagerNamespaceTest extends RecreatingContextTest {
|
||||
|
||||
@Test
|
||||
public void testBasicCache() throws Exception {
|
||||
assertTrue(ctx.containsBean("gemfireTransactionManager"));
|
||||
//Check old style alias also registered
|
||||
assertTrue(ctx.containsBean("gemfire-transaction-manager"));
|
||||
GemfireTransactionManager tx = ctx.getBean("gemfire-transaction-manager", GemfireTransactionManager.class);
|
||||
|
||||
GemfireTransactionManager tx = ctx.getBean("gemfireTransactionManager", GemfireTransactionManager.class);
|
||||
assertFalse(tx.isCopyOnRead());
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class ContainerXmlSetupTest {
|
||||
ContinuousQueryListenerContainer container = ctx.getBean(ContinuousQueryListenerContainer.class);
|
||||
assertTrue(container.isRunning());
|
||||
|
||||
Cache cache = ctx.getBean("gemfire-cache", Cache.class);
|
||||
Cache cache = ctx.getBean("gemfireCache", Cache.class);
|
||||
Pool pool = ctx.getBean("client", Pool.class);
|
||||
|
||||
CqQuery[] cqs = cache.getQueryService().getCqs();
|
||||
|
||||
@@ -15,14 +15,16 @@
|
||||
*/
|
||||
package org.springframework.data.gemfire.mapping;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.core.convert.support.DefaultConversionService;
|
||||
import org.springframework.data.gemfire.mapping.GemfireMappingContext;
|
||||
import org.springframework.data.gemfire.mapping.MappingPdxSerializer;
|
||||
import org.springframework.data.gemfire.repository.sample.Address;
|
||||
import org.springframework.data.gemfire.repository.sample.Person;
|
||||
|
||||
@@ -41,6 +43,8 @@ public class MappingPdxSerializerIntegrationTest {
|
||||
|
||||
Region<Object, Object> region;
|
||||
|
||||
static Cache cache;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
||||
@@ -50,8 +54,7 @@ public class MappingPdxSerializerIntegrationTest {
|
||||
CacheFactory factory = new CacheFactory();
|
||||
factory.setPdxSerializer(serializer);
|
||||
factory.setPdxPersistent(true);
|
||||
|
||||
Cache cache = factory.create();
|
||||
cache = factory.create();
|
||||
|
||||
RegionFactory<Object, Object> regionFactory = cache.createRegionFactory();
|
||||
regionFactory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
|
||||
@@ -78,4 +81,22 @@ public class MappingPdxSerializerIntegrationTest {
|
||||
assertThat(reference.getLastname(), is(person.getLastname()));
|
||||
assertThat(reference.address, is(person.address));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDown() {
|
||||
try {
|
||||
cache.close();
|
||||
}
|
||||
catch (Exception e) {
|
||||
}
|
||||
for (String name : new File(".").list(new FilenameFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
return name.startsWith("BACKUP");
|
||||
}
|
||||
})) {
|
||||
new File(name).delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,13 @@
|
||||
*/
|
||||
package org.springframework.data.gemfire.support;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.data.gemfire.CacheFactoryBean;
|
||||
@@ -38,7 +41,7 @@ public abstract class AbstractRegionFactoryBeanTest {
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
CacheFactoryBean cfb = new CacheFactoryBean();
|
||||
cfb.setBeanName("gemfire-cache");
|
||||
cfb.setBeanName("gemfireCache");
|
||||
cfb.setUseBeanFactoryLocator(false);
|
||||
cfb.afterPropertiesSet();
|
||||
cache = cfb.getObject();
|
||||
@@ -52,6 +55,19 @@ public abstract class AbstractRegionFactoryBeanTest {
|
||||
}
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void cleanUp() {
|
||||
for (String name : new File(".").list(new FilenameFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
return name.startsWith("BACKUP");
|
||||
}
|
||||
})) {
|
||||
new File(name).delete();
|
||||
}
|
||||
}
|
||||
|
||||
protected void addRFBConfig(RegionFactoryBeanConfig rfbc) {
|
||||
if (regionFactoryBeanConfigs.containsKey(rfbc.regionName)) {
|
||||
throw new RuntimeException("duplicate region name " + rfbc.regionName);
|
||||
|
||||
Reference in New Issue
Block a user