SGF-490 - Re-instate GemFire WAN and CQ functionality.

This commit is contained in:
John Blum
2016-04-25 21:36:20 -07:00
parent fd41003805
commit f904f6ad86
24 changed files with 168 additions and 282 deletions

View File

@@ -86,7 +86,7 @@ dependencies {
exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
exclude group: "org.apache.hbase", module: "hbase"
exclude group: "org.apache.logging.log4j", module: "slf4j-log4j12-impl"
exclude group: "org.apache.logging.log4j", module: "log4j-slf4j-impl"
exclude group: "org.slf4j", module: "slf4j-api"
exclude group: "org.springframework", module: "spring-aop"
exclude group: "org.springframework", module: "spring-beans"
@@ -100,6 +100,8 @@ dependencies {
exclude group: "org.springframework.data", module: "spring-data-commons"
exclude group: "org.springframework.shell", module: "spring-shell"
}
compile("org.apache.geode:geode-cq:$gemfireVersion")
compile("org.apache.geode:geode-wan:$gemfireVersion")
optional("com.google.code.findbugs:annotations:2.0.2")
runtime("antlr:antlr:$antlrVersion")

12
pom.xml
View File

@@ -97,7 +97,7 @@
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>slf4j-log4j12-impl</artifactId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
@@ -165,6 +165,16 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.geode</groupId>
<artifactId>geode-cq</artifactId>
<version>${gemfire.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geode</groupId>
<artifactId>geode-wan</artifactId>
<version>${gemfire.version}</version>
</dependency>
<dependency>
<groupId>antlr</groupId>

View File

@@ -43,10 +43,14 @@ public abstract class GemfireUtils extends CacheUtils {
public final static String GEMFIRE_NAME = GemFireVersion.getProductName();
public final static String GEMFIRE_VERSION = CacheFactory.getVersion();
// TODO use a more reliable means of determining implementing class for GemFire features such as Java's SPI support
private static final String ASYNC_EVENT_QUEUE_ELEMENT_NAME = "async-event-queue";
private static final String ASYNC_EVENT_QUEUE_TYPE_NAME = "com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue";
private static final String CQ_ELEMENT_NAME = "cq-listener-container";
private static final String CQ_TYPE_NAME = "com.gemstone.gemfire.cache.query.internal.cq.CqServiceFactoryImpl";
private static final String GATEWAY_TYPE_NAME = "com.gemstone.gemfire.internal.cache.wan.GatewaySenderFactoryImpl";
private static final String GATEWAY_RECEIVER_ELEMENT_NAME = "gateway-receiver";
private static final String GATEWAY_RECEIVER_TYPE_NAME = "com.gemstone.gemfire.internal.cache.wan.GatewayReceiverFactoryImpl";
private static final String GATEWAY_SENDER_ELEMENT_NAME = "gateway-sender";
private static final String GATEWAY_SENDER_TYPE_NAME = "com.gemstone.gemfire.internal.cache.wan.GatewaySenderFactoryImpl";
/* (non-Javadoc) */
public static boolean isClassAvailable(String fullyQualifiedClassName) {
@@ -81,7 +85,7 @@ public abstract class GemfireUtils extends CacheUtils {
/* (non-Javadoc) */
private static boolean isAsyncEventQueue(Element element) {
return "async-event-queue".equals(element.getLocalName());
return ASYNC_EVENT_QUEUE_ELEMENT_NAME.equals(element.getLocalName());
}
/* (non-Javadoc) */
@@ -91,7 +95,7 @@ public abstract class GemfireUtils extends CacheUtils {
/* (non-Javadoc) */
private static boolean isContinuousQuery(Element element) {
return "cq-listener-container".equals(element.getLocalName());
return CQ_ELEMENT_NAME.equals(element.getLocalName());
}
/* (non-Javadoc) */
@@ -102,12 +106,13 @@ public abstract class GemfireUtils extends CacheUtils {
/* (non-Javadoc) */
private static boolean isGateway(Element element) {
String elementLocalName = element.getLocalName();
return ("gateway-receiver".equals(elementLocalName) || "gateway-sender".equals(elementLocalName));
return (GATEWAY_RECEIVER_ELEMENT_NAME.equals(elementLocalName)
|| GATEWAY_SENDER_ELEMENT_NAME.equals(elementLocalName));
}
/* (non-Javadoc) */
private static boolean isGatewayAvailable() {
return isClassAvailable(GATEWAY_TYPE_NAME);
return isClassAvailable(GATEWAY_SENDER_TYPE_NAME);
}
/* (non-Javadoc) */

View File

@@ -23,13 +23,13 @@ import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import javax.annotation.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.data.gemfire.test.GemfireProfileValueSource;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.StringUtils;
@@ -98,12 +98,10 @@ public class LookupRegionMutationIntegrationTest {
}
protected void assertGatewaySenders(Region<?, ?> region, List<String> expectedGatewaySenderIds) {
if (GemfireProfileValueSource.isPivotalGemFire()) {
assertNotNull(region.getAttributes());
assertNotNull(region.getAttributes().getGatewaySenderIds());
assertEquals(expectedGatewaySenderIds.size(), region.getAttributes().getGatewaySenderIds().size());
assertTrue(expectedGatewaySenderIds.containsAll(region.getAttributes().getGatewaySenderIds()));
}
assertNotNull(region.getAttributes());
assertNotNull(region.getAttributes().getGatewaySenderIds());
assertEquals(expectedGatewaySenderIds.size(), region.getAttributes().getGatewaySenderIds().size());
assertTrue(expectedGatewaySenderIds.containsAll(region.getAttributes().getGatewaySenderIds()));
}
protected void assertGemFireComponent(Object gemfireComponent, String expectedName) {
@@ -156,7 +154,7 @@ public class LookupRegionMutationIntegrationTest {
assertNotNull(example.getAttributes().getAsyncEventQueueIds());
assertEquals(1, example.getAttributes().getAsyncEventQueueIds().size());
assertEquals("AEQ", example.getAttributes().getAsyncEventQueueIds().iterator().next());
assertGatewaySenders(example, Arrays.asList("GWS"));
assertGatewaySenders(example, Collections.singletonList("GWS"));
}
protected interface Nameable extends BeanNameAware {

View File

@@ -18,35 +18,39 @@ package org.springframework.data.gemfire;
import org.junit.After;
import org.junit.Before;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;
/**
* Simple testing class that creates the app context after each method.
* The RecreatingSpringApplicationContextTest class is an abstract base class that creates the app context after each method.
* Used to properly destroy the beans defined inside Spring.
*
* @author Costin Leau
* @author John Blum
*/
public abstract class RecreatingContextTest {
public abstract class RecreatingSpringApplicationContextTest {
protected GenericXmlApplicationContext ctx;
protected abstract String location();
protected void configureContext(){
}
protected GenericXmlApplicationContext applicationContext;
@Before
public void createCtx() {
ctx = new GenericXmlApplicationContext();
configureContext();
ctx.load(location());
ctx.registerShutdownHook();
ctx.refresh();
public void createContext() {
applicationContext = configureContext(new GenericXmlApplicationContext());
applicationContext.load(location());
applicationContext.registerShutdownHook();
applicationContext.refresh();
}
protected abstract String location();
protected <T extends ConfigurableApplicationContext> T configureContext(T context){
return context;
}
@After
public void destroyCtx() {
if (ctx != null)
ctx.destroy();
public void destroyContext() {
if (applicationContext != null) {
applicationContext.destroy();
}
}
}

View File

@@ -29,7 +29,7 @@ import com.gemstone.gemfire.cache.Region;
* @author David Turanski
* @author John Blum
*/
public class SubRegionTest extends RecreatingContextTest {
public class SubRegionTest extends RecreatingSpringApplicationContextTest {
@Override
protected String location() {
return "org/springframework/data/gemfire/basic-subregion.xml";
@@ -84,8 +84,8 @@ public class SubRegionTest extends RecreatingContextTest {
@SuppressWarnings("rawtypes")
private void testContext() throws Exception {
Region parent = ctx.getBean("parent", Region.class);
Region child = ctx.getBean("/parent/child", Region.class);
Region parent = applicationContext.getBean("parent", Region.class);
Region child = applicationContext.getBean("/parent/child", Region.class);
assertNotNull(parent.getSubregion("child"));
assertSame(child, parent.getSubregion("child"));
assertEquals("/parent/child", child.getFullPath());
@@ -93,7 +93,7 @@ public class SubRegionTest extends RecreatingContextTest {
@SuppressWarnings("rawtypes")
public void testChildOnly() throws Exception {
Region child = ctx.getBean("/parent/child", Region.class);
Region child = applicationContext.getBean("/parent/child", Region.class);
assertEquals("/parent/child", child.getFullPath());
}
}

View File

@@ -37,7 +37,6 @@ import org.springframework.data.gemfire.GemfireBeanFactoryLocator;
import org.springframework.data.gemfire.TestUtils;
import org.springframework.data.gemfire.client.ClientCacheFactoryBean;
import org.springframework.data.gemfire.test.GemfireProfileValueSource;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.annotation.ProfileValueSourceConfiguration;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -53,7 +52,6 @@ import com.gemstone.gemfire.cache.util.TimestampedEntryEvent;
* @author John Blum
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ProfileValueSourceConfiguration(GemfireProfileValueSource.class)
@ContextConfiguration(locations = "cache-ns.xml")
@SuppressWarnings("unused")
public class CacheNamespaceTest{
@@ -124,8 +122,6 @@ public class CacheNamespaceTest{
}
@Test
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY,
value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
public void testCacheWithGatewayConflictResolver() {
Cache cache = context.getBean("cache-with-gateway-conflict-resolver", Cache.class);

View File

@@ -39,9 +39,6 @@ import org.springframework.data.gemfire.listener.ContinuousQueryListener;
import org.springframework.data.gemfire.listener.ContinuousQueryListenerContainer;
import org.springframework.data.gemfire.listener.GemfireMDP;
import org.springframework.data.gemfire.listener.adapter.ContinuousQueryListenerAdapter;
import org.springframework.data.gemfire.test.GemfireProfileValueSource;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.annotation.ProfileValueSourceConfiguration;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.ErrorHandler;
@@ -68,9 +65,6 @@ import com.gemstone.gemfire.cache.query.CqQuery;
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY,
value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
@ProfileValueSourceConfiguration(GemfireProfileValueSource.class)
@SuppressWarnings("unused")
public class ContinuousQueryListenerContainerNamespaceTest {

View File

@@ -24,11 +24,8 @@ import javax.annotation.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.data.gemfire.test.GemfireProfileValueSource;
import org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer;
import org.springframework.data.gemfire.wan.GatewayReceiverFactoryBean;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.annotation.ProfileValueSourceConfiguration;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -55,9 +52,6 @@ import com.gemstone.gemfire.cache.wan.GatewayReceiver;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(value = "GatewayReceiverNamespaceTest-context.xml",
initializers = GemfireTestApplicationContextInitializer.class)
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY,
value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
@ProfileValueSourceConfiguration(GemfireProfileValueSource.class)
@ActiveProfiles("autoStart")
@SuppressWarnings("unused")
public class GatewayReceiverAutoStartNamespaceTest {

View File

@@ -24,11 +24,8 @@ import javax.annotation.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.data.gemfire.test.GemfireProfileValueSource;
import org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer;
import org.springframework.data.gemfire.wan.GatewayReceiverFactoryBean;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.annotation.ProfileValueSourceConfiguration;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -55,9 +52,6 @@ import com.gemstone.gemfire.cache.wan.GatewayReceiver;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(value = "GatewayReceiverNamespaceTest-context.xml",
initializers = GemfireTestApplicationContextInitializer.class)
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY,
value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
@ProfileValueSourceConfiguration(GemfireProfileValueSource.class)
@ActiveProfiles("defaultStart")
@SuppressWarnings("unused")
public class GatewayReceiverDefaultStartNamespaceTest {

View File

@@ -24,11 +24,8 @@ import javax.annotation.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.data.gemfire.test.GemfireProfileValueSource;
import org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer;
import org.springframework.data.gemfire.wan.GatewayReceiverFactoryBean;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.annotation.ProfileValueSourceConfiguration;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -54,9 +51,6 @@ import com.gemstone.gemfire.cache.wan.GatewayReceiver;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(value = "GatewayReceiverNamespaceTest-context.xml",
initializers = GemfireTestApplicationContextInitializer.class)
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY,
value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
@ProfileValueSourceConfiguration(GemfireProfileValueSource.class)
@ActiveProfiles("manualStart")
@SuppressWarnings("unused")
public class GatewayReceiverManualStartNamespaceTest {

View File

@@ -29,16 +29,12 @@ import java.util.List;
import org.junit.AfterClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.data.gemfire.RecreatingContextTest;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.data.gemfire.RecreatingSpringApplicationContextTest;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.TestUtils;
import org.springframework.data.gemfire.test.GemfireProfileValueSource;
import org.springframework.data.gemfire.test.GemfireTestBeanPostProcessor;
import org.springframework.data.gemfire.wan.GatewaySenderFactoryBean;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.annotation.ProfileValueSourceConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.asyncqueue.AsyncEvent;
@@ -52,33 +48,21 @@ import com.gemstone.gemfire.cache.wan.GatewaySender.OrderPolicy;
import com.gemstone.gemfire.cache.wan.GatewayTransportFilter;
/**
* This test is only valid for GF 7.0 and above
* The GemfireV7GatewayNamespaceTest class is a test suite of test cases testing the GemFire 7.0 WAN functionality
* by configuring various Gateway senders and receivers.
*
* @author David Turanski
* @author John Blum
* @see org.springframework.data.gemfire.RecreatingSpringApplicationContextTest
* @see com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue
* @see com.gemstone.gemfire.cache.wan.GatewayReceiver
* @see com.gemstone.gemfire.cache.wan.GatewaySender
*/
@RunWith(SpringJUnit4ClassRunner.class)
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY,
value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
@ProfileValueSourceConfiguration(GemfireProfileValueSource.class)
@SuppressWarnings("unused")
public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
/*
* (non-Javadoc)
* @see org.springframework.data.gemfire.RecreatingContextTest#location()
*/
@Override
protected String location() {
return "/org/springframework/data/gemfire/config/gateway-v7-ns.xml";
}
@Override
protected void configureContext() {
ctx.getBeanFactory().addBeanPostProcessor(new GemfireTestBeanPostProcessor());
}
public class GemfireV7GatewayNamespaceTest extends RecreatingSpringApplicationContextTest {
@AfterClass
@SuppressWarnings("all")
public static void tearDown() {
for (String name : new File(".").list(new FilenameFilter() {
@Override
@@ -90,9 +74,28 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
}
}
/*
* (non-Javadoc)
* @see org.springframework.data.gemfire.RecreatingSpringApplicationContextTest#configureContext(ConfigurableApplicationContext)
*/
@Override
protected <T extends ConfigurableApplicationContext> T configureContext(final T context) {
context.getBeanFactory().addBeanPostProcessor(new GemfireTestBeanPostProcessor());
return context;
}
/*
* (non-Javadoc)
* @see org.springframework.data.gemfire.RecreatingSpringApplicationContextTest#location()
*/
@Override
protected String location() {
return "/org/springframework/data/gemfire/config/gateway-v7-ns.xml";
}
@Test
public void testAsyncEventQueue() {
AsyncEventQueue asyncEventQueue = ctx.getBean("async-event-queue", AsyncEventQueue.class);
AsyncEventQueue asyncEventQueue = applicationContext.getBean("async-event-queue", AsyncEventQueue.class);
assertNotNull(asyncEventQueue);
assertTrue(asyncEventQueue.isBatchConflationEnabled());
@@ -108,7 +111,7 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
@Test
public void testGatewaySender() throws Exception {
GatewaySenderFactoryBean gatewaySenderFactoryBean = ctx.getBean("&gateway-sender", GatewaySenderFactoryBean.class);
GatewaySenderFactoryBean gatewaySenderFactoryBean = applicationContext.getBean("&gateway-sender", GatewaySenderFactoryBean.class);
assertNotNull(gatewaySenderFactoryBean);
assertNotNull(TestUtils.readField("cache", gatewaySenderFactoryBean));
@@ -136,12 +139,12 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
@Test
@SuppressWarnings("rawtypes")
public void testInnerGatewaySender() throws Exception {
Region<?, ?> region = ctx.getBean("region-inner-gateway-sender", Region.class);
Region<?, ?> region = applicationContext.getBean("region-inner-gateway-sender", Region.class);
assertNotNull(region.getAttributes().getGatewaySenderIds());
assertEquals(2, region.getAttributes().getGatewaySenderIds().size());
RegionFactoryBean regionFactoryBean = ctx.getBean("&region-inner-gateway-sender", RegionFactoryBean.class);
RegionFactoryBean regionFactoryBean = applicationContext.getBean("&region-inner-gateway-sender", RegionFactoryBean.class);
Object[] gatewaySenders = TestUtils.readField("gatewaySenders", regionFactoryBean);
@@ -183,7 +186,7 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
@Test
public void testGatewaySenderWithEventTransportFilterRefs() throws Exception {
GatewaySenderFactoryBean gatewaySenderFactoryBean = ctx.getBean("&gateway-sender-with-event-transport-filter-refs",
GatewaySenderFactoryBean gatewaySenderFactoryBean = applicationContext.getBean("&gateway-sender-with-event-transport-filter-refs",
GatewaySenderFactoryBean.class);
assertNotNull(gatewaySenderFactoryBean);
@@ -199,19 +202,19 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
assertNotNull(eventFilters);
assertEquals(1, eventFilters.size());
assertTrue(eventFilters.get(0) instanceof TestEventFilter);
assertSame(ctx.getBean("event-filter"), eventFilters.get(0));
assertSame(applicationContext.getBean("event-filter"), eventFilters.get(0));
List<GatewayTransportFilter> transportFilters = TestUtils.readField("transportFilters", gatewaySenderFactoryBean);
assertNotNull(transportFilters);
assertEquals(1, transportFilters.size());
assertTrue(transportFilters.get(0) instanceof TestTransportFilter);
assertSame(ctx.getBean("transport-filter"), transportFilters.get(0));
assertSame(applicationContext.getBean("transport-filter"), transportFilters.get(0));
}
@Test
public void testGatewayReceiver() {
GatewayReceiver gatewayReceiver = ctx.getBean("gateway-receiver", GatewayReceiver.class);
GatewayReceiver gatewayReceiver = applicationContext.getBean("gateway-receiver", GatewayReceiver.class);
assertNotNull(gatewayReceiver);
assertEquals("192.168.0.1", gatewayReceiver.getBindAddress());

View File

@@ -25,10 +25,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.gemfire.test.GemfireProfileValueSource;
import org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.annotation.ProfileValueSourceConfiguration;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -53,8 +50,6 @@ import com.gemstone.gemfire.cache.wan.GatewaySender;
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(value = "gateway-v8-ns.xml", initializers = GemfireTestApplicationContextInitializer.class)
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY, value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
@ProfileValueSourceConfiguration(GemfireProfileValueSource.class)
@SuppressWarnings("unused")
public class GemfireV8GatewayNamespaceTest {

View File

@@ -26,10 +26,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.test.GemfireProfileValueSource;
import org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.annotation.ProfileValueSourceConfiguration;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -55,7 +52,6 @@ import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
* @since 1.3.3
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ProfileValueSourceConfiguration(GemfireProfileValueSource.class)
@ContextConfiguration(locations = "subregionsubelement-ns.xml",
initializers = GemfireTestApplicationContextInitializer.class)
@SuppressWarnings("unused")
@@ -87,8 +83,6 @@ public class SubRegionSubElementNamespaceTest {
}
@Test
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY,
value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
public void testOrderItemsSubRegionGatewaySender() {
Region orderItemsRegion = applicationContext.getBean("/Orders/Items", Region.class);

View File

@@ -35,7 +35,6 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanIsAbstractException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.test.GemfireProfileValueSource;
import org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -182,13 +181,11 @@ public class TemplateRegionsNamespaceTests {
}
protected void assertGatewaySenders(final Region<?, ?> region, final String... gatewaySenderIds) {
if (GemfireProfileValueSource.isPivotalGemFire()) {
assertNotNull(region);
assertNotNull(region.getAttributes());
assertNotNull(region.getAttributes().getGatewaySenderIds());
assertEquals(gatewaySenderIds.length, region.getAttributes().getGatewaySenderIds().size());
assertTrue(Arrays.asList(gatewaySenderIds).containsAll(region.getAttributes().getGatewaySenderIds()));
}
assertNotNull(region);
assertNotNull(region.getAttributes());
assertNotNull(region.getAttributes().getGatewaySenderIds());
assertEquals(gatewaySenderIds.length, region.getAttributes().getGatewaySenderIds().size());
assertTrue(Arrays.asList(gatewaySenderIds).containsAll(region.getAttributes().getGatewaySenderIds()));
}
protected void assertDefaultMembershipAttributes(final MembershipAttributes membershipAttributes) {

View File

@@ -24,13 +24,8 @@ import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.data.gemfire.ForkUtil;
import org.springframework.data.gemfire.listener.adapter.ContinuousQueryListenerAdapter;
import org.springframework.data.gemfire.test.GemfireProfileValueSource;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.annotation.ProfileValueSourceConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.gemstone.gemfire.cache.RegionService;
import com.gemstone.gemfire.cache.client.ClientCacheFactory;
@@ -40,10 +35,6 @@ import com.gemstone.gemfire.cache.query.CqEvent;
/**
* @author Costin Leau
*/
@RunWith(SpringJUnit4ClassRunner.class)
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY,
value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
@ProfileValueSourceConfiguration(GemfireProfileValueSource.class)
public class ListenerContainerTests {
private final List<CqEvent> bag = new ArrayList<CqEvent>();

View File

@@ -29,9 +29,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.ForkUtil;
import org.springframework.data.gemfire.listener.ContinuousQueryListenerContainer;
import org.springframework.data.gemfire.test.GemfireProfileValueSource;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.annotation.ProfileValueSourceConfiguration;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -44,9 +41,6 @@ import com.gemstone.gemfire.cache.query.CqQuery;
* @author John Blum
*/
@RunWith(SpringJUnit4ClassRunner.class)
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY,
value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
@ProfileValueSourceConfiguration(GemfireProfileValueSource.class)
@ContextConfiguration("/org/springframework/data/gemfire/listener/container.xml")
@SuppressWarnings("unused")
public class ContainerXmlSetupTest {

View File

@@ -27,9 +27,6 @@ import javax.annotation.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.gemfire.test.GemfireProfileValueSource;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.annotation.ProfileValueSourceConfiguration;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -56,8 +53,6 @@ import com.gemstone.gemfire.cache.wan.GatewaySender;
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY, value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
@ProfileValueSourceConfiguration(GemfireProfileValueSource.class)
@SuppressWarnings("unused")
public class CachePartitionRegionWithConcurrentParallelAsyncEventQueueAndGatewaySenderIntegrationTest {

View File

@@ -26,10 +26,7 @@ import javax.annotation.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.data.gemfire.test.GemfireProfileValueSource;
import org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.annotation.ProfileValueSourceConfiguration;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -49,9 +46,6 @@ import com.gemstone.gemfire.cache.wan.GatewayReceiver;
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(initializers = GemfireTestApplicationContextInitializer.class)
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY,
value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
@ProfileValueSourceConfiguration(GemfireProfileValueSource.class)
@SuppressWarnings("unused")
public class ManualGatewayReceiverStartIntegrationTest {

View File

@@ -20,69 +20,35 @@
<bean id="B" class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest.TestCacheListener"/>
<beans profile="apache-geode">
<gfe:lookup-region id="Example" cloning-enabled="true" eviction-maximum="1000">
<gfe:cache-listener>
<bean class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest.TestCacheListener"
p:name="A"/>
<ref bean="B"/>
</gfe:cache-listener>
<gfe:cache-loader>
<bean class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest$TestCacheLoader"
p:name="C"/>
</gfe:cache-loader>
<gfe:cache-writer>
<bean class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest$TestCacheWriter"
p:name="D"/>
</gfe:cache-writer>
<gfe:region-ttl timeout="120" action="LOCAL_DESTROY"/>
<gfe:region-tti timeout="60" action="INVALIDATE"/>
<gfe:entry-ttl timeout="30" action="DESTROY"/>
<gfe:custom-entry-tti>
<bean class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest$TestCustomExpiry"
p:name="E"/>
</gfe:custom-entry-tti>
<gfe:async-event-queue name="AEQ" persistent="false" parallel="true" dispatcher-threads="8">
<gfe:async-event-listener>
<bean
class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest$TestAsyncEventListener"
p:name="F"/>
</gfe:async-event-listener>
</gfe:async-event-queue>
</gfe:lookup-region>
</beans>
<beans profile="pivotal-gemfire">
<gfe:lookup-region id="Example" cloning-enabled="true" eviction-maximum="1000">
<gfe:cache-listener>
<bean class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest.TestCacheListener"
p:name="A"/>
<ref bean="B"/>
</gfe:cache-listener>
<gfe:cache-loader>
<bean class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest$TestCacheLoader"
p:name="C"/>
</gfe:cache-loader>
<gfe:cache-writer>
<bean class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest$TestCacheWriter"
p:name="D"/>
</gfe:cache-writer>
<gfe:region-ttl timeout="120" action="LOCAL_DESTROY"/>
<gfe:region-tti timeout="60" action="INVALIDATE"/>
<gfe:entry-ttl timeout="30" action="DESTROY"/>
<gfe:custom-entry-tti>
<bean class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest$TestCustomExpiry"
p:name="E"/>
</gfe:custom-entry-tti>
<gfe:gateway-sender name="GWS" remote-distributed-system-id="123" manual-start="true"/>
<gfe:async-event-queue name="AEQ" persistent="false" parallel="true" dispatcher-threads="8">
<gfe:async-event-listener>
<bean
class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest$TestAsyncEventListener"
p:name="F"/>
</gfe:async-event-listener>
</gfe:async-event-queue>
</gfe:lookup-region>
</beans>
<gfe:lookup-region id="Example" cloning-enabled="true" eviction-maximum="1000">
<gfe:cache-listener>
<bean class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest.TestCacheListener"
p:name="A"/>
<ref bean="B"/>
</gfe:cache-listener>
<gfe:cache-loader>
<bean class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest$TestCacheLoader"
p:name="C"/>
</gfe:cache-loader>
<gfe:cache-writer>
<bean class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest$TestCacheWriter"
p:name="D"/>
</gfe:cache-writer>
<gfe:region-ttl timeout="120" action="LOCAL_DESTROY"/>
<gfe:region-tti timeout="60" action="INVALIDATE"/>
<gfe:entry-ttl timeout="30" action="DESTROY"/>
<gfe:custom-entry-tti>
<bean class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest$TestCustomExpiry"
p:name="E"/>
</gfe:custom-entry-tti>
<gfe:gateway-sender name="GWS" remote-distributed-system-id="123" manual-start="true"/>
<gfe:async-event-queue name="AEQ" persistent="false" parallel="true" dispatcher-threads="8">
<gfe:async-event-listener>
<bean
class="org.springframework.data.gemfire.LookupRegionMutationIntegrationTest$TestAsyncEventListener"
p:name="F"/>
</gfe:async-event-listener>
</gfe:async-event-queue>
</gfe:lookup-region>
</beans>

View File

@@ -11,11 +11,11 @@
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
">
<util:properties id="clientCacheConfigurationSettings">
<util:properties id="gemfireProperties">
<prop key="log-level">warning</prop>
</util:properties>
<gfe:client-cache use-bean-factory-locator="false" properties-ref="clientCacheConfigurationSettings" pool-name="clientPool"/>
<gfe:client-cache properties-ref="gemfireProperties" pool-name="clientPool"/>
<gfe:pool id="clientPool" subscription-enabled="true">
<gfe:server host="localhost" port="40404"/>

View File

@@ -102,65 +102,35 @@
<!-- PARTITION Regions -->
<gfe:partitioned-region id="Neighbor" persistent="true" copies="2" total-buckets="91"/>
<beans profile="pivotal-gemfire">
<gfe:gateway-sender id="TestGatewaySender" remote-distributed-system-id="123" manual-start="true"
persistent="false" parallel="true" dispatcher-threads="8"/>
<gfe:gateway-sender id="TestGatewaySender" remote-distributed-system-id="123" manual-start="true"
persistent="false" parallel="true" dispatcher-threads="8"/>
<gfe:partitioned-region-template id="PartitionRegionTemplate" copies="1" local-max-memory="1024"
total-max-memory="16384" recovery-delay="60000" startup-recovery-delay="15000"
enable-async-conflation="false" enable-subscription-conflation="true"
load-factor="0.70" value-constraint="java.lang.Object"
template="ExtendedRegionTemplate">
<gfe:gateway-sender-ref bean="TestGatewaySender"/>
<gfe:async-event-queue-ref bean="TestAsyncEventQueue"/>
<gfe:partition-resolver>
<bean
class="org.springframework.data.gemfire.config.TemplateRegionsNamespaceTests$TestPartitionResolver"
p:name="testResolver"/>
</gfe:partition-resolver>
<gfe:eviction type="ENTRY_COUNT" threshold="8192000" action="OVERFLOW_TO_DISK"/>
</gfe:partitioned-region-template>
<gfe:partitioned-region-template id="PartitionRegionTemplate" copies="1" local-max-memory="1024"
total-max-memory="16384" recovery-delay="60000" startup-recovery-delay="15000"
enable-async-conflation="false" enable-subscription-conflation="true"
load-factor="0.70" value-constraint="java.lang.Object"
template="ExtendedRegionTemplate">
<gfe:gateway-sender-ref bean="TestGatewaySender"/>
<gfe:async-event-queue-ref bean="TestAsyncEventQueue"/>
<gfe:partition-resolver>
<bean
class="org.springframework.data.gemfire.config.TemplateRegionsNamespaceTests$TestPartitionResolver"
p:name="testResolver"/>
</gfe:partition-resolver>
<gfe:eviction type="ENTRY_COUNT" threshold="8192000" action="OVERFLOW_TO_DISK"/>
</gfe:partitioned-region-template>
<gfe:partitioned-region id="TemplateBasedPartitionRegion" colocated-with="Neighbor" copies="2" local-max-memory="8192"
total-buckets="91" disk-synchronous="true" enable-async-conflation="true" ignore-jta="false"
key-constraint="java.util.Date" persistent="true" template="PartitionRegionTemplate">
<gfe:cache-writer>
<bean class="org.springframework.data.gemfire.config.TemplateRegionsNamespaceTests$TestCacheWriter" p:name="dbWriter"/>
</gfe:cache-writer>
<gfe:membership-attributes required-roles="admin,root,supertool" loss-action="no-access" resumption-action="reinitialize"/>
<gfe:partition-listener>
<bean class="org.springframework.data.gemfire.config.TemplateRegionsNamespaceTests$TestPartitionListener" p:name="testListener"/>
</gfe:partition-listener>
<gfe:subscription type="ALL"/>
</gfe:partitioned-region>
</beans>
<beans profile="apache-geode">
<gfe:partitioned-region-template id="PartitionRegionTemplate" copies="1" local-max-memory="1024"
total-max-memory="16384" recovery-delay="60000" startup-recovery-delay="15000"
enable-async-conflation="false" enable-subscription-conflation="true"
load-factor="0.70" value-constraint="java.lang.Object"
template="ExtendedRegionTemplate">
<gfe:async-event-queue-ref bean="TestAsyncEventQueue"/>
<gfe:partition-resolver>
<bean class="org.springframework.data.gemfire.config.TemplateRegionsNamespaceTests$TestPartitionResolver"
p:name="testResolver"/>
</gfe:partition-resolver>
<gfe:eviction type="ENTRY_COUNT" threshold="8192000" action="OVERFLOW_TO_DISK"/>
</gfe:partitioned-region-template>
<gfe:partitioned-region id="TemplateBasedPartitionRegion" colocated-with="Neighbor" copies="2" local-max-memory="8192"
total-buckets="91" disk-synchronous="true" enable-async-conflation="true" ignore-jta="false"
key-constraint="java.util.Date" persistent="true" template="PartitionRegionTemplate">
<gfe:cache-writer>
<bean class="org.springframework.data.gemfire.config.TemplateRegionsNamespaceTests$TestCacheWriter" p:name="dbWriter"/>
</gfe:cache-writer>
<gfe:membership-attributes required-roles="admin,root,supertool" loss-action="no-access" resumption-action="reinitialize"/>
<gfe:partition-listener>
<bean class="org.springframework.data.gemfire.config.TemplateRegionsNamespaceTests$TestPartitionListener" p:name="testListener"/>
</gfe:partition-listener>
<gfe:subscription type="ALL"/>
</gfe:partitioned-region>
</beans>
<gfe:partitioned-region id="TemplateBasedPartitionRegion" colocated-with="Neighbor" copies="2" local-max-memory="8192"
total-buckets="91" disk-synchronous="true" enable-async-conflation="true" ignore-jta="false"
key-constraint="java.util.Date" persistent="true" template="PartitionRegionTemplate">
<gfe:cache-writer>
<bean class="org.springframework.data.gemfire.config.TemplateRegionsNamespaceTests$TestCacheWriter" p:name="dbWriter"/>
</gfe:cache-writer>
<gfe:membership-attributes required-roles="admin,root,supertool" loss-action="no-access" resumption-action="reinitialize"/>
<gfe:partition-listener>
<bean class="org.springframework.data.gemfire.config.TemplateRegionsNamespaceTests$TestPartitionListener" p:name="testListener"/>
</gfe:partition-listener>
<gfe:subscription type="ALL"/>
</gfe:partitioned-region>
</beans>

View File

@@ -39,12 +39,10 @@
<gfe:server host="localhost" port="1234"/>
</gfe:pool>
<beans profile="pivotal-gemfire">
<gfe:cache id="cache-with-gateway-conflict-resolver">
<gfe:gateway-conflict-resolver>
<bean class="org.springframework.data.gemfire.config.CacheNamespaceTest.TestGatewayConflictResolver"/>
</gfe:gateway-conflict-resolver>
</gfe:cache>
</beans>
<gfe:cache id="cache-with-gateway-conflict-resolver">
<gfe:gateway-conflict-resolver>
<bean class="org.springframework.data.gemfire.config.CacheNamespaceTest.TestGatewayConflictResolver"/>
</gfe:gateway-conflict-resolver>
</gfe:cache>
</beans>

View File

@@ -36,13 +36,11 @@
</gfe:replicated-region>
</gfe:replicated-region>
<beans profile="pivotal-gemfire">
<gfe:replicated-region id="Orders" persistent="false">
<gfe:replicated-region name="Items" persistent="false">
<gfe:gateway-sender remote-distributed-system-id="21" name="testSender" parallel="false"
manual-start="true"/>
</gfe:replicated-region>
<gfe:replicated-region id="Orders" persistent="false">
<gfe:replicated-region name="Items" persistent="false">
<gfe:gateway-sender remote-distributed-system-id="21" name="testSender" parallel="false"
manual-start="true"/>
</gfe:replicated-region>
</beans>
</gfe:replicated-region>
</beans>