SGF-564 - Reorganize the SDG API into logical packages based on functional concern.

This commit is contained in:
John Blum
2016-11-10 23:51:10 -08:00
parent d3041d05a4
commit 623282faef
84 changed files with 372 additions and 667 deletions

View File

@@ -61,7 +61,7 @@ Since 1.1, Spring Data GemFire provides an implementation of the Spring 3.1 http
<gfe:cache id="gemfire-cache"/>
<!-- declare GemFire Cache Manager -->
<bean id="cacheManager" class="org.springframework.data.gemfire.support.GemfireCacheManager" p:cache-ref="gemfire-cache">
<bean id="cacheManager" class="org.springframework.data.gemfire.cache.GemfireCacheManager" p:cache-ref="gemfire-cache">
</beans>
----

View File

@@ -703,7 +703,7 @@ class, like so...
+
[source,xml]
----
<bean id="ttlExpiration" class="org.springframework.data.gemfire.support.AnnotationBasedExpiration"
<bean id="ttlExpiration" class="org.springframework.data.gemfire.expiration.AnnotationBasedExpiration"
factory-method="forTimeToLive"/>
<gfe:partitioned-region id="Example" persistent="false">
@@ -733,7 +733,7 @@ Expiration attributes on the `AnnotationBasedExpiration` bean by doing the follo
<constructor-arg value="#{T(com.gemstone.gemfire.cache.ExpirationAction).DESTROY}"/>
</bean>
<bean id="ttiExpiration" class="org.springframework.data.gemfire.support.AnnotationBasedExpiration"
<bean id="ttiExpiration" class="org.springframework.data.gemfire.expiration.AnnotationBasedExpiration"
factory-method="forIdleTimeout">
<constructor-arg ref="defaultExpirationAttributes"/>
</bean>
@@ -786,7 +786,7 @@ can be strongly typed. For example (building on the example above)...
----
<util:properties id="expirationSettings">
<prop key="gemfire.region.entry.expiration.ttl.timeout">600</prop>
<prop key="gemfire.region.entry.expiration.ttl.action">#{T(org.springframework.data.gemfire.ExpirationActionType).DESTROY}</prop>
<prop key="gemfire.region.entry.expiration.ttl.action">#{T(org.springframework.data.gemfire.expiration.ExpirationActionType).DESTROY}</prop>
<prop key="gemfire.region.entry.expiration.tti.action">#{T(com.gemstone.gemfire.cache.ExpirationAction).INVALIDATE}</prop>
...
</util:properties>

View File

