SGF-490 - Re-instate GemFire WAN and CQ functionality.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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("®ion-inner-gateway-sender", RegionFactoryBean.class);
|
||||
RegionFactoryBean regionFactoryBean = applicationContext.getBean("®ion-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());
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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>();
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user