SGF-398 - Provide early support of Apache Geode (Pivotal GemFire OSS).
Fixed up and polished additional SDG test suite classes related to Pivotal GemFire functionality and features when ran with Apache Geode. Also introduced a GemfireFeature enumerated type to implement more fine-grained control of specific feature checking when attributes of XML namespace elements refer to Pivotal GemFire specific features.
This commit is contained in:
@@ -59,6 +59,7 @@ public class CacheAutoReconnectIntegrationTests {
|
||||
@Test
|
||||
public void testAutoReconnectDisabled() {
|
||||
Cache cache = getCache("cacheAutoReconnectDisabledIntegrationTests.xml");
|
||||
assertNotNull(cache);
|
||||
assertNotNull(cache.getDistributedSystem());
|
||||
assertNotNull(cache.getDistributedSystem().getProperties());
|
||||
assertTrue(Boolean.valueOf(cache.getDistributedSystem().getProperties().getProperty("disable-auto-reconnect")));
|
||||
@@ -67,6 +68,7 @@ public class CacheAutoReconnectIntegrationTests {
|
||||
@Test
|
||||
public void testAutoReconnectEnabled() {
|
||||
Cache cache = getCache("cacheAutoReconnectEnabledIntegrationTests.xml");
|
||||
assertNotNull(cache);
|
||||
assertNotNull(cache.getDistributedSystem());
|
||||
assertNotNull(cache.getDistributedSystem().getProperties());
|
||||
assertFalse(Boolean.valueOf(cache.getDistributedSystem().getProperties().getProperty("disable-auto-reconnect")));
|
||||
|
||||
@@ -270,8 +270,6 @@ public class CacheFactoryBeanTest {
|
||||
|
||||
@Test
|
||||
public void testPostProcessPropertiesBeforeInitializationDefaults() {
|
||||
assumeTrue(GemfireUtils.isGemfireVersion8OrAbove());
|
||||
|
||||
Properties gemfireProperties = new Properties();
|
||||
|
||||
assertTrue(gemfireProperties.isEmpty());
|
||||
@@ -289,8 +287,6 @@ public class CacheFactoryBeanTest {
|
||||
|
||||
@Test
|
||||
public void testPostProcessPropertiesBeforeInitializationDisabled() {
|
||||
assumeTrue(GemfireUtils.isGemfireVersion8OrAbove());
|
||||
|
||||
Properties gemfireProperties = new Properties();
|
||||
|
||||
assertTrue(gemfireProperties.isEmpty());
|
||||
@@ -310,8 +306,6 @@ public class CacheFactoryBeanTest {
|
||||
|
||||
@Test
|
||||
public void testPostProcessPropertiesBeforeInitializationEnabled() {
|
||||
assumeTrue(GemfireUtils.isGemfireVersion8OrAbove());
|
||||
|
||||
Properties gemfireProperties = new Properties();
|
||||
|
||||
assertTrue(gemfireProperties.isEmpty());
|
||||
|
||||
@@ -64,7 +64,7 @@ public class GemfireUtilsTest {
|
||||
public void isGemfireVersion8OrAbove() {
|
||||
int gemfireVersion = getGemFireVersion();
|
||||
assumeTrue(gemfireVersion > -1);
|
||||
assertEquals(getGemFireVersion() >= 80, GemfireUtils.isGemfireVersion7OrAbove());
|
||||
assertEquals(getGemFireVersion() >= 80, GemfireUtils.isGemfireVersion8OrAbove());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,6 +39,9 @@ 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;
|
||||
@@ -63,8 +66,11 @@ import com.gemstone.gemfire.cache.query.CqQuery;
|
||||
* @see com.gemstone.gemfire.cache.query.CqQuery
|
||||
* @since 1.4.0
|
||||
*/
|
||||
@ContextConfiguration
|
||||
@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,8 +24,11 @@ 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;
|
||||
@@ -52,6 +55,9 @@ 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,8 +24,11 @@ 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;
|
||||
@@ -52,6 +55,9 @@ 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,8 +24,11 @@ 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;
|
||||
@@ -51,6 +54,9 @@ 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 {
|
||||
|
||||
@@ -28,10 +28,8 @@ import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.data.gemfire.GemfireUtils;
|
||||
import org.springframework.data.gemfire.RecreatingContextTest;
|
||||
import org.springframework.data.gemfire.RegionFactoryBean;
|
||||
import org.springframework.data.gemfire.TestUtils;
|
||||
@@ -60,7 +58,8 @@ import com.gemstone.gemfire.cache.wan.GatewayTransportFilter;
|
||||
* @author John Blum
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY, value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
|
||||
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY,
|
||||
value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
|
||||
@ProfileValueSourceConfiguration(GemfireProfileValueSource.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
|
||||
@@ -79,14 +78,6 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
|
||||
ctx.getBeanFactory().addBeanPostProcessor(new GemfireTestBeanPostProcessor());
|
||||
}
|
||||
|
||||
@Before
|
||||
@Override
|
||||
public void createCtx() {
|
||||
if (GemfireUtils.isGemfireVersion7OrAbove()) {
|
||||
super.createCtx();
|
||||
}
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDown() {
|
||||
for (String name : new File(".").list(new FilenameFilter() {
|
||||
|
||||
@@ -41,7 +41,8 @@ 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)
|
||||
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY,
|
||||
value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
|
||||
@ProfileValueSourceConfiguration(GemfireProfileValueSource.class)
|
||||
public class ListenerContainerTests {
|
||||
|
||||
|
||||
@@ -42,7 +42,8 @@ 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)
|
||||
@IfProfileValue(name = GemfireProfileValueSource.PRODUCT_NAME_KEY,
|
||||
value = GemfireProfileValueSource.PIVOTAL_GEMFIRE_PRODUCT_NAME)
|
||||
@ProfileValueSourceConfiguration(GemfireProfileValueSource.class)
|
||||
public class ContainerXmlSetupTest {
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class GemfireProfileValueSource implements ProfileValueSource {
|
||||
private static final Map<String, String> PROFILE_VALUES = new ConcurrentHashMap<String, String>();
|
||||
|
||||
static {
|
||||
PROFILE_VALUES.put(PRODUCT_NAME_KEY, GemfireUtils.GEMFIRE_NAME);
|
||||
PROFILE_VALUES.put(PRODUCT_NAME_KEY, System.getProperty(PRODUCT_NAME_KEY, GemfireUtils.GEMFIRE_NAME));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.gemstone.gemfire.cache.TimeoutException;
|
||||
import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue;
|
||||
import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueueFactory;
|
||||
import com.gemstone.gemfire.cache.control.ResourceManager;
|
||||
import com.gemstone.gemfire.cache.lucene.LuceneService;
|
||||
import com.gemstone.gemfire.cache.query.Index;
|
||||
import com.gemstone.gemfire.cache.query.IndexExistsException;
|
||||
import com.gemstone.gemfire.cache.query.IndexInvalidException;
|
||||
@@ -578,9 +579,17 @@ public class StubCache implements Cache {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.gemstone.gemfire.cache.Cache#getMembers()
|
||||
* @see com.gemstone.gemfire.cache.Cache#getLuceneService()
|
||||
*/
|
||||
@Override
|
||||
public LuceneService getLuceneService() {
|
||||
throw new UnsupportedOperationException(NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.gemstone.gemfire.cache.Cache#getMembers()
|
||||
*/
|
||||
@Override
|
||||
public Set<DistributedMember> getMembers() {
|
||||
throw new UnsupportedOperationException(NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,8 @@ 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)
|
||||
@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