@@ -15,13 +15,12 @@
*/
package org.springframework.data.gemfire;
import org.springframework.data.gemfire.support.RegionShortcutWrapper;
import org.springframework.util.Assert;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.RegionFactory;
import com.gemstone.gemfire.cache.Scope;
import org.springframework.util.Assert;
/**
* @author David Turanski
* @author John Blum

View File

@@ -18,17 +18,6 @@ package org.springframework.data.gemfire;
import java.lang.reflect.Field;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.context.SmartLifecycle;
import org.springframework.core.io.Resource;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.support.RegionShortcutWrapper;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.ReflectionUtils;
import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.CacheListener;
@@ -48,6 +37,16 @@ import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue;
import com.gemstone.gemfire.cache.wan.GatewaySender;
import com.gemstone.gemfire.internal.cache.UserSpecifiedRegionAttributes;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.context.SmartLifecycle;
import org.springframework.core.io.Resource;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.ReflectionUtils;
/**
* Base class for FactoryBeans used to create GemFire {@link Region}s. Will try
* to first locate the region (by name) and, in case none if found, proceed to

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.data.gemfire.support;
import org.springframework.util.ObjectUtils;
package org.springframework.data.gemfire;
import com.gemstone.gemfire.cache.RegionShortcut;
import org.springframework.util.ObjectUtils;
/**
* The RegionShortcutWrapper enum is a Java enumerated type that wraps GemFire's RegionShortcuts
* with Spring Data GemFire RegionShortcutWrapper enumerated values.

View File

@@ -1,176 +0,0 @@
/*
* 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;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.BeanInitializationException;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import com.gemstone.gemfire.cache.CacheListener;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue;
import com.gemstone.gemfire.cache.wan.GatewaySender;
/**
* FactoryBean for creating a Gemfire sub-Regions.
*
* @author David Turanski
* @author John Blum
* @param <K> Region Key Type
* @param <V> Region Value Type
* @deprecated as Spring Data GemFire 1.4.0. Use Region type specific FactoryBeans
* (e.g. ReplicatedRegionFactoryBean) instead.
*/
@Deprecated
@SuppressWarnings({"deprecation", "unused"})
public class SubRegionFactoryBean<K, V> extends com.gemstone.gemfire.cache.AttributesFactory<K, V>
implements FactoryBean<Region<K, V>>, InitializingBean {
protected final Log log = LogFactory.getLog(getClass());
private boolean lookupOnly;
private CacheListener<K, V>[] cacheListeners;
private Object[] asyncEventQueues;
private Object[] gatewaySenders;
private Region<?, ?> parentRegion;
private Region<K, V> subRegion;
private String name;
private String regionName;
@Override
public Region<K, V> getObject() throws Exception {
return this.subRegion;
}
@Override
public Class<?> getObjectType() {
// TODO perhaps this should be 'return (subRegion != null ? subRegion.getClass() : Region.class);' for consistency.
return Region.class;
}
@Override
public boolean isSingleton() {
return true;
}
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(parentRegion, "The parent Region cannot be null.");
this.subRegion = parentRegion.getSubregion(regionName);
if (this.subRegion == null) {
if (lookupOnly) {
throw new BeanInitializationException(String.format("Cannot find Region [%1$s] in Cache %2$s",
regionName, parentRegion.getRegionService()));
}
else {
log.debug(String.format("Creating sub-Region of [%1$s] with name [%2$s]...",
(parentRegion.getFullPath() != null ? parentRegion.getFullPath() : parentRegion.getName()),
regionName));
if (!ObjectUtils.isEmpty(asyncEventQueues)) {
for (Object asyncEventQueue : asyncEventQueues) {
addAsyncEventQueueId(((AsyncEventQueue) asyncEventQueue).getId());
}
}
if (!ObjectUtils.isEmpty(cacheListeners)) {
for (CacheListener<K, V> listener : cacheListeners) {
addCacheListener(listener);
}
}
if (!ObjectUtils.isEmpty(gatewaySenders)) {
for (Object gatewaySender : gatewaySenders) {
addGatewaySenderId(((GatewaySender) gatewaySender).getId());
}
}
this.subRegion = this.parentRegion.createSubregion(regionName, create());
}
}
}
/**
*
* @param asyncEventQueues defined as Object for backward compatibility with Gemfire 6.
*/
public void setAsyncEventQueues(Object[] asyncEventQueues) {
this.asyncEventQueues = asyncEventQueues;
}
/**
* Sets the cache listeners used for the region used by this factory. Used
* only when a new region is created. Overrides the settings specified
* through setAttributes(com.gemstone.gemfire.cache.RegionAttributes).
*
* @param cacheListeners the cacheListeners to set on a newly created region
*/
public void setCacheListeners(CacheListener<K, V>[] cacheListeners) {
this.cacheListeners = cacheListeners;
}
public void setGatewaySenders(Object[] gatewaySenders) {
this.gatewaySenders = gatewaySenders;
}
/**
* Set to true if the subregion should already exist, e.g., specified by
* &lt;lookup-region&gt;
*
* @param lookupOnly a boolean value indicating whether this Subregion should be looked up instead of created.
*/
public void setLookupOnly(boolean lookupOnly) {
this.lookupOnly = lookupOnly;
}
/**
* Set the bean name - the same as the Subregion full path.
*
* @param name the name of this Subregion bean in the Spring context.
*/
public void setName(String name) {
this.name = name;
}
/**
* Set the simple name of this Subregion.
*
* @param regionName the simple name of this Subregion.
*/
public void setRegionName(String regionName) {
this.regionName = regionName;
}
/**
* Set the parent Region.
*
* @param parent a reference to the parent Region.
*/
public void setParent(Region<?, ?> parent) {
this.parentRegion = parent;
}
}

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.cache;
import java.util.concurrent.Callable;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.cache;
import java.util.Collection;
import java.util.HashSet;
@@ -141,7 +141,7 @@ public class GemfireCacheManager extends AbstractCacheManager {
*
* @param region GemFire {@link Region} to wrap (adapt).
* @return an instance of {@link GemfireCache} initialized with the given GemFire {@link Region}.
* @see org.springframework.data.gemfire.support.GemfireCache
* @see GemfireCache
* @see com.gemstone.gemfire.cache.Region
*/
protected GemfireCache newGemfireCache(Region<?, ?> region) {

View File

@@ -16,6 +16,18 @@
package org.springframework.data.gemfire.client;
import com.gemstone.gemfire.cache.CacheListener;
import com.gemstone.gemfire.cache.CacheLoader;
import com.gemstone.gemfire.cache.CacheWriter;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.GemFireCache;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.cache.client.ClientRegionFactory;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
import com.gemstone.gemfire.cache.client.Pool;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeansException;
@@ -31,18 +43,6 @@ import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import com.gemstone.gemfire.cache.CacheListener;
import com.gemstone.gemfire.cache.CacheLoader;
import com.gemstone.gemfire.cache.CacheWriter;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.GemFireCache;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.cache.client.ClientRegionFactory;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
import com.gemstone.gemfire.cache.client.Pool;
/**
* Client extension for GemFire Regions.
*

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.client;
import org.springframework.core.convert.converter.Converter;

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.data.gemfire.support;
import org.springframework.util.ObjectUtils;
package org.springframework.data.gemfire.client;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
import org.springframework.util.ObjectUtils;
/**
* The ClientRegionShortcutWrapper enum is a Java enumerated type that wraps GemFire's ClientRegionShortcuts
* with Spring Data GemFire ClientRegionShortcutWrapper enumerated values.

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2002-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.
@@ -16,6 +16,14 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.cache.client.ClientRegionFactory;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
import com.gemstone.gemfire.cache.execute.Function;
import com.gemstone.gemfire.management.internal.cli.domain.RegionInformation;
import com.gemstone.gemfire.management.internal.cli.functions.GetRegionsFunction;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeansException;
@@ -26,14 +34,6 @@ import org.springframework.data.gemfire.support.ListRegionsOnServerFunction;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.cache.client.ClientRegionFactory;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
import com.gemstone.gemfire.cache.execute.Function;
import com.gemstone.gemfire.management.internal.cli.domain.RegionInformation;
import com.gemstone.gemfire.management.internal.cli.functions.GetRegionsFunction;
/**
* A Spring {@link BeanFactoryPostProcessor} used to register a Client Region Proxy bean for each Region
* accessible to a GemFire DataSource. If the Region is already defined, the bean definition will not be overridden.

View File

@@ -16,15 +16,15 @@
package org.springframework.data.gemfire.client;
import com.gemstone.gemfire.cache.InterestResultPolicy;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.Constants;
import org.springframework.util.Assert;
import com.gemstone.gemfire.cache.InterestResultPolicy;
/**
* The Interest class holds details for registering a client interest.
*
*
* @author Costin Leau
* @author John Blum
* @see org.springframework.beans.factory.InitializingBean
@@ -85,7 +85,7 @@ public class Interest<K> implements InitializingBean {
/**
* Returns the key of interest.
*
*
* @return the key
*/
public K getKey() {
@@ -94,7 +94,7 @@ public class Interest<K> implements InitializingBean {
/**
* Sets the key of interest.
*
*
* @param key the key to set
*/
public void setKey(K key) {
@@ -103,7 +103,7 @@ public class Interest<K> implements InitializingBean {
/**
* Returns the interest policy.
*
*
* @return the policy
*/
public InterestResultPolicy getPolicy() {
@@ -114,7 +114,7 @@ public class Interest<K> implements InitializingBean {
* Sets the interest policy. The argument is set as an Object
* to be able to accept both InterestResultType instances but also
* Strings (for XML configurations).
*
*
* @param policy the policy to set
*/
public void setPolicy(Object policy) {
@@ -132,7 +132,7 @@ public class Interest<K> implements InitializingBean {
/**
* Returns the interest durability.
*
*
* @return the durable
*/
public boolean isDurable() {
@@ -141,7 +141,7 @@ public class Interest<K> implements InitializingBean {
/**
* Sets the interest durability.
*
*
* @param durable the durable to set
*/
public void setDurable(boolean durable) {
@@ -150,7 +150,7 @@ public class Interest<K> implements InitializingBean {
/**
* Returns the type of values received by the listener.
*
*
* @return the receiveValues
*/
public boolean isReceiveValues() {
@@ -159,7 +159,7 @@ public class Interest<K> implements InitializingBean {
/**
* Switches between the different entities received by the listener.
*
*
* @param receiveValues the receiveValues to set
*/
public void setReceiveValues(boolean receiveValues) {

View File

@@ -16,10 +16,10 @@
package org.springframework.data.gemfire.client;
import org.springframework.data.gemfire.support.AbstractPropertyEditorConverterSupport;
import com.gemstone.gemfire.cache.InterestResultPolicy;
import org.springframework.data.gemfire.support.AbstractPropertyEditorConverterSupport;
/**
* The InterestResultPolicyConverter class is a Spring Converter and JavaBeans PropertyEditor capable of converting
* a String into a GemFire InterestResultPolicyConverter.

View File

@@ -21,12 +21,12 @@ import java.net.InetSocketAddress;
import java.util.Collection;
import java.util.List;
import org.springframework.data.gemfire.util.SpringUtils;
import org.springframework.util.Assert;
import com.gemstone.gemfire.cache.client.Pool;
import com.gemstone.gemfire.cache.query.QueryService;
import org.springframework.data.gemfire.util.SpringUtils;
import org.springframework.util.Assert;
/**
* The DefaultableDelegatingPoolAdapter class is a wrapper class around Pool allowing default configuration property
* values to be providing in the case that the Pool's setting were null.

View File

@@ -21,12 +21,12 @@ import java.net.InetSocketAddress;
import java.util.Collections;
import java.util.List;
import org.springframework.data.gemfire.GemfireUtils;
import org.springframework.data.gemfire.client.PoolAdapter;
import com.gemstone.gemfire.cache.client.PoolFactory;
import com.gemstone.gemfire.cache.query.QueryService;
import org.springframework.data.gemfire.GemfireUtils;
import org.springframework.data.gemfire.client.PoolAdapter;
/**
* FactoryDefaultsPoolAdapter is an abstract implementation of GemFire's {@link com.gemstone.gemfire.cache.client.Pool}
* interface and extension of {@link PoolAdapter} providing default factory values for all configuration properties

View File

@@ -29,10 +29,10 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.gemfire.EvictionActionConverter;
import org.springframework.data.gemfire.EvictionPolicyConverter;
import org.springframework.data.gemfire.EvictionPolicyType;
import org.springframework.data.gemfire.ExpirationActionConverter;
import org.springframework.data.gemfire.eviction.EvictionActionConverter;
import org.springframework.data.gemfire.eviction.EvictionPolicyConverter;
import org.springframework.data.gemfire.eviction.EvictionPolicyType;
import org.springframework.data.gemfire.expiration.ExpirationActionConverter;
import org.springframework.data.gemfire.IndexMaintenancePolicyConverter;
import org.springframework.data.gemfire.IndexMaintenancePolicyType;
import org.springframework.data.gemfire.IndexType;

View File

@@ -21,7 +21,7 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.data.gemfire.FunctionServiceFactoryBean;
import org.springframework.data.gemfire.function.FunctionServiceFactoryBean;
import org.springframework.data.gemfire.util.SpringUtils;
import org.springframework.util.xml.DomUtils;
import org.w3c.dom.Element;
@@ -32,7 +32,7 @@ import org.w3c.dom.Element;
* @author David Turanski
* @author John Blum
* @see org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser
* @see org.springframework.data.gemfire.FunctionServiceFactoryBean
* @see FunctionServiceFactoryBean
*/
class FunctionServiceParser extends AbstractSimpleBeanDefinitionParser {

View File

@@ -16,15 +16,15 @@
package org.springframework.data.gemfire.config.xml;
import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue;
import com.gemstone.gemfire.cache.wan.GatewaySender;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.data.gemfire.LookupRegionFactoryBean;
import org.springframework.util.xml.DomUtils;
import org.w3c.dom.Element;
import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue;
import com.gemstone.gemfire.cache.wan.GatewaySender;
/**
* Bean definition parser for the &lt;gfe:lookup-region&gt; SDG XML namespace (XSD) element.
*

View File

@@ -31,10 +31,10 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.ManagedList;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.core.Conventions;
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.eviction.EvictionAttributesFactoryBean;
import org.springframework.data.gemfire.expiration.ExpirationAttributesFactoryBean;
import org.springframework.data.gemfire.util.SpringUtils;
import org.springframework.util.StringUtils;
import org.springframework.util.xml.DomUtils;

View File

@@ -14,18 +14,18 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
import org.springframework.data.gemfire.support.AbstractPropertyEditorConverterSupport;
package org.springframework.data.gemfire.eviction;
import com.gemstone.gemfire.cache.EvictionAction;
import org.springframework.data.gemfire.support.AbstractPropertyEditorConverterSupport;
/**
* The EvictionActionConverter class is a Spring Converter and JavaBeans PropertyEditor that converts
* an Object value into an instance of GemFire EvictionAction.
*
* @author John Blum
* @see org.springframework.data.gemfire.EvictionActionType
* @see EvictionActionType
* @see org.springframework.data.gemfire.support.AbstractPropertyEditorConverterSupport
* @see com.gemstone.gemfire.cache.EvictionAction
* @since 1.6.0

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.eviction;
import com.gemstone.gemfire.cache.EvictionAction;

View File

@@ -14,10 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
package org.springframework.data.gemfire.eviction;
import com.gemstone.gemfire.cache.EvictionAction;
import com.gemstone.gemfire.cache.EvictionAttributes;
@@ -25,6 +22,9 @@ import com.gemstone.gemfire.cache.util.ObjectSizer;
import com.gemstone.gemfire.internal.cache.lru.LRUCapacityController;
import com.gemstone.gemfire.internal.cache.lru.MemLRUCapacityController;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
/**
* Simple utility class used for defining nested factory-method like definitions w/o polluting the container with useless beans.
*

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.eviction;
import org.springframework.data.gemfire.support.AbstractPropertyEditorConverterSupport;

View File

@@ -14,14 +14,14 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.eviction;
import com.gemstone.gemfire.cache.EvictionAlgorithm;
/**
* The EvictionPolicyType enum is an enumeration of all GemFire Eviction policies, where the Eviction 'policy'
* is a combination of the Eviction algorithm mixed with the monitored resource (e.g. such as JVM HEAP memory).
*
*
* @author Costin Leau
* @author John Blum
* @see com.gemstone.gemfire.cache.EvictionAlgorithm

View File

@@ -14,11 +14,16 @@
* limitations under the License.
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.expiration;
import java.lang.annotation.Annotation;
import java.util.concurrent.atomic.AtomicReference;
import com.gemstone.gemfire.cache.CustomExpiry;
import com.gemstone.gemfire.cache.ExpirationAction;
import com.gemstone.gemfire.cache.ExpirationAttributes;
import com.gemstone.gemfire.cache.Region;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
@@ -29,8 +34,6 @@ import org.springframework.context.expression.EnvironmentAccessor;
import org.springframework.context.expression.MapAccessor;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.core.convert.ConversionService;
import org.springframework.data.gemfire.ExpirationActionConverter;
import org.springframework.data.gemfire.ExpirationActionType;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.EvaluationException;
import org.springframework.expression.Expression;
@@ -42,11 +45,6 @@ import org.springframework.expression.spel.support.StandardTypeLocator;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import com.gemstone.gemfire.cache.CustomExpiry;
import com.gemstone.gemfire.cache.ExpirationAction;
import com.gemstone.gemfire.cache.ExpirationAttributes;
import com.gemstone.gemfire.cache.Region;
/**
* The AnnotationBasedExpiration class is an implementation of GemFire's CustomExpiry interface that determines
* the Time-To-Live (TTL) or Idle-Timeout (TTI) expiration policy of a Region entry by introspecting the Region
@@ -57,10 +55,10 @@ import com.gemstone.gemfire.cache.Region;
* @see java.lang.annotation.Annotation
* @see org.springframework.beans.factory.BeanFactory
* @see org.springframework.beans.factory.BeanFactoryAware
* @see org.springframework.data.gemfire.ExpirationActionType
* @see org.springframework.data.gemfire.support.Expiration
* @see org.springframework.data.gemfire.support.IdleTimeoutExpiration
* @see org.springframework.data.gemfire.support.TimeToLiveExpiration
* @see ExpirationActionType
* @see Expiration
* @see IdleTimeoutExpiration
* @see TimeToLiveExpiration
* @see com.gemstone.gemfire.cache.CustomExpiry
* @see com.gemstone.gemfire.cache.ExpirationAction
* @see com.gemstone.gemfire.cache.ExpirationAttributes
@@ -103,8 +101,8 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @param <K> the class type of the Region Entry Key.
* @param <V> the class type of the Region Entry Value.
* @return an AnnotationBasedExpiration instance to process Idle Timeout Expiration annotated Region Entries.
* @see org.springframework.data.gemfire.support.AnnotationBasedExpiration
* @see org.springframework.data.gemfire.support.IdleTimeoutExpiration
* @see AnnotationBasedExpiration
* @see IdleTimeoutExpiration
* @see #forIdleTimeout(com.gemstone.gemfire.cache.ExpirationAttributes)
*/
public static <K, V> AnnotationBasedExpiration<K, V> forIdleTimeout() {
@@ -120,8 +118,8 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @param defaultExpirationAttributes ExpirationAttributes used by default if no Expiration policy was specified
* on the Region Entry.
* @return an AnnotationBasedExpiration instance to process Idle Timeout Expiration annotated Region Entries.
* @see org.springframework.data.gemfire.support.AnnotationBasedExpiration
* @see org.springframework.data.gemfire.support.IdleTimeoutExpiration
* @see AnnotationBasedExpiration
* @see IdleTimeoutExpiration
*/
public static <K, V> AnnotationBasedExpiration<K, V> forIdleTimeout(ExpirationAttributes defaultExpirationAttributes) {
return new AnnotationBasedExpiration<K, V>(defaultExpirationAttributes) {
@@ -139,8 +137,8 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @param <K> the class type of the Region Entry Key.
* @param <V> the class type of the Region Entry Value.
* @return an AnnotationBasedExpiration instance to process Time-To-Live Expiration annotated Region Entries.
* @see org.springframework.data.gemfire.support.AnnotationBasedExpiration
* @see org.springframework.data.gemfire.support.TimeToLiveExpiration
* @see AnnotationBasedExpiration
* @see TimeToLiveExpiration
* @see #forTimeToLive(com.gemstone.gemfire.cache.ExpirationAttributes)
*/
public static <K, V> AnnotationBasedExpiration<K, V> forTimeToLive() {
@@ -156,8 +154,8 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @param defaultExpirationAttributes ExpirationAttributes used by default if no Expiration policy was specified
* on the Region Entry.
* @return an AnnotationBasedExpiration instance to process Time-To-Live Expiration annotated Region Entries.
* @see org.springframework.data.gemfire.support.AnnotationBasedExpiration
* @see org.springframework.data.gemfire.support.TimeToLiveExpiration
* @see AnnotationBasedExpiration
* @see TimeToLiveExpiration
*/
public static <K, V> AnnotationBasedExpiration<K, V> forTimeToLive(ExpirationAttributes defaultExpirationAttributes) {
return new AnnotationBasedExpiration<K, V>(defaultExpirationAttributes) {
@@ -268,7 +266,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @param entry the Region entry used as the source of the expiration meta-data.
* @return ExpirationMetaData extracted from the Region entry.
* @throws NullPointerException if the Region.Entry, Region or the Region's attributes are null.
* @see org.springframework.data.gemfire.support.AnnotationBasedExpiration.ExpirationMetaData
* @see AnnotationBasedExpiration.ExpirationMetaData
*/
protected ExpirationMetaData getExpirationMetaData(Region.Entry<K, V> entry) {
return (isExpirationConfigured(entry) ? ExpirationMetaData.from(getExpiration(entry)) : null);
@@ -284,7 +282,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @return a custom ExpirationAttributes configured with the application domain object specific expiration policy
* or the default expiration settings if the application domain object has not been annotated with custom
* expiration meta-data.
* @see org.springframework.data.gemfire.support.AnnotationBasedExpiration.ExpirationMetaData
* @see AnnotationBasedExpiration.ExpirationMetaData
* @see com.gemstone.gemfire.cache.ExpirationAttributes
* @see #getDefaultExpirationAttributes()
*/
@@ -298,7 +296,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
*
* @param entry the Region.Entry to evaluate for the presence of the Expiration Annotation.
* @return a boolean value indicating whether the Region Entry has been annotated with @Expiration.
* @see org.springframework.data.gemfire.support.Expiration
* @see Expiration
* @see #isAnnotationPresent(Object, Class)
*/
protected boolean isExpirationConfigured(Region.Entry<K, V> entry) {
@@ -311,7 +309,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @param entry the Region.Entry from which to extract the Expiration Annotation meta-data.
* @return the Expiration Annotation meta-data for the given Region Entry or {@code null}
* if the Region Entry has not been annotated with @Expiration.
* @see org.springframework.data.gemfire.support.Expiration
* @see Expiration
* @see #getAnnotation(Object, Class)
*/
protected Expiration getExpiration(Region.Entry<K, V> entry) {
@@ -323,7 +321,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
*
* @param entry the Region.Entry to evaluate for the presence of the IdleTimeoutExpiration Annotation.
* @return a boolean value indicating whether the Region Entry has been annotated with @IdleTimeoutExpiration.
* @see org.springframework.data.gemfire.support.IdleTimeoutExpiration
* @see IdleTimeoutExpiration
* @see #isAnnotationPresent(Object, Class)
*/
protected boolean isIdleTimeoutConfigured(Region.Entry<K, V> entry) {
@@ -336,7 +334,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @param entry the Region.Entry from which to extract the IdleTimeoutExpiration Annotation meta-data.
* @return the IdleTimeoutExpiration Annotation meta-data for the given Region Entry or {@code null}
* if the Region Entry has not been annotated with @IdleTimeoutExpiration.
* @see org.springframework.data.gemfire.support.IdleTimeoutExpiration
* @see IdleTimeoutExpiration
* @see #getAnnotation(Object, Class)
*/
protected IdleTimeoutExpiration getIdleTimeout(Region.Entry<K, V> entry) {
@@ -348,7 +346,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
*
* @param entry the Region.Entry to evaluate for the presence of the TimeToLiveExpiration Annotation.
* @return a boolean value indicating whether the Region Entry has been annotated with @TimeToLiveExpiration.
* @see org.springframework.data.gemfire.support.TimeToLiveExpiration
* @see TimeToLiveExpiration
* @see #isAnnotationPresent(Object, Class)
*/
protected boolean isTimeToLiveConfigured(Region.Entry<K, V> entry) {
@@ -361,7 +359,7 @@ public class AnnotationBasedExpiration<K, V> implements BeanFactoryAware, Custom
* @param entry the Region.Entry from which to extract the TimeToLiveExpiration Annotation meta-data.
* @return the TimeToLiveExpiration Annotation meta-data for the given Region Entry or {@code null}
* if the Region Entry has not been annotated with @TimeToLiveExpiration.
* @see org.springframework.data.gemfire.support.TimeToLiveExpiration
* @see TimeToLiveExpiration
* @see #getAnnotation(Object, Class)
*/
protected TimeToLiveExpiration getTimeToLive(Region.Entry<K, V> entry) {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.expiration;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
@@ -28,7 +28,7 @@ import java.lang.annotation.Target;
* to express their general expiration policy.
*
* @author John Blum
* @see org.springframework.data.gemfire.ExpirationActionType
* @see ExpirationActionType
* @since 1.7.0
*/
@Documented

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
import org.springframework.data.gemfire.support.AbstractPropertyEditorConverterSupport;
package org.springframework.data.gemfire.expiration;
import com.gemstone.gemfire.cache.ExpirationAction;
import org.springframework.data.gemfire.support.AbstractPropertyEditorConverterSupport;
/**
* The ExpirationActionTypeConverter class is a Spring Converter used to convert a String value into
* a corresponding ExpirationActionType enumerated value.
@@ -27,7 +27,7 @@ import com.gemstone.gemfire.cache.ExpirationAction;
* @author John Blum
* @see java.beans.PropertyEditorSupport
* @see org.springframework.core.convert.converter.Converter
* @see org.springframework.data.gemfire.ExpirationActionType
* @see ExpirationActionType
* @since 1.6.0
*/
public class ExpirationActionConverter extends AbstractPropertyEditorConverterSupport<ExpirationAction> {
@@ -38,7 +38,7 @@ public class ExpirationActionConverter extends AbstractPropertyEditorConverterSu
* @param source the String to convert into an GemFire ExpirationAction.
* @return an GemFire ExpirationAction value for the given String.
* @throws java.lang.IllegalArgumentException if the String is not a valid GemFire ExpirationAction.
* @see org.springframework.data.gemfire.ExpirationActionType#valueOfIgnoreCase(String)
* @see ExpirationActionType#valueOfIgnoreCase(String)
* @see com.gemstone.gemfire.cache.ExpirationAction
*/
@Override

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.expiration;
import com.gemstone.gemfire.cache.ExpirationAction;

View File

@@ -14,14 +14,14 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
package org.springframework.data.gemfire.expiration;
import com.gemstone.gemfire.cache.ExpirationAction;
import com.gemstone.gemfire.cache.ExpirationAttributes;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
/**
* The ExpirationAttributesFactoryBean class is a Spring FactoryBean used to create GemFire ExpirationAttributes
* to specify Expiration policies for Region Time-to-Live (TTL) and Idle-Timeouts (TTI) as well as
@@ -79,7 +79,7 @@ public class ExpirationAttributesFactoryBean implements FactoryBean<ExpirationAt
* Gets the action to perform when a Region or an Entry expires.
*
* @return the type of action to perform on expiration.
* @see org.springframework.data.gemfire.ExpirationActionType
* @see ExpirationActionType
* @see com.gemstone.gemfire.cache.ExpirationAttributes#getAction()
*/
public ExpirationAction getAction() {
@@ -111,7 +111,7 @@ public class ExpirationAttributesFactoryBean implements FactoryBean<ExpirationAt
* @throws Exception if the construction of the ExpirationAttributes was not successful.
* @see #getAction()
* @see #getTimeout()
* @see org.springframework.data.gemfire.ExpirationActionType#getExpirationAction()
* @see ExpirationActionType#getExpirationAction()
* @see com.gemstone.gemfire.cache.ExpirationAttributes
*/
@Override

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.expiration;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
@@ -28,8 +28,8 @@ import java.lang.annotation.Target;
* to express their idle-timeout (TTI) expiration policy.
*
* @author John Blum
* @see org.springframework.data.gemfire.ExpirationActionType
* @see org.springframework.data.gemfire.support.Expiration
* @see ExpirationActionType
* @see Expiration
* @since 1.7.0
*/
@Documented

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.expiration;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
@@ -28,8 +28,8 @@ import java.lang.annotation.Target;
* to express their time-to-live (TTL) expiration policy.
*
* @author John Blum
* @see org.springframework.data.gemfire.ExpirationActionType
* @see org.springframework.data.gemfire.support.Expiration
* @see ExpirationActionType
* @see Expiration
* @since 1.7.0
*/
@Documented

View File

@@ -13,19 +13,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.function;
import java.util.List;
import com.gemstone.gemfire.cache.execute.Function;
import com.gemstone.gemfire.cache.execute.FunctionService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.CollectionUtils;
import com.gemstone.gemfire.cache.execute.Function;
import com.gemstone.gemfire.cache.execute.FunctionService;
/**
* Spring FactoryBean for registering instance of GemFire Function with the GemFire FunctionService.
*

View File

@@ -32,6 +32,7 @@ public abstract class ArrayUtils {
* @param elements variable list of arguments to return as an array.
* @return an arry for the given varargs {@code elements}.
*/
@SafeVarargs
public static <T> T[] asArray(T... elements) {
return elements;
}
@@ -45,7 +46,7 @@ public abstract class ArrayUtils {
* @return the first element in the array or {@literal null} if the array is null or empty.
* @see #getFirst(Object[], Object)
*/
public static <T> T getFirst(T... array) {
public static <T> T getFirst(T[] array) {
return getFirst(array, null);
}

View File

@@ -14,24 +14,24 @@
* limitations under the License.
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.gemstone.gemfire.cache.RegionShortcut;
import org.junit.Test;
/**
* The RegionShortcutWrapperTest class is a test suite of test cases testing the contract and functionality of the
* RegionShortcutWrapper enum class type.
*
* @author John Blum
* @see org.junit.Test
* @see org.springframework.data.gemfire.support.RegionShortcutWrapper
* @see RegionShortcutWrapper
* @see com.gemstone.gemfire.cache.RegionShortcut
* @since 1.4.0
*/
@@ -299,5 +299,4 @@ public class RegionShortcutWrapperTest {
assertTrue(RegionShortcutWrapper.REPLICATE_PROXY.isReplicate());
assertFalse(RegionShortcutWrapper.UNSPECIFIED.isReplicate());
}
}

View File

@@ -1,99 +0,0 @@
/*
* 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;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import org.junit.Test;
import com.gemstone.gemfire.cache.GemFireCache;
import com.gemstone.gemfire.cache.Region;
/**
*
* @author David Turanski
* @author John Blum
*/
public class SubRegionTest extends RecreatingContextTest {
@Override
protected String location() {
return "org/springframework/data/gemfire/basic-subregion.xml";
}
@Test
public void testAll() throws Exception {
testBasic();
testContext();
testChildOnly();
}
@SuppressWarnings({ "rawtypes", "unchecked" })
private void testBasic() throws Exception {
CacheFactoryBean cacheFactoryBean = new CacheFactoryBean();
cacheFactoryBean.setBeanName("gemfireCache");
cacheFactoryBean.setUseBeanFactoryLocator(false);
cacheFactoryBean.afterPropertiesSet();
GemFireCache cache = cacheFactoryBean.getObject();
assertNotNull(cache);
RegionFactoryBean regionFactory = new ReplicatedRegionFactoryBean();
regionFactory.setCache(cache);
regionFactory.setName("Outer");
regionFactory.afterPropertiesSet();
Region outer = regionFactory.getObject();
assertNotNull(outer);
assertEquals("Outer", outer.getName());
assertEquals("/Outer", outer.getFullPath());
assertSame(outer, cache.getRegion("/Outer"));
RegionFactoryBean subRegionFactory = new RegionFactoryBean() { };
subRegionFactory.setCache(cache);
subRegionFactory.setParent(outer);
subRegionFactory.setName("/Outer/Inner");
subRegionFactory.setRegionName("Inner");
subRegionFactory.afterPropertiesSet();
Region inner = subRegionFactory.getObject();
assertNotNull(inner);
assertSame(inner, outer.getSubregion("Inner"));
assertSame(inner, cache.getRegion("/Outer/Inner"));
}
@SuppressWarnings("rawtypes")
private void testContext() throws Exception {
Region parent = ctx.getBean("parent", Region.class);
Region child = ctx.getBean("/parent/child", Region.class);
assertNotNull(parent.getSubregion("child"));
assertSame(child, parent.getSubregion("child"));
assertEquals("/parent/child", child.getFullPath());
}
@SuppressWarnings("rawtypes")
public void testChildOnly() throws Exception {
Region child = ctx.getBean("/parent/child", Region.class);
assertEquals("/parent/child", child.getFullPath());
}
}

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.cache;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -22,9 +22,12 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import com.gemstone.gemfire.cache.Region;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
@@ -34,8 +37,6 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Assert;
import com.gemstone.gemfire.cache.Region;
/**
* The CachingWithGemFireIntegrationTest class is a test suite of test cases testing the contract and functionality
* of Spring Framework's Cache Abstraction using GemFire as a caching provider applied with Spring Data GemFire.
@@ -157,5 +158,4 @@ public class CachingWithGemFireIntegrationTest {
return localCacheMiss;
}
}
}

View File

@@ -10,7 +10,7 @@
* 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.support;
package org.springframework.data.gemfire.cache;
import static org.junit.Assert.assertNotNull;
@@ -25,10 +25,10 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
* @author John Blum
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/org/springframework/data/gemfire/support/cache-manager-client-cache.xml")
@ContextConfiguration("/org/springframework/data/gemfire/cache/cache-manager-client-cache.xml")
public class ClientCacheManagerTest {
@Autowired
@Autowired
GemfireCacheManager cacheManager;
@Test

View File

@@ -15,7 +15,7 @@
*
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.cache;
import static org.assertj.core.api.Assertions.assertThat;
@@ -68,8 +68,8 @@ import lombok.RequiredArgsConstructor;
* @see org.springframework.cache.annotation.EnableCaching
* @see org.springframework.test.context.ContextConfiguration
* @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner
* @see org.springframework.data.gemfire.support.GemfireCache#evict(Object)
* @see org.springframework.data.gemfire.support.GemfireCache#put(Object, Object)
* @see GemfireCache#evict(Object)
* @see GemfireCache#put(Object, Object)
* @see <a href="http://stackoverflow.com/questions/39830488/gemfire-entrynotfoundexception-for-cacheevict">Gemfire EntryNotFoundException on @CacheEvict</a>
* @see <a href="https://jira.spring.io/browse/SGF-539">Change GemfireCache.evict(key) to call Region.remove(key)</a>
* @since 1.9.0

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.cache;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;
@@ -34,6 +34,7 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.cache.Cache;
import org.springframework.data.gemfire.GemfireUtils;
import org.springframework.data.gemfire.support.AbstractNativeCacheTests;
/**
* Integration Tests for {@link GemfireCache}.

View File

@@ -15,7 +15,7 @@
*
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.cache;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.equalTo;

View File

@@ -15,7 +15,7 @@
*
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.cache;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.equalTo;
@@ -50,7 +50,7 @@ import org.springframework.cache.Cache;
* @see org.junit.Test
* @see org.mockito.Mock
* @see org.mockito.runners.MockitoJUnitRunner
* @see org.springframework.data.gemfire.support.GemfireCache
* @see GemfireCache
* @see com.gemstone.gemfire.cache.Region
* @since 1.9.0
*/

View File

@@ -26,6 +26,12 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import com.gemstone.gemfire.cache.GemFireCache;
import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.cache.query.Index;
import com.gemstone.gemfire.cache.query.IndexType;
import com.gemstone.gemfire.cache.query.QueryService;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -40,12 +46,6 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Assert;
import com.gemstone.gemfire.cache.GemFireCache;
import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.cache.query.Index;
import com.gemstone.gemfire.cache.query.IndexType;
import com.gemstone.gemfire.cache.query.QueryService;
/**
* The ClientCacheIndexingTest class is a test suite of test cases testing the creation and application of indexes
* on client Regions of a GemFire ClientCache using the &lt;gfe:index/&gt; tag element in the Spring Data GemFire

View File

@@ -23,6 +23,11 @@ import static org.junit.Assert.assertThat;
import javax.annotation.Resource;
import com.gemstone.gemfire.cache.CacheLoader;
import com.gemstone.gemfire.cache.CacheLoaderException;
import com.gemstone.gemfire.cache.LoaderHelper;
import com.gemstone.gemfire.cache.Region;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -33,11 +38,6 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Assert;
import com.gemstone.gemfire.cache.CacheLoader;
import com.gemstone.gemfire.cache.CacheLoaderException;
import com.gemstone.gemfire.cache.LoaderHelper;
import com.gemstone.gemfire.cache.Region;
/**
* The ClientCachePoolTests class...
*

View File

@@ -25,8 +25,14 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import com.gemstone.gemfire.cache.CacheLoader;
import com.gemstone.gemfire.cache.CacheLoaderException;
import com.gemstone.gemfire.cache.LoaderHelper;
import com.gemstone.gemfire.cache.Region;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -40,11 +46,6 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Assert;
import com.gemstone.gemfire.cache.CacheLoader;
import com.gemstone.gemfire.cache.CacheLoaderException;
import com.gemstone.gemfire.cache.LoaderHelper;
import com.gemstone.gemfire.cache.Region;
/**
* The ClientCacheSecurityTest class is a test suite with test cases testing SSL configuration between a GemFire client
* and server using the cluster-ssl-* GemFire System properties.

View File

@@ -21,6 +21,9 @@ import static org.junit.Assert.assertThat;
import javax.annotation.Resource;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.Region;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.context.ConfigurableApplicationContext;
@@ -29,9 +32,6 @@ import org.springframework.data.gemfire.test.GemfireTestApplicationContextInitia
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.Region;
/**
* @author David Turanski
* @author John Blum

View File

@@ -26,8 +26,14 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.Resource;
import com.gemstone.gemfire.cache.CacheLoader;
import com.gemstone.gemfire.cache.CacheLoaderException;
import com.gemstone.gemfire.cache.LoaderHelper;
import com.gemstone.gemfire.cache.Region;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -41,11 +47,6 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Assert;
import com.gemstone.gemfire.cache.CacheLoader;
import com.gemstone.gemfire.cache.CacheLoaderException;
import com.gemstone.gemfire.cache.LoaderHelper;
import com.gemstone.gemfire.cache.Region;
/**
* The ClientCacheVariableLocatorsTest class is a test suite of test cases testing the use of variable "locators"
* attribute on &lt;gfe:pool/&lt; in Spring (Data GemFire) configuration meta-data when connecting a client/server.

View File

@@ -26,8 +26,14 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.Resource;
import com.gemstone.gemfire.cache.CacheLoader;
import com.gemstone.gemfire.cache.CacheLoaderException;
import com.gemstone.gemfire.cache.LoaderHelper;
import com.gemstone.gemfire.cache.Region;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -41,11 +47,6 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Assert;
import com.gemstone.gemfire.cache.CacheLoader;
import com.gemstone.gemfire.cache.CacheLoaderException;
import com.gemstone.gemfire.cache.LoaderHelper;
import com.gemstone.gemfire.cache.Region;
/**
* The ClientCacheVariableServersTest class is a test suite of test cases testing the use of variable "servers"
* attribute on &lt;gfe:pool/&lt; in Spring (Data GemFire) configuration meta-data when connecting a client/server.

View File

@@ -37,14 +37,6 @@ import static org.mockito.Mockito.when;
import java.io.InputStream;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.core.io.Resource;
import org.springframework.data.gemfire.TestUtils;
import org.springframework.data.gemfire.config.xml.GemfireConstants;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.EvictionAttributes;
import com.gemstone.gemfire.cache.ExpirationAttributes;
@@ -57,6 +49,14 @@ import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
import com.gemstone.gemfire.cache.client.Pool;
import com.gemstone.gemfire.compression.Compressor;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.core.io.Resource;
import org.springframework.data.gemfire.TestUtils;
import org.springframework.data.gemfire.config.xml.GemfireConstants;
/**
* @author David Turanski
* @author John Blum

View File

@@ -14,21 +14,21 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.client;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
import org.junit.Test;
/**
* The ClientRegionShortcutConverterTest class is a test suite of test cases testing the contract and functionality
* The ClientRegionShortcutConverterTest class is a test suite of test cases testing the contract and functionality
* of the ClientRegionShortcutConverter class
*
* @author John Blum
* @see org.junit.Test
* @see org.springframework.data.gemfire.ClientRegionShortcutConverter
* @see ClientRegionShortcutConverter
* @see com.gemstone.gemfire.cache.client.ClientRegionShortcut
* @since 1.3.4
*/

View File

@@ -14,24 +14,24 @@
* limitations under the License.
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.client;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
import org.junit.Test;
/**
* The ClientRegionShortcutWrapperTest class is a test suite of test cases testing the contract and functionality of the
* ClientRegionShortcutWrapper enum class type.
*
* @author John Blum
* @see org.junit.Test
* @see org.springframework.data.gemfire.support.ClientRegionShortcutWrapper
* @see ClientRegionShortcutWrapper
* @see com.gemstone.gemfire.cache.client.ClientRegionShortcut
* @since 1.4.0
*/
@@ -148,5 +148,4 @@ public class ClientRegionShortcutWrapperTest {
assertTrue(ClientRegionShortcutWrapper.PROXY.isProxy());
assertFalse(ClientRegionShortcutWrapper.UNSPECIFIED.isProxy());
}
}

View File

@@ -22,14 +22,8 @@ import static org.junit.Assert.assertNotNull;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import javax.annotation.Resource;
import com.gemstone.gemfire.cache.CacheLoader;
import com.gemstone.gemfire.cache.CacheLoaderException;
@@ -39,6 +33,13 @@ import com.gemstone.gemfire.cache.LoaderHelper;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* The ClientRegionWithCacheLoaderWriterTest class is a test suite of test cases testing the addition of CacheLoaders
* and CacheWriters to a client, local Region inside a GemFire Cache.

View File

@@ -22,6 +22,9 @@ import static org.junit.Assert.assertSame;
import javax.annotation.Resource;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.ClientCache;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,9 +35,6 @@ import org.springframework.data.gemfire.fork.SpringCacheServerProcess;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.ClientCache;
/**
* The ClientSubRegionTest class is a test suite of test cases testing SubRegion functionality from a client
* GemFire Cache.

View File

@@ -32,8 +32,18 @@ import java.util.Map;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.Resource;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.EntryEvent;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.cache.client.ClientCacheFactory;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
import com.gemstone.gemfire.cache.client.Pool;
import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -55,15 +65,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Assert;
import org.springframework.util.SocketUtils;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.EntryEvent;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.cache.client.ClientCacheFactory;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
import com.gemstone.gemfire.cache.client.Pool;
import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
/**
* The DurableClientCacheIntegrationTest class is a test suite of test cases testing GemFire's Durable Client
* functionality in the context of Spring Data GemFire.

View File

@@ -28,8 +28,12 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.ClientCache;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -45,9 +49,6 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Assert;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.ClientCache;
/**
* The GemFireDataSourceIntegrationTest class is a test suite of test cases testing the contract and functionality
* of the &lt;gfe-data:datasource&gt; element in the context of a GemFire cluster running both native,

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2002-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.
@@ -18,6 +18,11 @@ import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import java.util.List;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.Pool;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -31,11 +36,6 @@ import org.springframework.data.gemfire.repository.sample.PersonRepository;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.Pool;
/**
* @author David Turanski
*

View File

@@ -29,8 +29,13 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.distributed.ServerLauncher;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -49,10 +54,6 @@ import org.springframework.util.Assert;
import org.springframework.util.FileCopyUtils;
import org.springframework.util.StringUtils;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.distributed.ServerLauncher;
/**
* The GemFireDataSourceUsingNonSpringConfiguredGemFireServerIntegrationTest class is a test suite of test cases
* testing the contract and functionality of the GemfireDataSourcePostProcessor using the &lt;gfe-data:datasource&gt;

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2002-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.
@@ -14,6 +14,9 @@ package org.springframework.data.gemfire.client;
import static org.junit.Assert.assertEquals;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.Region;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -25,9 +28,6 @@ import org.springframework.data.gemfire.fork.SpringCacheServerProcess;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.Region;
/**
* @author David Turanski
*
@@ -35,26 +35,26 @@ import com.gemstone.gemfire.cache.Region;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/org/springframework/data/gemfire/client/datasource-client-with-regions.xml")
public class GemFireDataSourceWithLocalRegionTest {
@Autowired
@Autowired
ApplicationContext ctx;
@BeforeClass
public static void startUp() throws Exception {
ForkUtil.startCacheServer(SpringCacheServerProcess.class.getName() + " "
ForkUtil.startCacheServer(SpringCacheServerProcess.class.getName() + " "
+ "/org/springframework/data/gemfire/client/datasource-server.xml");
}
@Test
public void testRegionDefinitionNotOverridden() {
Region<?,?> simple = ctx.getBean("simple",Region.class);
assertEquals(DataPolicy.NORMAL,
simple.getAttributes().getDataPolicy());
}
@AfterClass
public static void cleanUp() {
ForkUtil.sendSignal();

View File

@@ -42,14 +42,6 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.data.gemfire.support.ListRegionsOnServerFunction;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionAttributes;
@@ -61,6 +53,14 @@ import com.gemstone.gemfire.cache.execute.Function;
import com.gemstone.gemfire.management.internal.cli.domain.RegionInformation;
import com.gemstone.gemfire.management.internal.cli.functions.GetRegionsFunction;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.data.gemfire.support.ListRegionsOnServerFunction;
/**
* The GemfireDataSourcePostProcessor class is a test suite of test cases testing the contract and functionality
* of the GemfireDataSourcePostProcessor class, which is responsible for creating client PROXY Regions

View File

@@ -21,10 +21,10 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import org.junit.Test;
import com.gemstone.gemfire.cache.InterestResultPolicy;
import org.junit.Test;
/**
* The InterestResultPolicyTypeTest class is a test suite of test cases testing the contract and functionality
* of the InterestResultPolicyType enum.

View File

@@ -21,11 +21,11 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import com.gemstone.gemfire.cache.InterestResultPolicy;
import org.junit.Test;
import org.springframework.core.ConstantException;
import com.gemstone.gemfire.cache.InterestResultPolicy;
/**
* The InterestTest class is a test suite of test cases testing the contract and functionality of the Interest class.
*

View File

@@ -24,8 +24,15 @@ import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
import java.util.Properties;
import javax.annotation.Resource;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.GemFireCache;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -38,12 +45,6 @@ import org.springframework.data.gemfire.RegionAttributesFactoryBean;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.GemFireCache;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
/**
* The LocalOnlyClientCacheIntegrationTest class...
*

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2002-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.
@@ -16,13 +16,13 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.Region;
import org.junit.Test;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.Region;
/**
* @author David Turanski
* @author John Blum

View File

@@ -21,16 +21,6 @@ import static org.junit.Assert.assertSame;
import java.util.Arrays;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.gemstone.gemfire.cache.CacheListener;
import com.gemstone.gemfire.cache.CacheLoader;
import com.gemstone.gemfire.cache.CacheLoaderException;
@@ -41,6 +31,16 @@ import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* @author Costin Leau
* @author David Turanski
@@ -71,7 +71,7 @@ public class RegionIntegrationTest {
@Autowired
private ApplicationContext ctx;
@Test
public void testBasicRegion() throws Exception {
@SuppressWarnings("rawtypes")
@@ -123,4 +123,4 @@ public class RegionIntegrationTest {
assertEquals(512, pa.getLocalMaxMemory());
assertEquals(1, pa.getRedundantCopies());
}
}
}

View File

@@ -22,6 +22,7 @@ import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;
import java.util.Properties;
import javax.annotation.Resource;
import org.junit.Test;

View File

@@ -33,6 +33,9 @@ import java.net.InetSocketAddress;
import java.util.Collections;
import java.util.List;
import com.gemstone.gemfire.cache.client.Pool;
import com.gemstone.gemfire.cache.query.QueryService;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -42,9 +45,6 @@ import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.data.gemfire.GemfireUtils;
import com.gemstone.gemfire.cache.client.Pool;
import com.gemstone.gemfire.cache.query.QueryService;
/**
* The DefaultableDelegatingPoolAdapterTest class is a default suite of default cases testing the contract and functionality
* of the {@link DefaultableDelegatingPoolAdapter} class.

View File

@@ -32,6 +32,10 @@ import static org.mockito.Mockito.when;
import java.net.InetSocketAddress;
import java.util.Collections;
import com.gemstone.gemfire.cache.client.Pool;
import com.gemstone.gemfire.cache.client.PoolFactory;
import com.gemstone.gemfire.cache.query.QueryService;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -41,10 +45,6 @@ import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.data.gemfire.GemfireUtils;
import com.gemstone.gemfire.cache.client.Pool;
import com.gemstone.gemfire.cache.client.PoolFactory;
import com.gemstone.gemfire.cache.query.QueryService;
/**
* The DelegatingPoolAdapterTest class is a test suite of test cases testing the contract and functionality
* of the {@link DelegatingPoolAdapter} class.

View File

@@ -25,13 +25,13 @@ import static org.junit.Assert.assertThat;
import java.net.InetSocketAddress;
import java.util.Collections;
import com.gemstone.gemfire.cache.client.PoolFactory;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.data.gemfire.GemfireUtils;
import com.gemstone.gemfire.cache.client.PoolFactory;
/**
* The FactoryDefaultsPoolAdapterTest class is a test suite of test cases testing the contract and functionality
* of the {@link FactoryDefaultsPoolAdapter} class.

View File

@@ -32,10 +32,10 @@ import com.gemstone.gemfire.cache.util.Gateway;
import org.junit.Test;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.data.gemfire.EvictionActionConverter;
import org.springframework.data.gemfire.EvictionPolicyConverter;
import org.springframework.data.gemfire.EvictionPolicyType;
import org.springframework.data.gemfire.ExpirationActionConverter;
import org.springframework.data.gemfire.eviction.EvictionActionConverter;
import org.springframework.data.gemfire.eviction.EvictionPolicyConverter;
import org.springframework.data.gemfire.eviction.EvictionPolicyType;
import org.springframework.data.gemfire.expiration.ExpirationActionConverter;
import org.springframework.data.gemfire.IndexMaintenancePolicyConverter;
import org.springframework.data.gemfire.IndexMaintenancePolicyType;
import org.springframework.data.gemfire.IndexType;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.eviction;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;
@@ -32,7 +32,7 @@ import org.junit.rules.ExpectedException;
*
* @author John Blum
* @see org.junit.Test
* @see org.springframework.data.gemfire.EvictionActionConverter
* @see EvictionActionConverter
* @see com.gemstone.gemfire.cache.EvictionAction
* @since 1.6.0
*/

View File

@@ -14,23 +14,23 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.eviction;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import org.junit.Test;
import com.gemstone.gemfire.cache.EvictionAction;
import org.junit.Test;
/**
* The EvictionActionTypeTest class is a test suite of test cases testing the contract and functionality
* of the EvictionActionType enum.
*
* @author John Blum
* @see org.junit.Test
* @see org.springframework.data.gemfire.EvictionActionType
* @see EvictionActionType
* @see com.gemstone.gemfire.cache.EvictionAction
* @since 1.6.0
*/

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.eviction;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -23,22 +23,22 @@ import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.gemstone.gemfire.cache.EvictionAction;
import com.gemstone.gemfire.cache.EvictionAlgorithm;
import com.gemstone.gemfire.cache.EvictionAttributes;
import com.gemstone.gemfire.cache.util.ObjectSizer;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/**
* The EvictionAttributesFactoryBeanTest class is a test suite of test cases testing the contract and functionality
* of the EvictionAttributesFactoryBean class used to create Region Eviction configuration settings.
*
* @author John Blum
* @see org.junit.Test
* @see org.springframework.data.gemfire.EvictionAttributesFactoryBean
* @see EvictionAttributesFactoryBean
* @see com.gemstone.gemfire.cache.EvictionAttributes
* @since 1.3.4
*/

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.eviction;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;
@@ -30,8 +30,8 @@ import org.junit.rules.ExpectedException;
*
* @author John Blum
* @see org.junit.Test
* @see org.springframework.data.gemfire.EvictionPolicyConverter
* @see org.springframework.data.gemfire.EvictionPolicyType
* @see EvictionPolicyConverter
* @see EvictionPolicyType
* @since 1.6.0
*/
public class EvictionPolicyConverterUnitTests {

View File

@@ -14,15 +14,15 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.eviction;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import org.junit.Test;
import com.gemstone.gemfire.cache.EvictionAlgorithm;
import org.junit.Test;
/**
* The EvictionTypeTest class is a test suite of test cases testing the contract and functionality
* of the EvictionType enum.

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.expiration;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.instanceOf;
@@ -29,6 +29,11 @@ import static org.mockito.Mockito.when;
import javax.annotation.Resource;
import com.gemstone.gemfire.cache.CustomExpiry;
import com.gemstone.gemfire.cache.ExpirationAction;
import com.gemstone.gemfire.cache.ExpirationAttributes;
import com.gemstone.gemfire.cache.Region;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -41,11 +46,6 @@ import org.springframework.expression.EvaluationException;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.gemstone.gemfire.cache.CustomExpiry;
import com.gemstone.gemfire.cache.ExpirationAction;
import com.gemstone.gemfire.cache.ExpirationAttributes;
import com.gemstone.gemfire.cache.Region;
/**
* The AnnotationBasedExpirationConfigurationIntegrationTest class is a test suite of test cases testing
* the configuration of Annotation-defined expiration policies on Region Entry TTL and TTI
@@ -55,7 +55,7 @@ import com.gemstone.gemfire.cache.Region;
* @see org.junit.Test
* @see org.junit.runner.RunWith
* @see org.mockito.Mockito
* @see org.springframework.data.gemfire.support.AnnotationBasedExpiration
* @see AnnotationBasedExpiration
* @see org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer
* @see org.springframework.test.context.ContextConfiguration
* @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner
@@ -237,5 +237,4 @@ public class AnnotationBasedExpirationConfigurationIntegrationTest {
action = "@expirationProperties['gemfire.region.entry.expiration.action.spring.type']")
protected static class RegionEntryWithInvalidExpirationTimeout {
}
}

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.expiration;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.instanceOf;
@@ -31,7 +31,11 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.springframework.data.gemfire.support.AnnotationBasedExpiration.ExpirationMetaData;
import static org.springframework.data.gemfire.expiration.AnnotationBasedExpiration.ExpirationMetaData;
import com.gemstone.gemfire.cache.ExpirationAction;
import com.gemstone.gemfire.cache.ExpirationAttributes;
import com.gemstone.gemfire.cache.Region;
import org.junit.Test;
import org.mockito.Matchers;
@@ -40,7 +44,6 @@ import org.mockito.stubbing.Answer;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.expression.BeanFactoryResolver;
import org.springframework.core.convert.ConversionService;
import org.springframework.data.gemfire.ExpirationActionType;
import org.springframework.data.gemfire.TestUtils;
import org.springframework.expression.BeanResolver;
import org.springframework.expression.PropertyAccessor;
@@ -48,10 +51,6 @@ import org.springframework.expression.TypeConverter;
import org.springframework.expression.TypeLocator;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import com.gemstone.gemfire.cache.ExpirationAction;
import com.gemstone.gemfire.cache.ExpirationAttributes;
import com.gemstone.gemfire.cache.Region;
/**
* The AnnotationBasedExpirationTest class is a test suite of test cases testing the contract and functionality
* of the AnnotationBasedExpirationTest.
@@ -59,7 +58,7 @@ import com.gemstone.gemfire.cache.Region;
* @author John Blum
* @see org.junit.Test
* @see org.mockito.Mockito
* @see org.springframework.data.gemfire.support.AnnotationBasedExpiration
* @see AnnotationBasedExpiration
* @since 1.7.0
*/
@SuppressWarnings({ "rawtypes", "unchecked", "unused" })

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.expiration;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;
@@ -32,7 +32,7 @@ import org.junit.rules.ExpectedException;
*
* @author John Blum
* @see org.junit.Test
* @see org.springframework.data.gemfire.ExpirationActionConverter
* @see ExpirationActionConverter
* @since 1.6.0
*/
public class ExpirationActionConverterUnitTests {

View File

@@ -14,24 +14,24 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.expiration;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import org.junit.Test;
import com.gemstone.gemfire.cache.ExpirationAction;
import org.junit.Test;
/**
* The ExpirationActionTypeTest class is a test suite of test cases testing the contract and functionality
* of the ExpirationActionType enum.
*
* @author John Blum
* @see org.junit.Test
* @see org.springframework.data.gemfire.ExpirationActionType
* @see ExpirationActionType
* @see com.gemstone.gemfire.cache.ExpirationAction
* @since 1.6.0
*/

View File

@@ -14,25 +14,25 @@
* limitations under the License.
*/
package org.springframework.data.gemfire;
package org.springframework.data.gemfire.expiration;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.gemstone.gemfire.cache.ExpirationAction;
import com.gemstone.gemfire.cache.ExpirationAttributes;
import org.junit.Test;
/**
* The ExpirationAttributesFactoryBeanTest class is a test suite of test cases testing the contract and functionality
* of the ExpirationAttributesFactoryBean class.
*
* @author John Blum
* @see org.junit.Test
* @see org.springframework.data.gemfire.ExpirationAttributesFactoryBean
* @see ExpirationAttributesFactoryBean
* @since 1.6.0
*/
public class ExpirationAttributesFactoryBeanTest {

View File

@@ -32,6 +32,11 @@ import org.junit.Test;
*/
public class ArrayUtilsUnitTests {
@SafeVarargs
protected static <T> T[] asArray(T... array) {
return array;
}
@Test
public void asArrayRetursEmptyArray() {
Object[] array = ArrayUtils.asArray();
@@ -60,13 +65,12 @@ public class ArrayUtilsUnitTests {
@Test
public void getFirstWithNonNullArray() {
assertThat(ArrayUtils.getFirst(1, 2, 3)).isEqualTo(1);
assertThat(ArrayUtils.getFirst(asArray(1, 2, 3))).isEqualTo(1);
}
@Test
public void getFirstWithNullOrEmptyArrayAndNoDefaultReturnsNull() {
assertThat(ArrayUtils.getFirst((Object[]) null)).isNull();
assertThat(ArrayUtils.<Object>getFirst()).isNull();
assertThat((Object) ArrayUtils.getFirst(null)).isNull();
}
@Test

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
" default-lazy-init="true">
<util:properties id="gemfireProperties">
<prop key="name">BasicSubRegionConfig</prop>
<prop key="mcast-port">0</prop>
<prop key="log-level">warning</prop>
</util:properties>
<gfe:cache properties-ref="gemfireProperties" use-bean-factory-locator="false"/>
<gfe:replicated-region id="parent"/>
<bean name="/parent/child" class="org.springframework.data.gemfire.SubRegionFactoryBean">
<property name="parent" ref="parent"/>
<property name="regionName" value="child"/>
</bean>
</beans>

View File

@@ -26,7 +26,7 @@
<cache:annotation-driven/>
<bean id="cacheManager" class="org.springframework.data.gemfire.support.GemfireCacheManager" p:cache-ref="gemfireCache"/>
<bean id="cacheManager" class="org.springframework.data.gemfire.cache.GemfireCacheManager" p:cache-ref="gemfireCache"/>
<context:annotation-config/>
@@ -44,11 +44,11 @@
<entry key="nine" value="9"/>
</util:map>
<bean id="namedNumbersRepo" class="org.springframework.data.gemfire.support.CachingWithGemFireIntegrationTest$NamedNumbersInMemoryRepository">
<bean id="namedNumbersRepo" class="org.springframework.data.gemfire.cache.CachingWithGemFireIntegrationTest$NamedNumbersInMemoryRepository">
<property name="namedNumbers" ref="NamedNumbersMap"/>
</bean>
<bean id="namedNumbersService" class="org.springframework.data.gemfire.support.CachingWithGemFireIntegrationTest$NamedNumbersService">
<bean id="namedNumbersService" class="org.springframework.data.gemfire.cache.CachingWithGemFireIntegrationTest$NamedNumbersService">
<property name="namedNumbersRepo" ref="namedNumbersRepo"/>
</bean>

View File

@@ -17,7 +17,7 @@
<gfe:client-region id="Example"/>
<bean class="org.springframework.data.gemfire.support.GemfireCacheManager">
<bean class="org.springframework.data.gemfire.cache.GemfireCacheManager">
<property name="cache" ref="gemfireCache"/>
</bean>

View File

@@ -15,7 +15,7 @@
<prop key="gemfire.region.entry.expiration.timeout">60</prop>
<prop key="gemfire.region.entry.expiration.action.string">LOCAL_INVALIDATE</prop>
<prop key="gemfire.region.entry.expiration.action.gemfire.type">#{T(com.gemstone.gemfire.cache.ExpirationAction).INVALIDATE}</prop>
<prop key="gemfire.region.entry.expiration.action.spring.type">#{T(org.springframework.data.gemfire.ExpirationActionType).DESTROY}</prop>
<prop key="gemfire.region.entry.expiration.action.spring.type">#{T(org.springframework.data.gemfire.expiration.ExpirationActionType).DESTROY}</prop>
</util:properties>
<context:property-placeholder properties-ref="expirationProperties"/>
@@ -33,12 +33,12 @@
<constructor-arg value="#{T(com.gemstone.gemfire.cache.ExpirationAction).DESTROY}"/>
</bean>
<bean id="genericExpiration" class="org.springframework.data.gemfire.support.AnnotationBasedExpiration"/>
<bean id="genericExpiration" class="org.springframework.data.gemfire.expiration.AnnotationBasedExpiration"/>
<bean id="ttiExpiration" class="org.springframework.data.gemfire.support.AnnotationBasedExpiration"
<bean id="ttiExpiration" class="org.springframework.data.gemfire.expiration.AnnotationBasedExpiration"
factory-method="forIdleTimeout"/>
<bean id="ttlExpiration" class="org.springframework.data.gemfire.support.AnnotationBasedExpiration"
<bean id="ttlExpiration" class="org.springframework.data.gemfire.expiration.AnnotationBasedExpiration"
factory-method="forTimeToLive">
<constructor-arg ref="defaultExpirationAttributes"/>
</bean>