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:
John Blum
2015-05-22 18:22:50 -07:00
parent b3943ebb46
commit 8363d6f463
22 changed files with 145 additions and 65 deletions

View File

@@ -52,6 +52,7 @@ if (project.hasProperty('platformVersion')) {
tasks.withType(Test).all {
forkEvery = 1
systemProperties['product.name'] = 'Apache Geode'
systemProperties['gemfire.disableShutdownHook'] = 'true'
systemProperties['org.springframework.data.gemfire.test.GemfireTestRunner.nomock'] = System.getProperty('org.springframework.data.gemfire.test.GemfireTestRunner.nomock')
}
@@ -71,7 +72,7 @@ dependencies {
exclude group: "commons-logging", module: "commons-logging"
}
// GemFire
// Apache Geode (a.k.a. Pivotal GemFire)
compile("com.gemstone.gemfire:gemfire-core:$gemfireVersion")
compile("com.gemstone.gemfire:gemfire-jgroups:$gemfireVersion")
compile("com.gemstone.gemfire:gemfire-joptsimple:$gemfireVersion")
@@ -80,7 +81,6 @@ dependencies {
runtime("antlr:antlr:$antlrVersion")
compile "org.aspectj:aspectjweaver:$aspectjVersion"
compile "com.fasterxml.jackson.core:jackson-core:$jacksonVersion"
compile "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion"
compile "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
compile "org.slf4j:slf4j-api:$slf4jVersion"

View File

@@ -1,6 +1,6 @@
antlrVersion=2.7.7
aspectjVersion=1.8.5
gemfireVersion=1.0.0.0-SNAPSHOT
gemfireVersion=1.0.0-incubating-SNAPSHOT
hamcrestVersion=1.3
jacksonVersion=2.5.1
junitVersion=4.12
@@ -11,4 +11,4 @@ spring.range="[4.0.0, 5.0.0)"
springVersion=4.1.6.RELEASE
springDataBuildVersion=1.7.0.BUILD-SNAPSHOT
springDataCommonsVersion=1.11.0.BUILD-SNAPSHOT
version=1.7.0.BUILD-SNAPSHOT
version=1.7.0.APACHE-GEODE-BUILD-SNAPSHOT

View File

@@ -252,12 +252,10 @@ public class CacheFactoryBean implements BeanClassLoaderAware, BeanFactoryAware,
/* (non-Javadoc) */
protected void postProcessPropertiesBeforeInitialization(Properties gemfireProperties) {
if (GemfireUtils.isGemfireVersion8OrAbove()) {
gemfireProperties.setProperty("disable-auto-reconnect", String.valueOf(
!Boolean.TRUE.equals(getEnableAutoReconnect())));
gemfireProperties.setProperty("use-cluster-configuration", String.valueOf(
Boolean.TRUE.equals(getUseClusterConfiguration())));
}
gemfireProperties.setProperty("disable-auto-reconnect", String.valueOf(
!Boolean.TRUE.equals(getEnableAutoReconnect())));
gemfireProperties.setProperty("use-cluster-configuration", String.valueOf(
Boolean.TRUE.equals(getUseClusterConfiguration())));
}
/* (non-Javadoc) */

View File

@@ -18,6 +18,7 @@ package org.springframework.data.gemfire;
import java.util.concurrent.ConcurrentMap;
import org.springframework.data.gemfire.config.support.GemfireFeature;
import org.springframework.util.ClassUtils;
import org.w3c.dom.Element;
@@ -38,7 +39,7 @@ public abstract class GemfireUtils {
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_TYPE_NAME = "com.gemstone.gemfire.cache.AsyncEventQueue";
private static final String ASYNC_EVENT_QUEUE_TYPE_NAME = "com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue";
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";
@@ -46,6 +47,13 @@ public abstract class GemfireUtils {
return ClassUtils.isPresent(fullyQualifiedClassName, GemfireUtils.class.getClassLoader());
}
public static boolean isGemfireFeatureAvailable(GemfireFeature feature) {
boolean featureAvailable = (!GemfireFeature.AEQ.equals(feature) || isAsyncEventQueueAvailable());
featureAvailable &= (!GemfireFeature.CONTINUOUS_QUERY.equals(feature) || isContinuousQueryAvailable());
featureAvailable &= (!GemfireFeature.WAN.equals(feature) || isGatewayAvailable());
return featureAvailable;
}
public static boolean isGemfireFeatureAvailable(Element element) {
boolean featureAvailable = (!isAsyncEventQueue(element) || isAsyncEventQueueAvailable());
featureAvailable &= (!isContinuousQuery(element) || isContinuousQueryAvailable());
@@ -53,6 +61,10 @@ public abstract class GemfireUtils {
return featureAvailable;
}
public static boolean isGemfireFeatureUnavailable(GemfireFeature feature) {
return !isGemfireFeatureAvailable(feature);
}
public static boolean isGemfireFeatureUnavailable(Element element) {
return !isGemfireFeatureAvailable(element);
}

View File

@@ -17,7 +17,6 @@ package org.springframework.data.gemfire;
import org.springframework.util.Assert;
import com.gemstone.gemfire.cache.CacheFactory;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.RegionFactory;
@@ -29,11 +28,6 @@ public class PartitionedRegionFactoryBean<K, V> extends RegionFactoryBean<K, V>
@Override
protected void resolveDataPolicy(RegionFactory<K, V> regionFactory, Boolean persistent, DataPolicy dataPolicy) {
// First, verify the GemFire version is 6.5 or Higher when Persistence is specified...
Assert.isTrue(!DataPolicy.PERSISTENT_PARTITION.equals(dataPolicy) || GemfireUtils.isGemfireVersion65OrAbove(),
String.format("Persistent PARTITION Regions can only be used from GemFire 6.5 onwards; current version is [%1$s].",
CacheFactory.getVersion()));
if (dataPolicy == null) {
dataPolicy = (isPersistent() ? DataPolicy.PERSISTENT_PARTITION : DataPolicy.PARTITION);
}

View File

@@ -119,17 +119,14 @@ abstract class AbstractRegionParser extends AbstractSingleBeanDefinitionParser {
// Factory will enable gateway if it is not set and hub-id is set.
if (StringUtils.hasText(enableGateway)) {
if (GemfireUtils.isGemfireVersion7OrAbove()) {
log.warn("'enable-gateway' has been deprecated since Gemfire 7.0");
}
log.warn("'enable-gateway' has been deprecated since Gemfire 7.0; use the new GatewaySender/Receiver WAN support instead");
}
ParsingUtils.setPropertyValue(element, regionBuilder, "enable-gateway");
if (StringUtils.hasText(hubId)) {
if (GemfireUtils.isGemfireVersion7OrAbove()) {
log.warn("'hub-id' has been deprecated since Gemfire 7.0");
}
log.warn("'hub-id' has been deprecated since Gemfire 7.0; use the new GatewaySender/Receiver WAN support instead");
if (!CollectionUtils.isEmpty(DomUtils.getChildElementsByTagName(element, "gateway-sender"))) {
parserContext.getReaderContext().error("specifying both 'hub-id' and 'gateway-sender' is invalid",
element);

View File

@@ -27,6 +27,7 @@ import org.springframework.beans.factory.support.ManagedMap;
import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.data.gemfire.CacheFactoryBean;
import org.springframework.data.gemfire.config.support.GemfireFeature;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.util.xml.DomUtils;
@@ -97,7 +98,8 @@ class CacheParser extends AbstractSimpleBeanDefinitionParser {
Element gatewayConflictResolver = DomUtils.getChildElementByTagName(element, "gateway-conflict-resolver");
if (gatewayConflictResolver != null) {
ParsingUtils.throwExceptionIfNotGemfireV7(element.getLocalName(), "gateway-conflict-resolver", parserContext);
ParsingUtils.throwExceptionWhenGemFireFeatureUnavailable(GemfireFeature.WAN, element.getLocalName(),
"gateway-conflict-resolver", parserContext);
builder.addPropertyValue("gatewayConflictResolver", ParsingUtils.parseRefOrSingleNestedBeanDeclaration(
parserContext, gatewayConflictResolver, builder));
}

View File

@@ -18,8 +18,6 @@ package org.springframework.data.gemfire.config;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.PropertyValue;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.RuntimeBeanReference;
@@ -31,6 +29,7 @@ import org.springframework.data.gemfire.EvictionAttributesFactoryBean;
import org.springframework.data.gemfire.ExpirationAttributesFactoryBean;
import org.springframework.data.gemfire.GemfireUtils;
import org.springframework.data.gemfire.SubscriptionAttributesFactoryBean;
import org.springframework.data.gemfire.config.support.GemfireFeature;
import org.springframework.util.StringUtils;
import org.springframework.util.xml.DomUtils;
import org.w3c.dom.Element;
@@ -49,8 +48,6 @@ import com.gemstone.gemfire.cache.ResumptionAction;
*/
abstract class ParsingUtils {
private static final Log log = LogFactory.getLog(ParsingUtils.class);
static void setPropertyReference(Element element, BeanDefinitionBuilder builder, String attributeName,
String propertyName) {
@@ -329,12 +326,7 @@ abstract class ParsingUtils {
String concurrencyChecksEnabled = element.getAttribute("concurrency-checks-enabled");
if (StringUtils.hasText(concurrencyChecksEnabled)) {
if (GemfireUtils.isGemfireVersion7OrAbove()) {
ParsingUtils.setPropertyValue(element, regionAttributesBuilder, "concurrency-checks-enabled");
}
else {
log.warn("Setting 'concurrency-checks-enabled' is only available in Gemfire 7.0 or above!");
}
ParsingUtils.setPropertyValue(element, regionAttributesBuilder, "concurrency-checks-enabled");
}
}
@@ -397,7 +389,8 @@ abstract class ParsingUtils {
Element expirationElement = DomUtils.getChildElementByTagName(rootElement, elementName);
if (expirationElement != null) {
Object customExpiry = parseRefOrSingleNestedBeanDeclaration(parserContext, expirationElement, regionAttributesBuilder);
Object customExpiry = parseRefOrSingleNestedBeanDeclaration(parserContext, expirationElement,
regionAttributesBuilder);
regionAttributesBuilder.addPropertyValue(propertyName, customExpiry);
return true;
}
@@ -416,10 +409,6 @@ abstract class ParsingUtils {
}
}
static String resolveCacheReference(final String cacheRef) {
return (StringUtils.hasText(cacheRef) ? cacheRef : GemfireConstants.DEFAULT_GEMFIRE_CACHE_NAME);
}
static void assertGemFireFeatureAvailable(Element element, ParserContext parserContext) {
if (GemfireUtils.isGemfireFeatureUnavailable(element)) {
parserContext.getReaderContext().error(String.format("'%1$s' is not supported in %2$s v%3$s",
@@ -427,8 +416,14 @@ abstract class ParsingUtils {
}
}
static void throwExceptionIfNotGemfireV7(String elementName, String attributeName, ParserContext parserContext) {
if (!GemfireUtils.isGemfireVersion7OrAbove()) {
static String resolveCacheReference(final String cacheRef) {
return (StringUtils.hasText(cacheRef) ? cacheRef : GemfireConstants.DEFAULT_GEMFIRE_CACHE_NAME);
}
static void throwExceptionWhenGemFireFeatureUnavailable(GemfireFeature feature,
String elementName, String attributeName, ParserContext parserContext) {
if (GemfireUtils.isGemfireFeatureUnavailable(feature)) {
String messagePrefix = (attributeName != null)
? String.format("Attribute '%1$s' of element '%2$s'", attributeName, elementName)
: String.format("Element '%1$s'", elementName);

View File

@@ -0,0 +1,59 @@
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.gemfire.config.support;
/**
* The GemfireFeature enum is an enumeration of features available in Apache Geode and Pivotal GemFire combined.
*
* @author John Blum
* @since 1.7.0
*/
@SuppressWarnings("unused")
public enum GemfireFeature {
AEQ,
BACKUP,
CACHING,
CLIENT_SERVER,
COMPRESSION,
CONFIGURATION,
CONSISTENCY,
CONTINUOUS_QUERY,
DELTA_PROPAGATION,
EVENT_HANDLING,
FUNCTIONS,
HTTP_SESSION_MANAGEMENT,
INDEXING,
JSON,
LOGGING,
MANAGEMENT_MONITORING,
MEMCACHE_SUPPORT,
NETWORK_PARTITIONING,
OFF_HEAP,
PARTITIONING,
PEER_TO_PEER,
PERSISTENCE,
QUERY,
REGISTER_INTEREST,
REPLICATION,
SECURITY,
SERIALIZATION,
STATISTICS,
TRANSACTIONS,
TUNING,
WAN
}

View File

@@ -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")));

View File

@@ -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());

View File

@@ -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());
}
}

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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() {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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 {