diff --git a/samples/hello-world/src/main/java/org/springframework/data/gemfire/samples/helloworld/Main.java b/samples/hello-world/src/main/java/org/springframework/data/gemfire/samples/helloworld/Main.java index 0e8a5edb..d16b92e3 100644 --- a/samples/hello-world/src/main/java/org/springframework/data/gemfire/samples/helloworld/Main.java +++ b/samples/hello-world/src/main/java/org/springframework/data/gemfire/samples/helloworld/Main.java @@ -20,9 +20,8 @@ import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; /** - * Hello World startup class. - * Bootstraps the Spring container which in turns starts GemFire and the actual application. - *

+ * Hello World startup class. Bootstraps the Spring container which in turns starts GemFire and the actual application. + * * Accepts as optional parameters location of one (or multiple) application contexts that will * be used for configuring the Spring container. See the reference documentation for more * {@link http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/resources.html information}. diff --git a/src/main/java/org/springframework/data/gemfire/ClientRegionShortcutConverter.java b/src/main/java/org/springframework/data/gemfire/ClientRegionShortcutConverter.java index 6dfe4ad8..c120a988 100644 --- a/src/main/java/org/springframework/data/gemfire/ClientRegionShortcutConverter.java +++ b/src/main/java/org/springframework/data/gemfire/ClientRegionShortcutConverter.java @@ -23,7 +23,7 @@ import com.gemstone.gemfire.cache.client.ClientRegionShortcut; /** * The ClientRegionShortcutConverter class is a Spring Converter implementation converting String value Client Region * Shortcut representations into actual GemFire ClientRegionShortcut enumerated values. - *

+ * * @author John Blum * @see org.springframework.core.convert.converter.Converter * @see com.gemstone.gemfire.cache.client.ClientRegionShortcut @@ -35,7 +35,7 @@ public class ClientRegionShortcutConverter implements Converter + * * @param value the String to convert to a trimmed, upper case value. * @return a trimmed, upper case value of the specified String, or "null" if the String value reference is null. * @see java.lang.String#toUpperCase() @@ -49,7 +49,7 @@ public class ClientRegionShortcutConverter implements Converter + * * @param source the String representation of the Client Region Shortcut to convert. * @return a ClientRegionShortcut enumerated value for the String representation. * @throws IllegalArgumentException if the String source is not a valid ClientRegionShortcut enumerated value. diff --git a/src/main/java/org/springframework/data/gemfire/DiskStoreFactoryBean.java b/src/main/java/org/springframework/data/gemfire/DiskStoreFactoryBean.java index bed3e564..6a32a95b 100644 --- a/src/main/java/org/springframework/data/gemfire/DiskStoreFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/DiskStoreFactoryBean.java @@ -32,7 +32,7 @@ import com.gemstone.gemfire.cache.GemFireCache; /** * FactoryBean for creating a GemFire DiskStore. - *

+ * * @author David Turanski * @author John Blum * @see org.springframework.beans.factory.BeanNameAware @@ -42,8 +42,6 @@ import com.gemstone.gemfire.cache.GemFireCache; @SuppressWarnings("unused") public class DiskStoreFactoryBean implements FactoryBean, InitializingBean, BeanNameAware { - private DiskStoreFactory diskStoreFactory; - private Boolean allowForceCompaction; private Boolean autoCompact; @@ -81,7 +79,7 @@ public class DiskStoreFactoryBean implements FactoryBean, Initializin Assert.state(cache != null, String.format("A reference to the GemFire Cache must be set for Disk Store '%1$s'.", getName())); - diskStoreFactory = cache.createDiskStoreFactory(); + DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory(); if (allowForceCompaction != null) { diskStoreFactory.setAllowForceCompaction(allowForceCompaction); diff --git a/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java b/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java index 565a40a8..5a96fa7a 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java @@ -27,7 +27,7 @@ import com.gemstone.gemfire.cache.Region; /** * Base class for GemfireTemplate and GemfireInterceptor, defining common properties such as {@link Region}. - *

+ * * Not intended to be used directly. * * @author Costin Leau @@ -73,7 +73,6 @@ public class GemfireAccessor implements InitializingBean { * is called only for GemFire querying exception that do NOT extend from GemFire exception. * May be overridden in subclasses. * - * @see com.gemstone.gemfire.cache.query.CqInvalidException * @param ex GemFireException that occurred * @return the corresponding DataAccessException instance */ @@ -98,4 +97,4 @@ public class GemfireAccessor implements InitializingBean { public void setRegion(Region region) { this.region = region; } -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java b/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java index b558afe0..9205a9df 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java @@ -43,7 +43,7 @@ import org.springframework.util.StringUtils; * and aliases of the bean (so the same "registry" can be used for storing multiple BeanFactories). * If there is only one BeanFactory registered then a null value can be used with {@link #setBeanName(String)}. * - *

In most cases, one does not need to use this class directly as it is used internally + * In most cases, one does not need to use this class directly as it is used internally * by {@link com.gemstone.gemfire.cache.CacheFactory}. * * @author Costin Leau @@ -161,4 +161,4 @@ public class GemfireBeanFactoryLocator implements BeanFactoryLocator, BeanFactor public void setBeanFactory(BeanFactory beanFactory) throws BeansException { this.beanFactory = beanFactory; } -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/gemfire/GemfireCacheUtils.java b/src/main/java/org/springframework/data/gemfire/GemfireCacheUtils.java index 35ac0941..7dd143de 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireCacheUtils.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireCacheUtils.java @@ -43,9 +43,6 @@ import com.gemstone.gemfire.NoSystemException; import com.gemstone.gemfire.SystemConnectException; import com.gemstone.gemfire.SystemIsRunningException; import com.gemstone.gemfire.UnmodifiableException; -import com.gemstone.gemfire.admin.AdminException; -import com.gemstone.gemfire.admin.RegionNotFoundException; -import com.gemstone.gemfire.admin.RuntimeAdminException; import com.gemstone.gemfire.cache.CacheException; import com.gemstone.gemfire.cache.CacheExistsException; import com.gemstone.gemfire.cache.CacheLoaderException; @@ -58,7 +55,6 @@ import com.gemstone.gemfire.cache.DiskAccessException; import com.gemstone.gemfire.cache.EntryDestroyedException; import com.gemstone.gemfire.cache.EntryExistsException; import com.gemstone.gemfire.cache.EntryNotFoundException; -import com.gemstone.gemfire.cache.EntryNotFoundInRegion; import com.gemstone.gemfire.cache.FailedSynchronizationException; import com.gemstone.gemfire.cache.OperationAbortedException; import com.gemstone.gemfire.cache.PartitionedRegionDistributionException; @@ -90,18 +86,18 @@ public abstract class GemfireCacheUtils { private static Class CQ_EXCEPTION_CLASS; - { - Class clz = null; + static { + Class type = null; try { + type = ClassUtils.resolveClassName("com.gemstone.gemfire.cache.query.CqInvalidException", + GemfireCacheUtils.class.getClassLoader()); - clz = ClassUtils.resolveClassName("com.gemstone.gemfire.cache.query.CqInvalidException", - GemfireCacheUtils.class.getClassLoader()); - - } catch (IllegalArgumentException iae) { + } + catch (IllegalArgumentException ignore) { } - CQ_EXCEPTION_CLASS = clz; + CQ_EXCEPTION_CLASS = type; } @@ -112,6 +108,7 @@ public abstract class GemfireCacheUtils { * @param ex Gemfire unchecked exception * @return new the corresponding DataAccessException instance */ + @SuppressWarnings("deprecation") public static DataAccessException convertGemfireAccessException(GemFireException ex) { if (ex instanceof CacheException) { if (ex instanceof CacheExistsException) { @@ -179,7 +176,7 @@ public abstract class GemfireCacheUtils { if (ex instanceof RegionDestroyedException) { return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex); } - if (ex instanceof RegionNotFoundException) { + if (ex instanceof com.gemstone.gemfire.admin.RegionNotFoundException) { return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex); } if (ex instanceof ResourceException) { @@ -198,7 +195,7 @@ public abstract class GemfireCacheUtils { if (ex instanceof CopyException) { return new GemfireSystemException(ex); } - if (ex instanceof EntryNotFoundInRegion) { + if (ex instanceof com.gemstone.gemfire.cache.EntryNotFoundInRegion) { return new DataRetrievalFailureException(ex.getMessage(), ex); } if (ex instanceof FunctionException) { @@ -234,7 +231,7 @@ public abstract class GemfireCacheUtils { if (ex instanceof NoSystemException) { return new GemfireSystemException(ex); } - if (ex instanceof RuntimeAdminException) { + if (ex instanceof com.gemstone.gemfire.admin.RuntimeAdminException) { return new GemfireSystemException(ex); } if (ex instanceof ServerConnectivityException) { @@ -263,9 +260,6 @@ public abstract class GemfireCacheUtils { * Dedicated method for converting exceptions changed in 6.5 that had their * parent changed. This method exists to 'fool' the compiler type checks * by loosening the type so the code compiles on both 6.5 (pre and current) branches. - * - * @param ex - * @return */ static DataAccessException convertQueryExceptions(RuntimeException ex) { if (ex instanceof IndexInvalidException) { @@ -290,6 +284,7 @@ public abstract class GemfireCacheUtils { * @param ex Gemfire unchecked exception * @return new the corresponding DataAccessException instance */ + @SuppressWarnings("deprecation") public static DataAccessException convertGemfireAccessException(GemFireCheckedException ex) { // query exceptions if (ex instanceof QueryException) { @@ -304,7 +299,7 @@ public abstract class GemfireCacheUtils { return new DataAccessResourceFailureException(ex.getMessage(), ex); } // admin exception - if (ex instanceof AdminException) { + if (ex instanceof com.gemstone.gemfire.admin.AdminException) { return new GemfireSystemException(ex); } // fall back @@ -337,9 +332,6 @@ public abstract class GemfireCacheUtils { /** * Package protected method for detecting CqInvalidException which has been removed in GemFire 6.5 GA. - * - * @param ex - * @return */ static boolean isCqInvalidException(RuntimeException ex) { return (CQ_EXCEPTION_CLASS != null && CQ_EXCEPTION_CLASS.isAssignableFrom(ex.getClass())); @@ -356,4 +348,5 @@ public abstract class GemfireCacheUtils { static DataAccessException convertCqInvalidException(RuntimeException ex) { return new GemfireQueryException(ex); } -} \ No newline at end of file + +} diff --git a/src/main/java/org/springframework/data/gemfire/GemfireCallback.java b/src/main/java/org/springframework/data/gemfire/GemfireCallback.java index d0a78028..6e61ad94 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireCallback.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireCallback.java @@ -32,7 +32,7 @@ public interface GemfireCallback { /** * Gets called by {@link GemfireTemplate#execute(GemfireCallback)}. Does not need to care about handling transactions * or exceptions. - *

+ * * Allows for returning a result object created within the callback, i.e. a domain object or a collection of domain * objects. A thrown custom RuntimeException is treated as an application exception: It gets propagated to the caller * of the template. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireOperations.java b/src/main/java/org/springframework/data/gemfire/GemfireOperations.java index ffdea646..e41af2dd 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireOperations.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireOperations.java @@ -71,10 +71,10 @@ public interface GemfireOperations { /** * Executes a GemFire query with the given (optional) parameters and returns the result. Note this method expects the query to return multiple results; for queries that return only one * element use {@link #findUnique(String, Object...)}. - *

+ * * As oppose, to the {@link #query(String)} method, this method allows for more generic queries (against multiple regions even) to be executed. * - *

Note that the local query service is used if the region is configured as a client without any pool configuration or server connectivity - otherwise the query service on the default pool + * Note that the local query service is used if the region is configured as a client without any pool configuration or server connectivity - otherwise the query service on the default pool * is being used. * * @see QueryService#newQuery(String) @@ -90,10 +90,10 @@ public interface GemfireOperations { /** * Executes a GemFire query with the given (optional) parameters and returns the result. Note this method expects the query to return a single result; for queries that return multiple * elements use {@link #find(String, Object...)}. - *

+ * * As oppose, to the {@link #query(String)} method, this method allows for more generic queries (against multiple regions even) to be executed. * - *

Note that the local query service is used if the region is configured as a client without any pool configuration or server connectivity - otherwise the query service on the default pool + * Note that the local query service is used if the region is configured as a client without any pool configuration or server connectivity - otherwise the query service on the default pool * is being used. * * @see QueryService#newQuery(String) @@ -118,4 +118,4 @@ public interface GemfireOperations { */ public abstract T execute(GemfireCallback action, boolean exposeNativeRegion) throws DataAccessException; -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java b/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java index a9273579..ed0c8bda 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java @@ -45,7 +45,7 @@ import com.gemstone.gemfire.internal.cache.LocalRegion; * {@link GemFireException} into Spring {@link DataAccessException}, following the org.springframework.dao * exception hierarchy. * - *

+ * * The central method is execute, supporting GemFire access code implementing the GemfireCallback interface. * It provides dedicated handling such that neither the GemfireCallback implementation nor the calling code needs to * explicitly care about handling {@link Region} life-cycle exceptions. @@ -433,4 +433,4 @@ public class GemfireTemplate extends GemfireAccessor implements GemfireOperation } } } -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java b/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java index f7cda9ae..61ea5c76 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java @@ -226,7 +226,7 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage * objects (default) it manages. While copies imply additional work for * every fetch operation, direct references can cause dirty reads across * concurrent threads in the same VM, whether or not transactions are used. - *

+ * * One could explicitly deep copy objects before making changes (for example * by using {@link com.gemstone.gemfire.CopyHelper#copy(Object)} in which * case this setting can be set to false. However, unless there @@ -280,4 +280,4 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage rollbackOnly = true; } } -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/gemfire/GemfireUtils.java b/src/main/java/org/springframework/data/gemfire/GemfireUtils.java index b593b42b..01e2b2a0 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireUtils.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireUtils.java @@ -26,7 +26,7 @@ import com.gemstone.gemfire.cache.Region; /** * The GemfireUtils class is a utility class encapsulating common functionality to access features and capabilities * of GemFire based on version and other configuration meta-data. - *

+ * * @author John Blum * @since 1.3.3 */ diff --git a/src/main/java/org/springframework/data/gemfire/LazyWiringDeclarableSupport.java b/src/main/java/org/springframework/data/gemfire/LazyWiringDeclarableSupport.java index 50a72ed4..a124de13 100644 --- a/src/main/java/org/springframework/data/gemfire/LazyWiringDeclarableSupport.java +++ b/src/main/java/org/springframework/data/gemfire/LazyWiringDeclarableSupport.java @@ -37,8 +37,9 @@ import com.gemstone.gemfire.cache.Declarable; /** * The LazyWiringDeclarableSupport class is an implementation of the GemFire Declarable interface that enables support * for wiring GemFire components with Spring bean dependencies defined in the Spring context. - *

+ * * @author John Blum + * @see java.util.Properties * @see org.springframework.beans.factory.DisposableBean * @see org.springframework.context.ApplicationListener * @see org.springframework.context.event.ContextRefreshedEvent @@ -65,7 +66,7 @@ public abstract class LazyWiringDeclarableSupport implements ApplicationListener * SpringContextBootstrappingInitializer to receive notification when the Spring context is created and initialized * (refreshed) by GemFire in order for this Declarable component to be configured and properly initialized with any * required Spring bean dependencies. - *

+ * * @see org.springframework.data.gemfire.support.SpringContextBootstrappingInitializer * #register(org.springframework.context.ApplicationListener) */ @@ -78,7 +79,7 @@ public abstract class LazyWiringDeclarableSupport implements ApplicationListener * after GemFire has constructed this Declarable object during startup. It is recommended that this method * be called in any GemFire CacheCallback/Declarable object operational method (e.g. CacheLoader.load(..)) * before use in order to ensure that this Declarable was properly constructed, configured and initialized. - *

+ * * @throws IllegalStateException if the Declarable object has not been properly configured or initialized * by the Spring container. * @see #init(java.util.Properties) @@ -94,7 +95,7 @@ public abstract class LazyWiringDeclarableSupport implements ApplicationListener * Performs the actual configuration and initialization of this Declarable object before use. This method * is triggered by an ApplicationEvent (specifically, the ContextRefreshedEvent) indicating that the Spring context * has been created and refreshed. - *

+ * * @param beanFactory the ConfigurableListableBeanFactory used to configure and initialize this Declarable GemFire * component. * @param parameters Properties instance containing the parameters from GemFire's configuration file @@ -139,7 +140,7 @@ public abstract class LazyWiringDeclarableSupport implements ApplicationListener /** * Default no operation method performed post initialization of this Declarable GemFire component to be overridden * by subclasses for application specific extension and behavior. - *

+ * * @param parameters Properties instance containing the parameters from GemFire's configuration file * (e.g. cache.xml) to configure and initialize this Declarable object. * @see #doInit(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.util.Properties) @@ -150,7 +151,7 @@ public abstract class LazyWiringDeclarableSupport implements ApplicationListener /** * Initialization method called by GemFire with the configured parameters once this Declarable object has been * constructed during GemFire startup using an <initalizer> element in GemFire's configuration meta-data. - *

+ * * @param parameters the configured parameters passed from the GemFire configuration (e.g. cache.xml) to this * Declarable as a Properties instance. * @throws IllegalStateException if the Declarable object's init method has already been invoked. @@ -166,7 +167,7 @@ public abstract class LazyWiringDeclarableSupport implements ApplicationListener /** * Determines whether this Declarable object has been configured and initialized (i.e. the doInit method * has been called) by the Spring container. - *

+ * * @return a boolean value indicating whether this Declarable object has been configured and initialized by * the Spring container. * @see #assertInitialized() @@ -179,7 +180,7 @@ public abstract class LazyWiringDeclarableSupport implements ApplicationListener /** * Event handler method called when GemFire has created and initialized (refreshed) the Spring ApplicationContext * using the SpringContextBootstrappingInitializer Declarable class. - *

+ * * @param event the ContextRefreshedEvent published by the Spring ApplicationContext after it is successfully * created and initialized by GemFire. * @throws IllegalStateException if the parameters have not been passed to this Declarable (i.e. GemFire has not @@ -207,7 +208,7 @@ public abstract class LazyWiringDeclarableSupport implements ApplicationListener /** * When this bean gets destroyed by the Spring container, make sure this component gets unregistered from the * SpringContextBootstrappingInitializer. - *

+ * * @throws Exception if bean destruction is unsuccessful. * @see org.springframework.data.gemfire.support.SpringContextBootstrappingInitializer#unregister( * org.springframework.context.ApplicationListener) diff --git a/src/main/java/org/springframework/data/gemfire/LocalRegionFactoryBean.java b/src/main/java/org/springframework/data/gemfire/LocalRegionFactoryBean.java index 9e8dcca3..5675cac4 100644 --- a/src/main/java/org/springframework/data/gemfire/LocalRegionFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/LocalRegionFactoryBean.java @@ -65,7 +65,7 @@ public class LocalRegionFactoryBean extends RegionFactoryBean { * Resolves the Data Policy used by this "local" GemFire Region (i.e. locally Scoped; Scope.LOCAL) based on the * enumerated value from com.gemstone.gemfire.cache.RegionShortcuts (LOCAL, LOCAL_PERSISTENT, LOCAL_HEAP_LRU, * LOCAL_OVERFLOW, and LOCAL_PERSISTENT_OVERFLOW), but without consideration of the Eviction settings. - *

+ * * @param regionFactory the GemFire RegionFactory used to created the Local Region. * @param persistent a boolean value indicating whether the Local Region should persist it's data. * @param dataPolicy requested Data Policy as set by the user in the Spring GemFire configuration meta-data. diff --git a/src/main/java/org/springframework/data/gemfire/RegionAttributesFactoryBean.java b/src/main/java/org/springframework/data/gemfire/RegionAttributesFactoryBean.java index 74854abe..aee84841 100644 --- a/src/main/java/org/springframework/data/gemfire/RegionAttributesFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/RegionAttributesFactoryBean.java @@ -19,17 +19,22 @@ package org.springframework.data.gemfire; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; -import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.RegionAttributes; /** * Spring-friendly bean for creating {@link RegionAttributes}. Eliminates the need of using * a XML 'factory-method' tag. - *

+ * * @author Costin Leau + * @author John Blum + * @see org.springframework.beans.factory.FactoryBean + * @see org.springframework.beans.factory.InitializingBean + * @see com.gemstone.gemfire.cache.AttributesFactory + * @see com.gemstone.gemfire.cache.RegionAttributes */ -public class RegionAttributesFactoryBean extends AttributesFactory implements FactoryBean, - InitializingBean { +@SuppressWarnings("deprecation") +public class RegionAttributesFactoryBean extends com.gemstone.gemfire.cache.AttributesFactory + implements FactoryBean, InitializingBean { private RegionAttributes attributes; diff --git a/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java b/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java index 8a625552..a44650f0 100644 --- a/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java @@ -29,7 +29,6 @@ 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; import com.gemstone.gemfire.cache.CacheLoader; @@ -66,7 +65,6 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple protected final Log log = LogFactory.getLog(getClass()); - private boolean autoStartup = true; private boolean close = true; private boolean destroy = false; private boolean running; @@ -195,9 +193,9 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple } /** - * Validates that the settings for Data Policy and the 'persistent' attribute in elements + * Validates that the settings for Data Policy and the 'persistent' attribute in <gfe:*-region> elements * are compatible. - *

+ * * @param resolvedDataPolicy the GemFire Data Policy resolved form the Spring GemFire XML namespace configuration * meta-data. * @see #isPersistent() @@ -218,7 +216,7 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple /** * Determines whether the user explicitly set the 'persistent' attribute or not. - *

+ * * @return a boolean value indicating whether the user explicitly set the 'persistent' attribute to true or false. * @see #isPersistent() * @see #isNotPersistent() @@ -231,7 +229,7 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple * Returns true when the user explicitly specified a value for the persistent attribute and it is true. If the * persistent attribute was not explicitly specified, then the persistence setting is implicitly undefined * and will be determined by the Data Policy. - *

+ * * @return true when the user specified an explicit value for the persistent attribute and it is true; * false otherwise. * @see #isNotPersistent() @@ -245,7 +243,7 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple * Returns true when the user explicitly specified a value for the persistent attribute and it is false. If the * persistent attribute was not explicitly specified, then the persistence setting is implicitly undefined * and will be determined by the Data Policy. - *

+ * * @return true when the user specified an explicit value for the persistent attribute and it is false; * false otherwise. * @see #isPersistent() @@ -258,7 +256,7 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple /** * Creates an instance of RegionFactory using the given Cache instance used to configure and construct the Region * created by this FactoryBean. - *

+ * * @param cache the GemFire Cache instance. * @return a RegionFactory used to configure and construct the Region created by this FactoryBean. * @see com.gemstone.gemfire.cache.Cache#createRegionFactory() @@ -288,13 +286,13 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple * @see com.gemstone.gemfire.cache.RegionAttributes#getDataPolicy * @see com.gemstone.gemfire.cache.DataPolicy */ - @SuppressWarnings({ "deprecation", "unchecked"}) + @SuppressWarnings({ "deprecation", "unchecked" }) DataPolicy getDataPolicy(final RegionFactory regionFactory) { // NOTE cannot pass RegionAttributes.class as the "targetType" on the second invocation of getFieldValue(..) // since the "regionAttributes" field is naively of the implementation class type rather than the interface // type... so much for programming to interfaces. - return ((RegionAttributes) getFieldValue(getFieldValue(regionFactory, "attrsFactory", AttributesFactory.class), - "regionAttributes", null)).getDataPolicy(); + return ((RegionAttributes) getFieldValue(getFieldValue(regionFactory, "attrsFactory", + com.gemstone.gemfire.cache.AttributesFactory.class), "regionAttributes", null)).getDataPolicy(); } /* @@ -313,7 +311,7 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple * user specified a RegionShortcut. This method gets called by the createRegionFactory method depending upon * the value passed to the Cache.createRegionFactory() method (i.e. whether there was a RegionShortcut specified * or not). - *

+ * * @param the Class type fo the Region key. * @param the Class type of the Region value. * @param regionFactory the GemFire RegionFactory used to configure and create the Region that is the product @@ -415,14 +413,14 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple */ @SuppressWarnings("deprecation") void validateRegionAttributes(final RegionAttributes regionAttributes) { - AttributesFactory.validateAttributes(regionAttributes); + com.gemstone.gemfire.cache.AttributesFactory.validateAttributes(regionAttributes); } /** * Post-process the RegionFactory used to create the GemFire Region for this factory bean during the initialization * process. The RegionFactory is already configured and initialized by the factory bean before this method * is invoked. - *

+ * * @param regionFactory the GemFire RegionFactory used to create the Region for post-processing. * @see com.gemstone.gemfire.cache.RegionFactory */ @@ -432,7 +430,7 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple /** * Post-process the Region for this factory bean during the initialization process. The Region is * already configured and initialized by the factory bean before this method is invoked. - *

+ * * @param region the GemFire Region to post-process. * @see com.gemstone.gemfire.cache.Region */ @@ -442,7 +440,7 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple /** * Validates and sets the Data Policy on the RegionFactory used to create and configure the Region from this * FactoryBean. - *

+ * * @param regionFactory the RegionFactory used by this FactoryBean to create and configure the Region. * @param persistent a boolean value indicating whether the Region should be persistent and persist it's * data to disk. @@ -464,7 +462,7 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple /** * Validates the configured Data Policy and may override it, taking into account the 'persistent' attribute * and constraints for the Region type. - *

+ * * @param regionFactory the GemFire RegionFactory used to create the desired Region. * @param persistent a boolean value indicating whether the Region should persist it's data to disk. * @param dataPolicy requested Data Policy as set by the user in the Spring GemFire configuration meta-data. @@ -506,7 +504,7 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple /** * The list of AsyncEventQueues to use with this Region. - *

+ * * @param asyncEventQueues defined as Object for backwards compatibility with Gemfire 6. */ public void setAsyncEventQueues(Object[] asyncEventQueues) { @@ -575,7 +573,7 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple /** * Sets the DataPolicy of the Region. - *

+ * * @param dataPolicy the GemFire DataPolicy to use when configuring the Region. * @since 1.4.0 */ @@ -585,7 +583,7 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple /** * Sets the DataPolicy of the Region as a String. - *

+ * * @param dataPolicyName the name of the DataPolicy (e.g. REPLICATE, PARTITION) * @see #setDataPolicy(com.gemstone.gemfire.cache.DataPolicy) * @deprecated as of 1.4.0, use setDataPolicy(:DataPolicy) instead. @@ -596,7 +594,7 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple /** * Sets the name of Disk Store used for either overflow or persistence, or both. - *

+ * * @param diskStoreName the name of the Disk Store bean in context used for overflow/persistence. */ public void setDiskStoreName(String diskStoreName) { @@ -644,7 +642,7 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple /** * Configures the Region with a RegionShortcut. - *

+ * * @param shortcut the RegionShortcut used to configure pre-defined default for the Region created * by this FactoryBean. * @see com.gemstone.gemfire.cache.RegionShortcut @@ -725,7 +723,7 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple */ @Override public boolean isAutoStartup() { - return this.autoStartup; + return true; } /* diff --git a/src/main/java/org/springframework/data/gemfire/RegionLookupFactoryBean.java b/src/main/java/org/springframework/data/gemfire/RegionLookupFactoryBean.java index 4a4b5669..ac307000 100644 --- a/src/main/java/org/springframework/data/gemfire/RegionLookupFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/RegionLookupFactoryBean.java @@ -31,7 +31,7 @@ import com.gemstone.gemfire.cache.Region; /** * Simple FactoryBean for retrieving generic GemFire {@link Region}s. If the Region does not exist, * an exception is thrown. For declaring and configuring new regions, see {@link RegionFactoryBean}. - *

+ * * @author Costin Leau * @author John Blum */ @@ -107,7 +107,7 @@ public class RegionLookupFactoryBean implements FactoryBean>, /** * Sets the name of the Cache Region based on the bean 'id' attribute. If no Region is found for the given name, * a new one will be created. - *

+ * * @param name the name of this bean (Region) in the application context (bean factory). * @see org.springframework.beans.factory.BeanNameAware#setBeanName(String) */ @@ -117,7 +117,7 @@ public class RegionLookupFactoryBean implements FactoryBean>, /** * Sets a reference to the Cache used to create the Region. - *

+ * * @param cache a reference to the Cache. * @see org.springframework.data.gemfire.CacheFactoryBean * @see com.gemstone.gemfire.cache.GemFireCache @@ -129,7 +129,7 @@ public class RegionLookupFactoryBean implements FactoryBean>, /** * Sets the name of the Cache Region based on the bean 'name' attribute. If no Region is found with the given name, * a new one will be created. If no name is given, the value of the 'beanName' property will be used. - *

+ * * @param name the region name * @see #setBeanName(String) * @see com.gemstone.gemfire.cache.Region#getFullPath() @@ -140,7 +140,7 @@ public class RegionLookupFactoryBean implements FactoryBean>, /** * Sets a reference to the parent Region if this FactoryBean represents a GemFire Cache Sub-Region. - *

+ * * @param parent a reference to the parent Region if this Region is a Sub-Region. * @see com.gemstone.gemfire.cache.Region */ @@ -150,7 +150,7 @@ public class RegionLookupFactoryBean implements FactoryBean>, /** * Gets a reference to the parent Region if this FactoryBean represents a GemFire Cache Sub-Region. - *

+ * * @return a reference to the parent Region or null if this Region is not a Sub-Region. * @see com.gemstone.gemfire.cache.Region */ @@ -161,7 +161,7 @@ public class RegionLookupFactoryBean implements FactoryBean>, /** * Sets the name of the Cache Region as expected by GemFire. If no Region is found with the given name, a new one * will be created. If no name is given, the value of the 'name' property will be used. - *

+ * * @param regionName a String indicating the name of the Region in GemFire. * @see #setName(String) * @see com.gemstone.gemfire.cache.Region#getName() diff --git a/src/main/java/org/springframework/data/gemfire/RegionShortcutConverter.java b/src/main/java/org/springframework/data/gemfire/RegionShortcutConverter.java index bbdde97b..03049b7a 100644 --- a/src/main/java/org/springframework/data/gemfire/RegionShortcutConverter.java +++ b/src/main/java/org/springframework/data/gemfire/RegionShortcutConverter.java @@ -23,7 +23,7 @@ import com.gemstone.gemfire.cache.RegionShortcut; /** * The RegionShortcutConverter class is a Spring Converter implementation converting String value Region Shortcut * representations into actual GemFire RegionShortcut enumerated values. - *

+ * * @author John Blum * @see org.springframework.core.convert.converter.Converter * @see com.gemstone.gemfire.cache.RegionShortcut @@ -35,7 +35,7 @@ public class RegionShortcutConverter implements Converter + * * @param value the String to convert to a trimmed, upper case value. * @return a trimmed, upper case value of the specified String, or "null" if the String value reference is null. * @see java.lang.String#toUpperCase() @@ -48,7 +48,7 @@ public class RegionShortcutConverter implements Converter + * * @param source the String representation of the Region Shortcut to convert. * @return a RegionShortcut enumerated value for the String representation. * @throws IllegalArgumentException if the String source is not a valid RegionShortcut enumerated value. diff --git a/src/main/java/org/springframework/data/gemfire/SubRegionFactoryBean.java b/src/main/java/org/springframework/data/gemfire/SubRegionFactoryBean.java index 95d0733b..87c6aa20 100644 --- a/src/main/java/org/springframework/data/gemfire/SubRegionFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/SubRegionFactoryBean.java @@ -23,7 +23,6 @@ import org.springframework.beans.factory.InitializingBean; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; -import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.CacheListener; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue; @@ -31,7 +30,7 @@ import com.gemstone.gemfire.cache.wan.GatewaySender; /** * FactoryBean for creating a Gemfire sub-Regions. - *

+ * * @author David Turanski * @author John Blum * @param Region Key Type @@ -40,9 +39,9 @@ import com.gemstone.gemfire.cache.wan.GatewaySender; * (e.g. ReplicatedRegionFactoryBean) instead. */ @Deprecated -@SuppressWarnings("deprecation") -public class SubRegionFactoryBean extends AttributesFactory implements FactoryBean>, - InitializingBean { +@SuppressWarnings({"deprecation", "unused"}) +public class SubRegionFactoryBean extends com.gemstone.gemfire.cache.AttributesFactory + implements FactoryBean>, InitializingBean { protected final Log log = LogFactory.getLog(getClass()); @@ -56,7 +55,6 @@ public class SubRegionFactoryBean extends AttributesFactory implemen private Region parentRegion; private Region subRegion; - @SuppressWarnings("unused") private String name; private String regionName; @@ -125,8 +123,8 @@ public class SubRegionFactoryBean extends AttributesFactory implemen /** * 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 {@link #setAttributes(com.gemstone.gemfire.cache.RegionAttributes)}. + * 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 */ @@ -134,10 +132,6 @@ public class SubRegionFactoryBean extends AttributesFactory implemen this.cacheListeners = cacheListeners; } - /** - * - * @param gatewaySenders - */ public void setGatewaySenders(Object[] gatewaySenders) { this.gatewaySenders = gatewaySenders; } @@ -145,7 +139,6 @@ public class SubRegionFactoryBean extends AttributesFactory implemen /** * Set to true if the subregion should already exist, e.g., specified by * <lookup-region> - * @param lookupOnly */ public void setLookupOnly(boolean lookupOnly) { this.lookupOnly = lookupOnly; @@ -153,7 +146,6 @@ public class SubRegionFactoryBean extends AttributesFactory implemen /** * Set the bean name - the same as the subregion full path - * @param name */ public void setName(String name) { this.name = name; @@ -161,7 +153,6 @@ public class SubRegionFactoryBean extends AttributesFactory implemen /** * Set the simple name of the region - * @param regionName */ public void setRegionName(String regionName) { this.regionName = regionName; @@ -169,7 +160,6 @@ public class SubRegionFactoryBean extends AttributesFactory implemen /** * Set the parent Region - * @param parent */ public void setParent(Region parent) { this.parentRegion = parent; diff --git a/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java b/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java index 9619ba72..f1676455 100644 --- a/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java @@ -45,7 +45,7 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; /** * Client extension for GemFire Regions. - *

+ * * @author Costin Leau * @author David Turanski * @author John Blum @@ -202,9 +202,9 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean } /** - * Validates that the settings for ClientRegionShortcut and the 'persistent' attribute in elements + * Validates that the settings for ClientRegionShortcut and the 'persistent' attribute in <gfe:*-region> elements * are compatible. - *

+ * * @param resolvedShortcut the GemFire ClientRegionShortcut resolved form the Spring GemFire XML namespace * configuration meta-data. * @see #isPersistent() @@ -226,9 +226,9 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean } /** - * Validates that the settings for Data Policy and the 'persistent' attribute in elements + * Validates that the settings for Data Policy and the 'persistent' attribute in <gfe:*-region> elements * are compatible. - *

+ * * @param resolvedDataPolicy the GemFire Data Policy resolved form the Spring GemFire XML namespace configuration * meta-data. * @see #isPersistent() @@ -402,7 +402,7 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean * Indicates whether the region referred by this factory bean, will be * closed on shutdown (default true). Note: destroy and close are mutually * exclusive. Enabling one will automatically disable the other. - *

+ * * @param close whether to close or not the region * @see #setDestroy(boolean) */ @@ -419,7 +419,7 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean * Indicates whether the region referred by this factory bean will be * destroyed on shutdown (default false). Note: destroy and close are * mutually exclusive. Enabling one will automatically disable the other. - *

+ * * @param destroy whether or not to destroy the region * @see #setClose(boolean) */ @@ -441,7 +441,7 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean /** * Sets the CacheLoader used to load data local to the client's Region on cache misses. - *

+ * * @param cacheLoader a GemFire CacheLoader used to load data into the client Region. * @see com.gemstone.gemfire.cache.CacheLoader */ @@ -451,7 +451,7 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean /** * Sets the CacheWriter used to perform a synchronous write-behind when data is put into the client's Region. - *

+ * * @param cacheWriter the GemFire CacheWriter used to perform synchronous write-behinds on put ops. * @see com.gemstone.gemfire.cache.CacheWriter */ @@ -461,7 +461,7 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean /** * Sets the Data Policy. Used only when a new Region is created. - *

+ * * @param dataPolicy the client Region's Data Policy. * @see com.gemstone.gemfire.cache.DataPolicy */ @@ -471,7 +471,7 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean /** * Sets the name of disk store to use for overflow and persistence - *

+ * * @param diskStoreName a String specifying the 'name' of the client Region Disk Store. */ public void setDiskStoreName(String diskStoreName) { @@ -480,7 +480,7 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean /** * An alternate way to set the Data Policy, using the String name of the enumerated value. - *

+ * * @param dataPolicyName the enumerated value String name of the Data Policy. * @see com.gemstone.gemfire.cache.DataPolicy * @see #setDataPolicy(com.gemstone.gemfire.cache.DataPolicy) @@ -523,7 +523,7 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean * Sets the snapshots used for loading a newly created region. That * is, the snapshot will be used only when a new region is created - * if the region already exists, no loading will be performed. - *

+ * * @param snapshot the snapshot to set * @see #setName(String) */ diff --git a/src/main/java/org/springframework/data/gemfire/client/PoolFactoryBean.java b/src/main/java/org/springframework/data/gemfire/client/PoolFactoryBean.java index 7d4ae742..fa3e9e8a 100644 --- a/src/main/java/org/springframework/data/gemfire/client/PoolFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/client/PoolFactoryBean.java @@ -52,6 +52,7 @@ import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; * * @author Costin Leau */ +@SuppressWarnings("unused") public class PoolFactoryBean implements FactoryBean, InitializingBean, DisposableBean, BeanNameAware, BeanFactoryAware { @@ -115,9 +116,10 @@ public class PoolFactoryBean implements FactoryBean, InitializingBean, try { ClientCacheFactoryBean clientCacheFactoryBean = beanFactory.getBean(ClientCacheFactoryBean.class); properties = clientCacheFactoryBean.getProperties(); - } catch (Exception e) { - } + catch (Exception ignore) { + } + connectToTemporaryDs(properties); } @@ -393,10 +395,12 @@ public class PoolFactoryBean implements FactoryBean, InitializingBean, * initialize a client-like Distributed System before initializing * the pool */ + @SuppressWarnings("deprecation") static void connectToTemporaryDs(Properties properties) { Properties props = properties != null? (Properties) properties.clone() : new Properties(); props.setProperty("mcast-port", "0"); props.setProperty("locators", ""); DistributedSystem.connect(props); } -} \ No newline at end of file + +} diff --git a/src/main/java/org/springframework/data/gemfire/config/AbstractRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/AbstractRegionParser.java index 1b2afea0..79cdf298 100644 --- a/src/main/java/org/springframework/data/gemfire/config/AbstractRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/AbstractRegionParser.java @@ -36,7 +36,7 @@ import org.w3c.dom.Element; /** * Abstract base class encapsulating functionality common to all Region Parsers. - *

+ * * @author David Turanski * @author John Blum */ diff --git a/src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java b/src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java index 423cf8e6..4103d313 100644 --- a/src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java @@ -29,7 +29,7 @@ import org.w3c.dom.Element; /** * Namespace parser for "cache-server" element. - *

+ * * @author Costin Leau * @author John Blum */ diff --git a/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java index 3a66cae0..198b24db 100644 --- a/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java @@ -31,9 +31,9 @@ import org.w3c.dom.Element; /** * Parser for <client-region;gt; bean definitions. - *

+ * * To avoid eager evaluations, the region interests are declared as nested definition. - *

+ * * @author Costin Leau * @author David Turanski * @author John Blum diff --git a/src/main/java/org/springframework/data/gemfire/config/DiskStoreParser.java b/src/main/java/org/springframework/data/gemfire/config/DiskStoreParser.java index 7149639b..383c7bd9 100644 --- a/src/main/java/org/springframework/data/gemfire/config/DiskStoreParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/DiskStoreParser.java @@ -30,7 +30,7 @@ import org.w3c.dom.Element; /** * Parser for <disk-store> bean definitions. - *

+ * * @author David Turanski * @author John Blum */ diff --git a/src/main/java/org/springframework/data/gemfire/config/DiskWriteAttributesFactoryBean.java b/src/main/java/org/springframework/data/gemfire/config/DiskWriteAttributesFactoryBean.java index bf74fa7c..0470be76 100644 --- a/src/main/java/org/springframework/data/gemfire/config/DiskWriteAttributesFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/config/DiskWriteAttributesFactoryBean.java @@ -19,9 +19,6 @@ package org.springframework.data.gemfire.config; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; -import com.gemstone.gemfire.cache.DiskWriteAttributes; -import com.gemstone.gemfire.cache.DiskWriteAttributesFactory; - /** * Simple utility class used for defining nested factory-method like definitions * w/o polluting the container with useless beans. @@ -30,11 +27,12 @@ import com.gemstone.gemfire.cache.DiskWriteAttributesFactory; * @deprecated */ @Deprecated -class DiskWriteAttributesFactoryBean implements FactoryBean, InitializingBean { +@SuppressWarnings({ "deprecation", "unused" }) +class DiskWriteAttributesFactoryBean implements FactoryBean, InitializingBean { - private DiskWriteAttributes attributes; + private com.gemstone.gemfire.cache.DiskWriteAttributes attributes; - private DiskWriteAttributesFactory attrFactory; + private com.gemstone.gemfire.cache.DiskWriteAttributesFactory attrFactory; @Override public void afterPropertiesSet() { @@ -42,13 +40,13 @@ class DiskWriteAttributesFactoryBean implements FactoryBean } @Override - public DiskWriteAttributes getObject() throws Exception { + public com.gemstone.gemfire.cache.DiskWriteAttributes getObject() throws Exception { return attributes; } @Override public Class getObjectType() { - return (attributes != null ? attributes.getClass() : DiskWriteAttributes.class); + return (attributes != null ? attributes.getClass() : com.gemstone.gemfire.cache.DiskWriteAttributes.class); } @Override @@ -56,7 +54,8 @@ class DiskWriteAttributesFactoryBean implements FactoryBean return true; } - public void setDiskAttributesFactory(DiskWriteAttributesFactory dwaf) { + public void setDiskAttributesFactory(com.gemstone.gemfire.cache.DiskWriteAttributesFactory dwaf) { this.attrFactory = dwaf; } + } diff --git a/src/main/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBean.java b/src/main/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBean.java index a1de51b8..af13431a 100644 --- a/src/main/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBean.java @@ -25,7 +25,7 @@ import com.gemstone.gemfire.cache.util.ObjectSizer; /** * Simple utility class used for defining nested factory-method like definitions w/o polluting the container with useless beans. - *

+ * * @author Costin Leau * @author John Blum * @see org.springframework.beans.factory.FactoryBean diff --git a/src/main/java/org/springframework/data/gemfire/config/LocalRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/LocalRegionParser.java index 8298a591..e07b178b 100644 --- a/src/main/java/org/springframework/data/gemfire/config/LocalRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/LocalRegionParser.java @@ -24,7 +24,7 @@ import org.w3c.dom.Element; /** * Parser for <local-region;gt; bean definitions. - *

+ * * @author David Turanski * @author John Blum */ diff --git a/src/main/java/org/springframework/data/gemfire/config/LookupRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/LookupRegionParser.java index 2fc95712..dd7af158 100644 --- a/src/main/java/org/springframework/data/gemfire/config/LookupRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/LookupRegionParser.java @@ -23,7 +23,7 @@ import org.w3c.dom.Element; /** * Parser for <lookup-region;gt; definitions. - *

+ * * @author Costin Leau * @author David Turanski * @author John Blum diff --git a/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java b/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java index c13de78f..cf499caf 100644 --- a/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java +++ b/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java @@ -39,7 +39,7 @@ import com.gemstone.gemfire.cache.Scope; /** * Utilities used by the Spring Data GemFire XML Namespace parsers. - *

+ * * @author Costin Leau * @author David Turanski * @author Lyndon Adams @@ -179,7 +179,7 @@ abstract class ParsingUtils { /** * Parses the eviction sub-element. Populates the given attribute factory with the proper attributes. - *

+ * * @param parserContext the context used for parsing the XML document. * @param element the XML elements being parsed. * @param regionAttributesBuilder the Region Attributes builder. @@ -221,7 +221,7 @@ abstract class ParsingUtils { /** * Parses the subscription sub-element. Populates the given attribute factory with the proper attributes. - *

+ * * @param parserContext the context used while parsing the XML document. * @param element the XML element being parsed. * @param regionAttributesBuilder the Region Attributes builder. @@ -267,7 +267,7 @@ abstract class ParsingUtils { /** * Parses the expiration sub-elements. Populates the given attribute factory with proper attributes. - *

+ * * @param parserContext the context used while parsing the XML document. * @param element the XML element being parsed. * @param regionAttributesBuilder the Region Attributes builder. diff --git a/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java index 010df399..452e3ba5 100644 --- a/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java @@ -31,10 +31,10 @@ import org.springframework.util.xml.DomUtils; import org.w3c.dom.Element; /** - * Parser for <partitioned-region;gt; bean definitions. - *

+ * Parser for <partitioned-region> bean definitions. + * * To avoid eager evaluations, the region attributes are declared as a nested definition. - *

+ * * @author Costin Leau * @author David Turanski * @author John Blum diff --git a/src/main/java/org/springframework/data/gemfire/config/PdxDiskStoreAwareBeanFactoryPostProcessor.java b/src/main/java/org/springframework/data/gemfire/config/PdxDiskStoreAwareBeanFactoryPostProcessor.java index 9d7f1450..7943cb36 100644 --- a/src/main/java/org/springframework/data/gemfire/config/PdxDiskStoreAwareBeanFactoryPostProcessor.java +++ b/src/main/java/org/springframework/data/gemfire/config/PdxDiskStoreAwareBeanFactoryPostProcessor.java @@ -33,7 +33,7 @@ import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue; * Region and Disk Store beans in the Spring container to form a dependency on the Cache's PDX Disk Store bean. * A persistent Region may contain PDX typed data, in which case, the PDX type meta-data stored to disk needs to be * loaded before the Region having PDX data is loaded from disk. - *

+ * * @author John Blum * @see org.springframework.beans.factory.config.BeanFactoryPostProcessor * @see org.springframework.beans.factory.config.ConfigurableListableBeanFactory @@ -67,7 +67,7 @@ public class PdxDiskStoreAwareBeanFactoryPostProcessor implements BeanFactoryPos * or requirement on the PDX-based Disk Store being present before the bean itself can be processed and created. * For instance, Regions that might contained PDX-based Key types require the PDX type meta-data to be loaded * before the Region's data (Keys) are accessed. - *

+ * * @param beanFactory the BeanFactory used to evaluate beans in context for PDX Disk Store dependencies. * @param beanTypes an array of Class types indicating the type of beans to evaluate. * @see org.springframework.beans.factory.config.ConfigurableListableBeanFactory#getBeanNamesForType(Class) @@ -94,7 +94,7 @@ public class PdxDiskStoreAwareBeanFactoryPostProcessor implements BeanFactoryPos /** * Adds the PDX Disk Store bean name as a dependency at the beginning of the list of dependencies declared * by the Bean. - *

+ * * @param beanDefinition the BeanDefinition to add the PDX Disk Store dependency to. * @see #getDependsOn(org.springframework.beans.factory.config.BeanDefinition) * @see org.springframework.beans.factory.config.BeanDefinition#setDependsOn(String[]) @@ -107,7 +107,7 @@ public class PdxDiskStoreAwareBeanFactoryPostProcessor implements BeanFactoryPos /** * Gets the current list of dependencies declared in the BeanDefinition for the Bean, returning an * empty String array if the dependsOn property is null. - *

+ * * @param beanDefinition the BeanDefinition of the Bean containing the dependencies. * @return an array of Bean names that this Bean depends on, or an empty String array if the dependencies * are undefined. diff --git a/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java index f42806dd..11b21a6a 100644 --- a/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java @@ -24,7 +24,7 @@ import org.w3c.dom.Element; /** * Parser for <replicated-region;gt; definitions. - *

+ * * @author Costin Leau * @author David Turanski * @author John Blum diff --git a/src/main/java/org/springframework/data/gemfire/function/annotation/Filter.java b/src/main/java/org/springframework/data/gemfire/function/annotation/Filter.java index b0bd86e3..346f4066 100644 --- a/src/main/java/org/springframework/data/gemfire/function/annotation/Filter.java +++ b/src/main/java/org/springframework/data/gemfire/function/annotation/Filter.java @@ -20,7 +20,7 @@ import java.lang.annotation.Target; /** * * Used to inject a set of cache keys into a function execution, The annotated parameter must be of type - * {@link Set}. This is used by the function invocation to specify a set of keys of interest and also to define + * {@link java.util.Set}. This is used by the function invocation to specify a set of keys of interest and also to define * an additional parameter on the function implementation method containing the filter. * @author David Turanski * diff --git a/src/main/java/org/springframework/data/gemfire/function/annotation/RegionData.java b/src/main/java/org/springframework/data/gemfire/function/annotation/RegionData.java index 133829c9..ff6ef74b 100644 --- a/src/main/java/org/springframework/data/gemfire/function/annotation/RegionData.java +++ b/src/main/java/org/springframework/data/gemfire/function/annotation/RegionData.java @@ -20,12 +20,11 @@ import java.lang.annotation.Target; /** * * Used to inject Region data into a function execution. The annotated parameter must be of type - * {@link Map}. The contents depends on the region configuration (for a partitioned region, this will + * {@link java.util.Map}. The contents depends on the region configuration (for a partitioned region, this will * contain only entries for the local partition) * and any filters configured for the function context. * * @author David Turanski - * */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.PARAMETER}) diff --git a/src/main/java/org/springframework/data/gemfire/function/config/EnableGemfireFunctions.java b/src/main/java/org/springframework/data/gemfire/function/config/EnableGemfireFunctions.java index 8f2f1ea7..c82d61ee 100644 --- a/src/main/java/org/springframework/data/gemfire/function/config/EnableGemfireFunctions.java +++ b/src/main/java/org/springframework/data/gemfire/function/config/EnableGemfireFunctions.java @@ -23,12 +23,11 @@ import org.springframework.context.annotation.Import; /** * - * Enables Gemfire annotated function implementations. Causes the container to - * discover any beans that are annotated with {code} @GemfireFunction {code}, wrap them in - * a {@link PojoFunctionWrapper}, and register them with the cache. + * Enables Gemfire annotated function implementations. Causes the container to discover any beans that are annotated + * with {code} @GemfireFunction {code}, wrap them in a + * {@link org.springframework.data.gemfire.function.PojoFunctionWrapper}, and register them with the cache. * * @author David Turanski - * */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/org/springframework/data/gemfire/function/execution/GemfireFunctionOperations.java b/src/main/java/org/springframework/data/gemfire/function/execution/GemfireFunctionOperations.java index f54a32be..1b0d5d22 100644 --- a/src/main/java/org/springframework/data/gemfire/function/execution/GemfireFunctionOperations.java +++ b/src/main/java/org/springframework/data/gemfire/function/execution/GemfireFunctionOperations.java @@ -20,8 +20,6 @@ import com.gemstone.gemfire.cache.execute.Function; * An interface for invoking Gemfire functions * * @author David Turanski - * - * @param the preferred return type */ public interface GemfireFunctionOperations { @@ -66,10 +64,10 @@ public interface GemfireFunctionOperations { /** - * Execute a function using a native GemFire {@link Execution} instance + * Execute a function using a native GemFire {@link com.gemstone.gemfire.cache.execute.Execution} instance * @param callback a callback providing the execution instance * @return the execution result */ public abstract T execute(GemfireFunctionCallback callback); -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/gemfire/function/execution/GemfireFunctionProxyFactoryBean.java b/src/main/java/org/springframework/data/gemfire/function/execution/GemfireFunctionProxyFactoryBean.java index a43367de..5be731f7 100644 --- a/src/main/java/org/springframework/data/gemfire/function/execution/GemfireFunctionProxyFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/function/execution/GemfireFunctionProxyFactoryBean.java @@ -31,7 +31,6 @@ import com.gemstone.gemfire.cache.execute.FunctionService; * A proxy Factory Bean for all non-region function execution interfaces * * @author David Turanski - * */ public class GemfireFunctionProxyFactoryBean implements FactoryBean, MethodInterceptor, BeanClassLoaderAware { @@ -53,11 +52,9 @@ public class GemfireFunctionProxyFactoryBean implements FactoryBean, Met /** * @param serviceInterface the proxied interface - * @param functionId the associated function id (must be a function registered by this id with the GemFire {@link FunctionService} * @param gemfireFunctionOperations an interface used to delegate the function invocation (typically a GemFire function template) */ - public GemfireFunctionProxyFactoryBean(Class serviceInterface, - GemfireFunctionOperations gemfireFunctionOperations) { + public GemfireFunctionProxyFactoryBean(Class serviceInterface, GemfireFunctionOperations gemfireFunctionOperations) { Assert.notNull(serviceInterface, "'serviceInterface' must not be null"); Assert.isTrue(serviceInterface.isInterface(), "'serviceInterface' must be an interface"); this.serviceInterface = serviceInterface; diff --git a/src/main/java/org/springframework/data/gemfire/function/execution/GemfireOnRegionOperations.java b/src/main/java/org/springframework/data/gemfire/function/execution/GemfireOnRegionOperations.java index e9beb8c9..2ea5ff60 100644 --- a/src/main/java/org/springframework/data/gemfire/function/execution/GemfireOnRegionOperations.java +++ b/src/main/java/org/springframework/data/gemfire/function/execution/GemfireOnRegionOperations.java @@ -18,8 +18,6 @@ import com.gemstone.gemfire.cache.execute.Function; /** * @author David Turanski - * - * @param */ public interface GemfireOnRegionOperations extends GemfireFunctionOperations { @@ -28,4 +26,4 @@ public interface GemfireOnRegionOperations extends GemfireFunctionOperations { public abstract void executeWithNoResult(String functionId, Set keys, Object... args); public abstract T executeAndextract(String functionId, Set keys, Object... args); -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/gemfire/listener/adapter/ContinuousQueryListenerAdapter.java b/src/main/java/org/springframework/data/gemfire/listener/adapter/ContinuousQueryListenerAdapter.java index 1c32a3eb..2ee8ade8 100644 --- a/src/main/java/org/springframework/data/gemfire/listener/adapter/ContinuousQueryListenerAdapter.java +++ b/src/main/java/org/springframework/data/gemfire/listener/adapter/ContinuousQueryListenerAdapter.java @@ -43,18 +43,18 @@ import com.gemstone.gemfire.cache.query.CqQuery; * Allows listener methods to operate on event content types, completely * independent from the GemFire API. * - *

Modeled as much as possible after the JMS MessageListenerAdapter in + * Modeled as much as possible after the JMS MessageListenerAdapter in * Spring Framework. * *

By default, the content of incoming GemFire events gets extracted before * being passed into the target listener method, to let the target method * operate on event content types such as Object or Operation instead of - * the raw {@link CqEvent}. + * the raw {@link CqEvent}.

* *

Find below some examples of method signatures compliant with this * adapter class. This first example handles all CqEvent types * and gets passed the contents of each event type as an - * argument. + * argument.

* *
public interface PojoListener {
  *    void handleEvent(CqEvent event);
@@ -69,7 +69,6 @@ import com.gemstone.gemfire.cache.query.CqQuery;
  * @author Juergen Hoeller
  * @author Costin Leau
  * @author Oliver Gierke
- * @see org.springframework.jms.listener.adapter.MessageListenerAdapter
  */
 public class ContinuousQueryListenerAdapter implements ContinuousQueryListener {
 
@@ -334,4 +333,4 @@ public class ContinuousQueryListenerAdapter implements ContinuousQueryListener {
 			throw new GemfireListenerExecutionFailedException("Failed to invoke target method '" + methodName, ex);
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/springframework/data/gemfire/mapping/Region.java b/src/main/java/org/springframework/data/gemfire/mapping/Region.java
index 54052560..cedeae80 100644
--- a/src/main/java/org/springframework/data/gemfire/mapping/Region.java
+++ b/src/main/java/org/springframework/data/gemfire/mapping/Region.java
@@ -36,7 +36,7 @@ public @interface Region {
 	/**
 	 * The name, or fully-qualified bean name of the {@link com.gemstone.gemfire.cache.Region} the entity
 	 * shall be stored in (e.g. "Users", or "/Local/Admin/Users").
-	 * 

+ * * @return the name or qualified path of the Region the entity shall be persisted in. */ String value() default ""; diff --git a/src/main/java/org/springframework/data/gemfire/mapping/Regions.java b/src/main/java/org/springframework/data/gemfire/mapping/Regions.java index 2000aca9..5d08c842 100644 --- a/src/main/java/org/springframework/data/gemfire/mapping/Regions.java +++ b/src/main/java/org/springframework/data/gemfire/mapping/Regions.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.data.gemfire.mapping; import java.util.Collections; @@ -27,7 +28,7 @@ import com.gemstone.gemfire.cache.Region; /** * Simple value object to abstract access to regions by name and mapped type. - *

+ * * @author Oliver Gierke * @author John Blum */ @@ -79,7 +80,7 @@ public class Regions implements Iterable> { /** * Returns the {@link Region} with the given name or path. - *

+ * * @param namePath must not be {@literal null}, and either identifies the Region by name or the fully-qualified path. * @return the {@link Region} with the given name or path. */ diff --git a/src/main/java/org/springframework/data/gemfire/package-info.java b/src/main/java/org/springframework/data/gemfire/package-info.java index 12ed9c55..c101cb37 100644 --- a/src/main/java/org/springframework/data/gemfire/package-info.java +++ b/src/main/java/org/springframework/data/gemfire/package-info.java @@ -1,14 +1,12 @@ /** - * - * Package providing integration of + * Package providing integration of * GemFire * with Spring concepts. * - *

Contains helper classes, a template plus callback for GemFire + * Contains helper classes, a template plus callback for GemFire * access and an implementation of Spring's transaction SPI for local * GemFire transactions. - * */ package org.springframework.data.gemfire; diff --git a/src/main/java/org/springframework/data/gemfire/repository/GemfireRepository.java b/src/main/java/org/springframework/data/gemfire/repository/GemfireRepository.java index ec4b935c..65446e44 100644 --- a/src/main/java/org/springframework/data/gemfire/repository/GemfireRepository.java +++ b/src/main/java/org/springframework/data/gemfire/repository/GemfireRepository.java @@ -17,14 +17,31 @@ package org.springframework.data.gemfire.repository; import java.io.Serializable; +import org.springframework.data.domain.Sort; import org.springframework.data.repository.CrudRepository; /** * Gemfire-specific extension of the {@link CrudRepository} interface. - * + * * @author Oliver Gierke + * @author John Blum + * @see java.io.Serializable + * @see org.springframework.data.repository.CrudRepository */ +@SuppressWarnings("unused") public interface GemfireRepository extends CrudRepository { + /** + * Returns all entities sorted by the given options. + * + * @param sort the Spring Data Commons Sort type defining the ordering criteria. + * @return all entities sorted by the given options. + * @see org.springframework.data.repository.PagingAndSortingRepository#findAll(org.springframework.data.domain.Sort) + * @see org.springframework.data.domain.Sort + * @see java.lang.Iterable + */ + Iterable findAll(Sort sort); + T save(Wrapper wrapper); + } diff --git a/src/main/java/org/springframework/data/gemfire/repository/query/DefaultGemfireEntityInformation.java b/src/main/java/org/springframework/data/gemfire/repository/query/DefaultGemfireEntityInformation.java index ff7dde84..d95b5975 100644 --- a/src/main/java/org/springframework/data/gemfire/repository/query/DefaultGemfireEntityInformation.java +++ b/src/main/java/org/springframework/data/gemfire/repository/query/DefaultGemfireEntityInformation.java @@ -25,7 +25,7 @@ import org.springframework.data.repository.core.support.PersistentEntityInformat /** * Implementation of {@link GemfireEntityInformation} to return the region name stored in the backing * {@link PersistentEntity}. - *

+ * * @author Oliver Gierke * @author John Blum * @see org.springframework.data.gemfire.mapping.GemfirePersistentEntity diff --git a/src/main/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepository.java b/src/main/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepository.java index 0c4ae16e..25f2da5d 100644 --- a/src/main/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepository.java +++ b/src/main/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepository.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import org.springframework.data.domain.Sort; import org.springframework.data.gemfire.GemfireCallback; import org.springframework.data.gemfire.GemfireTemplate; import org.springframework.data.gemfire.repository.GemfireRepository; @@ -101,12 +102,44 @@ public class SimpleGemfireRepository implements Gemf @Override public Collection findAll() { SelectResults results = template.find("select * from " + template.getRegion().getFullPath()); - return (Collection)results.asList(); + return results.asList(); } /* * (non-Javadoc) - * + * @see org.springframework.data.gemfire.repository.GemfireRepository.sor(:org.springframework.data.domain.Sort) + */ + @Override + public Iterable findAll(final Sort sort) { + SelectResults selectResults = template.find(String.format("SELECT * FROM %1$s%2$s", + template.getRegion().getFullPath(), toString(sort))); + return selectResults.asList(); + } + + /* + * (non-Javadoc) + * + * @see org.springframework.data.domain.Sort + */ + private String toString(final Sort sort) { + if (sort != null) { + StringBuilder orderClause = new StringBuilder(" ORDER BY "); + int count = 0; + + for (Sort.Order order : sort) { + orderClause.append(count++ > 0 ? ", " : ""); + orderClause.append(String.format("%1$s %2$s", order.getProperty(), order.getDirection())); + } + + return orderClause.toString(); + } + + return ""; + } + + /* + * (non-Javadoc) + * * @see * org.springframework.data.repository.CrudRepository#findAll(java.lang. * Iterable) diff --git a/src/main/java/org/springframework/data/gemfire/serialization/WiringInstantiator.java b/src/main/java/org/springframework/data/gemfire/serialization/WiringInstantiator.java index 1670523e..71c1d92b 100644 --- a/src/main/java/org/springframework/data/gemfire/serialization/WiringInstantiator.java +++ b/src/main/java/org/springframework/data/gemfire/serialization/WiringInstantiator.java @@ -33,12 +33,10 @@ import com.gemstone.gemfire.Instantiator; * either by relying on an existing bean definition (which acts as a template) or by providing an embedded * configuration through annotations. * - *

* Can reuse existing instantiators to optimize instance creation. If one is not provided, it will fallback * to reflection invocation. * - *

- * By default, on initialization, the class will register itself as an {@link Instantiator} through + * By default, on initialization, the class will register itself as an {@link Instantiator} through * {@link #register(Instantiator)}. This behaviour can be disabled through {@link #setAutoRegister(boolean)}. * Additionally, the instantiator registration is not distributed by default, to allow the application context * to be reused. This can be changed through {@link #setDistribute(boolean)}. @@ -47,8 +45,7 @@ import com.gemstone.gemfire.Instantiator; * @see org.springframework.beans.factory.wiring.BeanWiringInfoResolver * @see org.springframework.beans.factory.annotation.Autowired * @see javax.annotation.Resource - * @see javax.inject.Inject - * + * * @author Costin Leau */ public class WiringInstantiator extends Instantiator implements BeanFactoryAware, InitializingBean, DisposableBean { @@ -140,4 +137,4 @@ public class WiringInstantiator extends Instantiator implements BeanFactoryAware public void setDistribute(boolean distribute) { this.distribute = distribute; } -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java b/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java index 243e0da2..59036076 100644 --- a/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java @@ -35,12 +35,13 @@ import com.gemstone.gemfire.cache.server.ServerLoadProbe; /** * FactoryBean for easy creation and configuration of GemFire {@link CacheServer} instances. - *

+ * * @author Costin Leau * @author John Blum */ +@SuppressWarnings("unused") public class CacheServerFactoryBean implements FactoryBean, InitializingBean, DisposableBean, - SmartLifecycle { + SmartLifecycle { private boolean autoStartup = true; private boolean notifyBySubscription = CacheServer.DEFAULT_NOTIFY_BY_SUBSCRIPTION; @@ -68,7 +69,7 @@ public class CacheServerFactoryBean implements FactoryBean, Initial private String hostNameForClients = CacheServer.DEFAULT_HOSTNAME_FOR_CLIENTS; private String subscriptionDiskStore; - private String[] serverGroups = CacheServer.DEFAULT_GROUPS; + private String[] serverGroups = {}; private SubscriptionEvictionPolicy subscriptionEvictionPolicy = SubscriptionEvictionPolicy.valueOf( ClientSubscriptionConfig.DEFAULT_EVICTION_POLICY.toUpperCase()); @@ -85,6 +86,7 @@ public class CacheServerFactoryBean implements FactoryBean, Initial return true; } + @SuppressWarnings("deprecation") public void afterPropertiesSet() throws IOException { Assert.notNull(cache, "A GemFire Cache is required."); diff --git a/src/main/java/org/springframework/data/gemfire/support/ClientRegionShortcutWrapper.java b/src/main/java/org/springframework/data/gemfire/support/ClientRegionShortcutWrapper.java index 2b2fc10c..5e58d266 100644 --- a/src/main/java/org/springframework/data/gemfire/support/ClientRegionShortcutWrapper.java +++ b/src/main/java/org/springframework/data/gemfire/support/ClientRegionShortcutWrapper.java @@ -23,7 +23,7 @@ import com.gemstone.gemfire.cache.client.ClientRegionShortcut; /** * The ClientRegionShortcutWrapper enum is a Java enumerated type that wraps GemFire's ClientRegionShortcuts * with Spring Data GemFire ClientRegionShortcutWrapper enumerated values. - *

+ * * @author John Blum * @see com.gemstone.gemfire.cache.client.ClientRegionShortcut * @since 1.4.0 diff --git a/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java b/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java index 475f6f60..0ed9b5d9 100644 --- a/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java +++ b/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java @@ -23,10 +23,13 @@ import com.gemstone.gemfire.cache.GemFireCache; import com.gemstone.gemfire.cache.Region; /** - * Spring Framework {@link Cache} implementation using a GemFire {@link Region} underneath. - * Supports Gemfire 6.5 or higher. - * + * Spring Framework {@link Cache} implementation backed by a GemFire {@link Region}. + * + * Supports GemFire 6.5 or higher. + * * @author Costin Leau + * @author John Blum + * */ public class GemfireCache implements Cache { @@ -64,7 +67,9 @@ public class GemfireCache implements Cache { return (value == null ? null : new SimpleValueWrapper(value)); } + @SuppressWarnings("unchecked") public void put(Object key, Object value) { region.put(key, value); } -} \ No newline at end of file + +} diff --git a/src/main/java/org/springframework/data/gemfire/support/JSONRegionAdvice.java b/src/main/java/org/springframework/data/gemfire/support/JSONRegionAdvice.java index 5bef37da..57511226 100644 --- a/src/main/java/org/springframework/data/gemfire/support/JSONRegionAdvice.java +++ b/src/main/java/org/springframework/data/gemfire/support/JSONRegionAdvice.java @@ -48,7 +48,7 @@ public class JSONRegionAdvice { /** * Sets names of regions to be included for JSON conversion. By default, all regions will be included - * @param regions a List of region names to include + * @param regionNames a List of region names to include */ public void setIncludedRegionNames(List regionNames) { this.includedRegions = regionNames; diff --git a/src/main/java/org/springframework/data/gemfire/support/RegionShortcutWrapper.java b/src/main/java/org/springframework/data/gemfire/support/RegionShortcutWrapper.java index 669214fa..66a99294 100644 --- a/src/main/java/org/springframework/data/gemfire/support/RegionShortcutWrapper.java +++ b/src/main/java/org/springframework/data/gemfire/support/RegionShortcutWrapper.java @@ -23,7 +23,6 @@ import com.gemstone.gemfire.cache.RegionShortcut; /** * The RegionShortcutWrapper enum is a Java enumerated type that wraps GemFire's RegionShortcuts * with Spring Data GemFire RegionShortcutWrapper enumerated values. - *

* * @author John Blum * @see com.gemstone.gemfire.cache.RegionShortcut diff --git a/src/main/java/org/springframework/data/gemfire/support/SpringContextBootstrappingInitializer.java b/src/main/java/org/springframework/data/gemfire/support/SpringContextBootstrappingInitializer.java index 11cafc20..571abe32 100644 --- a/src/main/java/org/springframework/data/gemfire/support/SpringContextBootstrappingInitializer.java +++ b/src/main/java/org/springframework/data/gemfire/support/SpringContextBootstrappingInitializer.java @@ -39,8 +39,9 @@ import com.gemstone.gemfire.cache.Declarable; * mostly configured with Spring Data GemFire's XML namespace. The Cache itself is the only resource that cannot be * configured and initialized in a Spring context since the initializer is not invoked until after GemFire creates * and initializes the Cache for use. - *

+ * * @author John Blum + * @see java.util.Properties * @see org.springframework.context.ApplicationContext * @see org.springframework.context.ApplicationListener * @see org.springframework.context.ConfigurableApplicationContext @@ -50,9 +51,9 @@ import com.gemstone.gemfire.cache.Declarable; * @see org.springframework.context.event.SimpleApplicationEventMulticaster * @see org.springframework.context.support.ClassPathXmlApplicationContext * @see com.gemstone.gemfire.cache.Declarable - * @since 1.3.4 - * @link http://pubs.vmware.com/vfabric53/topic/com.vmware.vfabric.gemfire.7.0/basic_config/the_cache/setting_cache_initializer.html - * @link https://jira.springsource.org/browse/SGF-248 + * @since 1.4.0 + * @see Setting Cache Initializer + * @see SGF-248 */ @SuppressWarnings("unused") public class SpringContextBootstrappingInitializer implements Declarable, ApplicationListener { @@ -73,7 +74,7 @@ public class SpringContextBootstrappingInitializer implements Declarable, Applic /** * Gets a reference to the Spring ApplicationContext constructed, configured and initialized inside the GemFire * Server-based JVM process. - *

+ * * @return a reference to the Spring ApplicationContext bootstrapped by GemFire. * @see org.springframework.context.ConfigurableApplicationContext */ @@ -86,7 +87,7 @@ public class SpringContextBootstrappingInitializer implements Declarable, Applic * Registers a Spring ApplicationListener to be notified when the Spring ApplicationContext is created by GemFire * when instantiating and initializing declared Initializers from the GemFire native configuration file * (e.g. cache.xml). - *

+ * * @param the Class type of the Spring ApplicationListener. * @param listener the ApplicationListener to register for ContextRefreshedEvents by this * SpringContextBootstrappingInitializer. @@ -111,7 +112,7 @@ public class SpringContextBootstrappingInitializer implements Declarable, Applic * ApplicationContext was previously created, initialized and refreshed before any ApplicationListeners interested * in ContextRefreshedEvents get registered so that application components (such as LazyWiringDeclarableSupport * objects) arriving late to the game that also require configuration (auto-wiring) get wired accordingly too. - *

+ * * @param listener a Spring ApplicationListener requiring notification of any ContextRefreshedEvents after the * ApplicationContext has already been created, initialized and/or refreshed. * @see org.springframework.context.ApplicationListener#onApplicationEvent(org.springframework.context.ApplicationEvent) @@ -131,7 +132,7 @@ public class SpringContextBootstrappingInitializer implements Declarable, Applic /** * Unregisters the Spring ApplicationListener from this SpringContextBootstrappingInitializer in order to stop * receiving ApplicationEvents on Spring context refreshes. - *

+ * * @param the Class type of the Spring ApplicationListener. * @param listener the ApplicationListener to unregister from receiving ContextRefreshedEvents by this * SpringContextBootstrappingInitializer. @@ -154,7 +155,7 @@ public class SpringContextBootstrappingInitializer implements Declarable, Applic * Creates (constructs and configures) a ConfigurableApplicationContext instance based on the specified locations * of the context configuration meta-data files. The created ConfigurableApplicationContext is not automatically * "refreshed" and therefore must be "refreshed" by the caller manually. - *

+ * * @param configLocations a String array indicating the locations of the context configuration meta-data files * used to configure the ConfigurableApplicationContext instance. * @return a newly constructed and configured instance of the ConfigurableApplicationContext class. Note, the @@ -175,12 +176,12 @@ public class SpringContextBootstrappingInitializer implements Declarable, Applic * specified locations of context configuration meta-data files used to configure the context. The created * ConfigurableApplicationContext is not automatically "refreshed" and therefore must be "refreshed" * by the caller manually. - *

+ * * When basePackages are specified, an instance of AnnotationConfigApplicationContext is returned; otherwise * an instance of the ClassPathXmlApplicationContext is initialized with the configLocations and returned. * This method prefers the ClassPathXmlApplicationContext to the AnnotationConfigApplicationContext when both * basePackages and configLocations are specified. - *

+ * * @param basePackages the base application packages to scan for application @Components and @Configuration classes. * * @param configLocations a String array indicating the locations of the context configuration meta-data files * used to configure the ConfigurableApplicationContext instance. @@ -211,7 +212,7 @@ public class SpringContextBootstrappingInitializer implements Declarable, Applic /** * Initializes a Spring ApplicationContext with the given parameters from a GemFire Initializer in GemFire native * configuration meta-data (e.g. cache.xml). - *

+ * * @param parameters a Properties object containing the configuration parameters and settings defined in the * GemFire cache.xml >initializer/< element. * @see #createApplicationContext @@ -239,6 +240,7 @@ public class SpringContextBootstrappingInitializer implements Declarable, Applic applicationContext = createApplicationContext(basePackagesArray, configLocations); Assert.notNull(applicationContext, "The 'created' ConfigurableApplicationContext cannot be null!"); + assert applicationContext != null; applicationContext.addApplicationListener(this); applicationContext.registerShutdownHook(); applicationContext.refresh(); @@ -252,7 +254,7 @@ public class SpringContextBootstrappingInitializer implements Declarable, Applic /** * Gets the the ID of the Spring ApplicationContext in a null-safe manner. - *

+ * * @param applicationContext the Spring ApplicationContext to retrieve the ID for. * @return the ID of the given Spring ApplicationContext or null if the ApplicationContext reference is null. * @see org.springframework.context.ApplicationContext#getId() @@ -265,7 +267,7 @@ public class SpringContextBootstrappingInitializer implements Declarable, Applic * Gets notified when the Spring ApplicationContext gets created and refreshed by GemFire. The handler method * proceeds in notifying any other GemFire components that need to be aware that the Spring ApplicationContext * now exists and is ready for use, such as other Declarable GemFire objects requiring auto-wiring support, etc. - *

+ * * @param event the ContextRefreshedEvent signaling that the Spring ApplicationContext has been created * and refreshed by GemFire. * @see org.springframework.context.event.ContextRefreshedEvent diff --git a/src/main/java/org/springframework/data/gemfire/support/package-info.java b/src/main/java/org/springframework/data/gemfire/support/package-info.java index 61b59613..092e5f7e 100644 --- a/src/main/java/org/springframework/data/gemfire/support/package-info.java +++ b/src/main/java/org/springframework/data/gemfire/support/package-info.java @@ -1,10 +1,8 @@ /** - * * Support package for Spring Gemfire integration. * - *

Provides Spring 3.1 caching support (Cache and CacheManager implementations on top of Gemfire APIs). - * + * Provides Spring 3.1 caching support (Cache and CacheManager implementations on top of Gemfire APIs). */ package org.springframework.data.gemfire.support; diff --git a/src/main/java/org/springframework/data/gemfire/wan/AbstractWANComponentFactoryBean.java b/src/main/java/org/springframework/data/gemfire/wan/AbstractWANComponentFactoryBean.java index f80346b2..40ef2d6d 100644 --- a/src/main/java/org/springframework/data/gemfire/wan/AbstractWANComponentFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/wan/AbstractWANComponentFactoryBean.java @@ -30,7 +30,7 @@ import com.gemstone.gemfire.cache.Cache; /** * Base class for GemFire WAN Gateway component factory beans. - *

+ * * @author David Turanski * @author John Blum */ diff --git a/src/main/java/org/springframework/data/gemfire/wan/AsyncEventQueueFactoryBean.java b/src/main/java/org/springframework/data/gemfire/wan/AsyncEventQueueFactoryBean.java index c8f4e891..ac23bc49 100644 --- a/src/main/java/org/springframework/data/gemfire/wan/AsyncEventQueueFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/wan/AsyncEventQueueFactoryBean.java @@ -26,7 +26,7 @@ import com.gemstone.gemfire.cache.util.Gateway; /** * FactoryBean for creating GemFire {@link AsyncEventQueue}s. - *

+ * * @author David Turanski * @author John Blum */ @@ -51,7 +51,7 @@ public class AsyncEventQueueFactoryBean extends AbstractWANComponentFactoryBean< /** * Constructs an instance of the AsyncEventQueueFactoryBean for creating an GemFire AsyncEventQueue. - *

+ * * @param cache the GemFire Cache reference. * @see #AsyncEventQueueFactoryBean(com.gemstone.gemfire.cache.Cache, com.gemstone.gemfire.cache.asyncqueue.AsyncEventListener) */ @@ -61,7 +61,7 @@ public class AsyncEventQueueFactoryBean extends AbstractWANComponentFactoryBean< /** * Constructs an instance of the AsyncEventQueueFactoryBean for creating an GemFire AsyncEventQueue. - *

+ * * @param cache the GemFire Cache reference. * @param asyncEventListener required {@link AsyncEventListener} */ diff --git a/src/main/java/org/springframework/data/gemfire/wan/GatewaySenderFactoryBean.java b/src/main/java/org/springframework/data/gemfire/wan/GatewaySenderFactoryBean.java index 3d0e95b3..6cea311e 100644 --- a/src/main/java/org/springframework/data/gemfire/wan/GatewaySenderFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/wan/GatewaySenderFactoryBean.java @@ -30,10 +30,11 @@ import com.gemstone.gemfire.cache.wan.GatewayTransportFilter; /** * FactoryBean for creating a parallel or serial GemFire {@link GatewaySender}. - *

+ * * @author David Turanski * @author John Blum */ +@SuppressWarnings("unused") public class GatewaySenderFactoryBean extends AbstractWANComponentFactoryBean implements SmartLifecycle { @@ -65,7 +66,7 @@ public class GatewaySenderFactoryBean extends AbstractWANComponentFactoryBean + * * @param cache the Gemfire cache reference. * @see com.gemstone.gemfire.cache.Cache */ diff --git a/src/test/java/org/springframework/data/gemfire/CacheServerIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/CacheServerIntegrationTest.java index 63676a10..c084b989 100644 --- a/src/test/java/org/springframework/data/gemfire/CacheServerIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/CacheServerIntegrationTest.java @@ -35,7 +35,7 @@ import com.gemstone.gemfire.cache.server.CacheServer; /** * The CacheServerIntegrationTest class is a test suite of test cases testing the functionality of GemFire Cache Servers * configured using the Spring Data GemFire XML namespace. - *

+ * * @author John Blum * @see org.junit.Test * @see org.springframework.data.gemfire.server.CacheServerFactoryBean @@ -79,6 +79,7 @@ public class CacheServerIntegrationTest { } @Test + @SuppressWarnings("deprecation") public void testCacheServerRunningWithSubscription() { assertNotNull(cacheServer); assertTrue(cacheServer.isRunning()); diff --git a/src/test/java/org/springframework/data/gemfire/ClientRegionShortcutConverterTest.java b/src/test/java/org/springframework/data/gemfire/ClientRegionShortcutConverterTest.java index e32bea75..6536d07b 100644 --- a/src/test/java/org/springframework/data/gemfire/ClientRegionShortcutConverterTest.java +++ b/src/test/java/org/springframework/data/gemfire/ClientRegionShortcutConverterTest.java @@ -25,7 +25,7 @@ import com.gemstone.gemfire.cache.client.ClientRegionShortcut; /** * 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 diff --git a/src/test/java/org/springframework/data/gemfire/ColocatedRegionIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/ColocatedRegionIntegrationTest.java index eed5bed4..18f972ef 100644 --- a/src/test/java/org/springframework/data/gemfire/ColocatedRegionIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/ColocatedRegionIntegrationTest.java @@ -30,7 +30,7 @@ import com.gemstone.gemfire.cache.Region; /** * The ColocatedRegionIntegrationTest class is a test suite class containing test cases for JIRA issue SGF-195, * concerning colocated Regions in GemFire. - *

+ * * @author John Blum * @link https://jira.springsource.org/browse/SGF-195 * @see org.junit.Test diff --git a/src/test/java/org/springframework/data/gemfire/DiskStoreBeanUsingPropertyPlaceholdersIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/DiskStoreBeanUsingPropertyPlaceholdersIntegrationTest.java index dbddc911..4a89e79c 100644 --- a/src/test/java/org/springframework/data/gemfire/DiskStoreBeanUsingPropertyPlaceholdersIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/DiskStoreBeanUsingPropertyPlaceholdersIntegrationTest.java @@ -35,7 +35,7 @@ import com.gemstone.gemfire.cache.DiskStore; * The DiskStoreBeanUsingPropertyPlaceholdersIntegrationTest class is a test suite of integration tests testing the use * of Spring PropertyPlaceholders to configure and initialize a Disk Store bean's properties using property placeholders * in the SDG XML namespace <disk-store> bean definition attributes. - *

+ * * @author John Blum * @see org.junit.Test * @see org.junit.runner.RunWith diff --git a/src/test/java/org/springframework/data/gemfire/DiskStoreFactoryBeanTest.java b/src/test/java/org/springframework/data/gemfire/DiskStoreFactoryBeanTest.java index fd21161c..2213617c 100644 --- a/src/test/java/org/springframework/data/gemfire/DiskStoreFactoryBeanTest.java +++ b/src/test/java/org/springframework/data/gemfire/DiskStoreFactoryBeanTest.java @@ -24,7 +24,7 @@ import org.junit.Test; /** * The DiskStoreFactoryBeanTest class is a test suite of test cases testing the contract and functionality of the * DiskStoreFactoryBean class. - *

+ * * * @author John Blum * @see org.junit.Test diff --git a/src/test/java/org/springframework/data/gemfire/GemfireUtilsTest.java b/src/test/java/org/springframework/data/gemfire/GemfireUtilsTest.java index 3e3ab4d3..8a775146 100644 --- a/src/test/java/org/springframework/data/gemfire/GemfireUtilsTest.java +++ b/src/test/java/org/springframework/data/gemfire/GemfireUtilsTest.java @@ -26,7 +26,7 @@ import com.gemstone.gemfire.internal.GemFireVersion; /** * The GemfireUtilsTest class is a test suite of test cases testing the contract and functionality of the GemfireUtils * abstract utility class. - *

+ * * @author John Blum * @see org.junit.Test * @see org.springframework.data.gemfire.GemfireUtils diff --git a/src/test/java/org/springframework/data/gemfire/InvalidRegionDataPolicyShortcutsTest.java b/src/test/java/org/springframework/data/gemfire/InvalidRegionDataPolicyShortcutsTest.java index f6cf6557..5e534e55 100644 --- a/src/test/java/org/springframework/data/gemfire/InvalidRegionDataPolicyShortcutsTest.java +++ b/src/test/java/org/springframework/data/gemfire/InvalidRegionDataPolicyShortcutsTest.java @@ -26,7 +26,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; /** * The InvalidRegionDataPolicyShortcutsIntegrationTest class is a test suite of test cases testing and setting up * some invalid, or illegal uses of the Region data-policy and/or shortcut XML namespace attributes. - *

+ * * @author John Blum * @see org.junit.Test * @since 1.4.0 diff --git a/src/test/java/org/springframework/data/gemfire/LazyWiringDeclarableSupportIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/LazyWiringDeclarableSupportIntegrationTest.java index 69d4629d..e3d3c1dd 100644 --- a/src/test/java/org/springframework/data/gemfire/LazyWiringDeclarableSupportIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/LazyWiringDeclarableSupportIntegrationTest.java @@ -39,7 +39,7 @@ import org.springframework.util.Assert; * The LazyWiringDeclarableSupportIntegrationTest class is a test suite of integration test cases testing * a LazyWiringDeclarableSupport object/component's wiring configuration and initialization in * a Spring container context. - *

+ * * @author John Blum * @see org.junit.Test * @see org.junit.runner.RunWith diff --git a/src/test/java/org/springframework/data/gemfire/LazyWiringDeclarableSupportTest.java b/src/test/java/org/springframework/data/gemfire/LazyWiringDeclarableSupportTest.java index 06d25566..8671e47e 100644 --- a/src/test/java/org/springframework/data/gemfire/LazyWiringDeclarableSupportTest.java +++ b/src/test/java/org/springframework/data/gemfire/LazyWiringDeclarableSupportTest.java @@ -38,7 +38,7 @@ import org.springframework.data.gemfire.support.SpringContextBootstrappingInitia * of the LazyWiringDeclarableSupport class. This test class focuses on testing isolated units of functionality * in the Declarable class directly, mocking any dependencies as appropriate, in order for the class to uphold * it's contract. - *

+ * * @author John Blum * @see org.junit.Test * @see org.mockito.Mockito diff --git a/src/test/java/org/springframework/data/gemfire/LocalRegionFactoryBeanTest.java b/src/test/java/org/springframework/data/gemfire/LocalRegionFactoryBeanTest.java index 2b3556b5..00ce1aea 100644 --- a/src/test/java/org/springframework/data/gemfire/LocalRegionFactoryBeanTest.java +++ b/src/test/java/org/springframework/data/gemfire/LocalRegionFactoryBeanTest.java @@ -34,7 +34,7 @@ import com.gemstone.gemfire.cache.RegionShortcut; /** * The PartitionedRegionFactoryBeanTest class is a test suite of test cases testing the component functionality * and correct behavior of the PartitionedRegionFactoryBean class. - *

+ * * * @author David Turanski * @author John Blum diff --git a/src/test/java/org/springframework/data/gemfire/LookupSubRegionTest.java b/src/test/java/org/springframework/data/gemfire/LookupSubRegionTest.java index 623884bb..d2c3ca24 100644 --- a/src/test/java/org/springframework/data/gemfire/LookupSubRegionTest.java +++ b/src/test/java/org/springframework/data/gemfire/LookupSubRegionTest.java @@ -32,7 +32,7 @@ import com.gemstone.gemfire.cache.Region; /** * The LookupSubRegionTest class is a test suite of test cases testing the contract and functionality of Region lookups * using Spring Data GemFire configuration and GemFire native cache.xml. - *

+ * * @author John Blum * @see org.junit.Test * @see org.springframework.context.ApplicationContext diff --git a/src/test/java/org/springframework/data/gemfire/PartitionAttributesFactoryBeanTest.java b/src/test/java/org/springframework/data/gemfire/PartitionAttributesFactoryBeanTest.java index d78ade57..4d3133f5 100644 --- a/src/test/java/org/springframework/data/gemfire/PartitionAttributesFactoryBeanTest.java +++ b/src/test/java/org/springframework/data/gemfire/PartitionAttributesFactoryBeanTest.java @@ -29,7 +29,7 @@ import com.gemstone.gemfire.cache.PartitionResolver; /** * The PartitionAttributesFactoryBeanTest class is test suite of test cases testing the contract and functionality of * the PartitionAttributesFactoryBean class. - *

+ * * @author John Blum * @see org.junit.Test * @see org.springframework.data.gemfire.PartitionAttributesFactoryBean diff --git a/src/test/java/org/springframework/data/gemfire/PartitionedRegionFactoryBeanTest.java b/src/test/java/org/springframework/data/gemfire/PartitionedRegionFactoryBeanTest.java index f4fb5713..0d520b86 100644 --- a/src/test/java/org/springframework/data/gemfire/PartitionedRegionFactoryBeanTest.java +++ b/src/test/java/org/springframework/data/gemfire/PartitionedRegionFactoryBeanTest.java @@ -30,7 +30,7 @@ import com.gemstone.gemfire.cache.RegionFactory; /** * The PartitionedRegionFactoryBeanTest class is a test suite of test cases testing the component functionality * and correct behavior of the PartitionedRegionFactoryBean class. - *

+ * * @author John Blum * @see org.junit.Test * @see org.mockito.Mockito diff --git a/src/test/java/org/springframework/data/gemfire/PdxDiskStoreIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/PdxDiskStoreIntegrationTest.java index ac98c604..d6c38673 100644 --- a/src/test/java/org/springframework/data/gemfire/PdxDiskStoreIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/PdxDiskStoreIntegrationTest.java @@ -38,7 +38,7 @@ import com.gemstone.gemfire.cache.Region; /** * The PdxDiskStoreTest class is a test suite containing tests to reproduce the issue in JIRA SGF-197. - *

+ * * @author John Blum * @link https://jira.springsource.org/browse/SGF-197 * @see org.junit.Test @@ -130,6 +130,7 @@ public class PdxDiskStoreIntegrationTest { } } + @SuppressWarnings("unused") public static class KeyHolder extends AbstractHolderSupport { private T key; @@ -178,6 +179,7 @@ public class PdxDiskStoreIntegrationTest { } } + @SuppressWarnings("unused") public static class ValueHolder extends AbstractHolderSupport { private T value; diff --git a/src/test/java/org/springframework/data/gemfire/RegionDataPolicyShortcutsIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/RegionDataPolicyShortcutsIntegrationTest.java index 88eee25c..31b943ff 100644 --- a/src/test/java/org/springframework/data/gemfire/RegionDataPolicyShortcutsIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/RegionDataPolicyShortcutsIntegrationTest.java @@ -36,7 +36,7 @@ import com.gemstone.gemfire.cache.Region; /** * The RegionShortcutsIntegrationTest class is a test suite of test cases testing the use of RegionShortcuts in the * Spring Data GemFire XML Namespace! - *

+ * * @author John Blum * @see org.junit.Test * @see org.junit.runner.RunWith diff --git a/src/test/java/org/springframework/data/gemfire/RegionFactoryBeanTest.java b/src/test/java/org/springframework/data/gemfire/RegionFactoryBeanTest.java index 4dd1944e..43eaeda1 100644 --- a/src/test/java/org/springframework/data/gemfire/RegionFactoryBeanTest.java +++ b/src/test/java/org/springframework/data/gemfire/RegionFactoryBeanTest.java @@ -55,7 +55,7 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; /** * The RegionFactoryBeanTest class is a test suite of test cases testing the contract and functionality of the * RegionFactoryBean class. - *

+ * * @author David Turanski * @author John Blum * @see org.springframework.data.gemfire.RegionFactoryBean diff --git a/src/test/java/org/springframework/data/gemfire/RegionLookupIntegrationTests.java b/src/test/java/org/springframework/data/gemfire/RegionLookupIntegrationTests.java index a3c82adc..56fb6d5a 100644 --- a/src/test/java/org/springframework/data/gemfire/RegionLookupIntegrationTests.java +++ b/src/test/java/org/springframework/data/gemfire/RegionLookupIntegrationTests.java @@ -37,7 +37,7 @@ import com.gemstone.gemfire.cache.Scope; /** * The RegionLookupIntegrationTests class is a test suite of test cases testing the lookup functionality for various * peer Region types. - *

+ * * @author John Blum * @see org.junit.Test * @see org.springframework.context.ConfigurableApplicationContext diff --git a/src/test/java/org/springframework/data/gemfire/RegionShortcutConverterTest.java b/src/test/java/org/springframework/data/gemfire/RegionShortcutConverterTest.java index d64141cf..a15c4140 100644 --- a/src/test/java/org/springframework/data/gemfire/RegionShortcutConverterTest.java +++ b/src/test/java/org/springframework/data/gemfire/RegionShortcutConverterTest.java @@ -25,7 +25,7 @@ import com.gemstone.gemfire.cache.RegionShortcut; /** * The RegionShortcutConverterTest class is a test suite of test cases testing the contract and functionality of the * RegionShortcutConverter class - *

+ * * @author John Blum * @see org.junit.Test * @see org.springframework.data.gemfire.RegionShortcutConverter diff --git a/src/test/java/org/springframework/data/gemfire/ReplicatedRegionFactoryBeanTest.java b/src/test/java/org/springframework/data/gemfire/ReplicatedRegionFactoryBeanTest.java index 8e28194a..5a61d879 100644 --- a/src/test/java/org/springframework/data/gemfire/ReplicatedRegionFactoryBeanTest.java +++ b/src/test/java/org/springframework/data/gemfire/ReplicatedRegionFactoryBeanTest.java @@ -30,7 +30,7 @@ import com.gemstone.gemfire.cache.RegionFactory; /** * The ReplicatedRegionFactoryBeanTest class is a test suite of test cases testing the component functionality * and correct behavior of the ReplicatedRegionFactoryBean class. - *

+ * * @author John Blum * @see org.junit.Test * @see org.mockito.Mockito diff --git a/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java b/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java index 850f00af..cd9da6ce 100644 --- a/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java +++ b/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java @@ -17,14 +17,13 @@ package org.springframework.data.gemfire; import com.gemstone.gemfire.cache.util.ObjectSizer; -import com.gemstone.gemfire.cache.util.ObjectSizerImpl; /** * @author Costin Leau */ public class SimpleObjectSizer implements ObjectSizer { - private static final ObjectSizer sizer = new ObjectSizerImpl(); + private static final ObjectSizer sizer = ObjectSizer.DEFAULT; @Override public int sizeof(Object o) { diff --git a/src/test/java/org/springframework/data/gemfire/SubRegionIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/SubRegionIntegrationTest.java index 6dcccd3c..51ee499d 100644 --- a/src/test/java/org/springframework/data/gemfire/SubRegionIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/SubRegionIntegrationTest.java @@ -47,7 +47,7 @@ import com.gemstone.gemfire.cache.SubscriptionAttributes; * The SubRegionIntegrationTest class is a test suite of test cases testing the functionality of SubRegions in GemFire * configured with Spring Data GemFire's XML namespace configuration meta-data. This test class tests a complex * SubRegion configuration in order to ensure functional completeness. - *

+ * * @author John Blum * @see org.junit.Test * @see org.junit.runner.RunWith @@ -58,6 +58,7 @@ import com.gemstone.gemfire.cache.SubscriptionAttributes; */ @ContextConfiguration("complex-subregion.xml") @RunWith(SpringJUnit4ClassRunner.class) +@SuppressWarnings("unused") public class SubRegionIntegrationTest { @Autowired diff --git a/src/test/java/org/springframework/data/gemfire/client/ClientRegionWithCacheLoaderWriterTest.java b/src/test/java/org/springframework/data/gemfire/client/ClientRegionWithCacheLoaderWriterTest.java index dfbb3b2b..4707b4ac 100644 --- a/src/test/java/org/springframework/data/gemfire/client/ClientRegionWithCacheLoaderWriterTest.java +++ b/src/test/java/org/springframework/data/gemfire/client/ClientRegionWithCacheLoaderWriterTest.java @@ -46,7 +46,7 @@ import com.gemstone.gemfire.cache.util.CacheWriterAdapter; /** * 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. - *

+ * * @author John Blum * @see org.junit.Test * @see org.junit.runner.RunWith diff --git a/src/test/java/org/springframework/data/gemfire/client/ClientSubRegionTest.java b/src/test/java/org/springframework/data/gemfire/client/ClientSubRegionTest.java index f321b6b3..75841a29 100644 --- a/src/test/java/org/springframework/data/gemfire/client/ClientSubRegionTest.java +++ b/src/test/java/org/springframework/data/gemfire/client/ClientSubRegionTest.java @@ -38,14 +38,13 @@ 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. - *

+ * * @author John Blum * @see org.junit.Test * @see org.junit.runner.RunWith * @see org.springframework.test.context.ContextConfiguration * @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner * @since 1.4.0 - * @since 7.0.1 (GemFire) */ @ContextConfiguration("clientcache-with-subregion-config.xml") @RunWith(SpringJUnit4ClassRunner.class) diff --git a/src/test/java/org/springframework/data/gemfire/config/AbstractRegionParserTest.java b/src/test/java/org/springframework/data/gemfire/config/AbstractRegionParserTest.java index 47bec9d1..988a01c1 100644 --- a/src/test/java/org/springframework/data/gemfire/config/AbstractRegionParserTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/AbstractRegionParserTest.java @@ -35,7 +35,7 @@ import org.w3c.dom.Node; /** * The AbstractRegionParserTest class is a test suite of test cases testing the contract and functionality of the * AbstractRegionParser class. - *

+ * * @author John Blum * @see org.junit.Test * @see org.mockito.Mockito diff --git a/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java index 2e389b7f..b4159feb 100644 --- a/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java @@ -35,7 +35,7 @@ import com.gemstone.gemfire.cache.server.ClientSubscriptionConfig; /** * The CacheServerNamespaceTest class is a test suite of test cases testing the functionality of the SDG XML namespace * when configuring a GemFire Cache Servers and Client Subscription. - *

+ * * @author Costin Leau * @author David Turanski * @author John Blum @@ -49,12 +49,14 @@ import com.gemstone.gemfire.cache.server.ClientSubscriptionConfig; */ @ContextConfiguration(locations="server-ns.xml", initializers=GemfireTestApplicationContextInitializer.class) @RunWith(SpringJUnit4ClassRunner.class) +@SuppressWarnings("unused") public class CacheServerNamespaceTest { @Autowired private ApplicationContext context; @Test + @SuppressWarnings("deprecation") public void testBasicCacheServer() throws Exception { CacheServer cacheServer = context.getBean("advanced-config", CacheServer.class); diff --git a/src/test/java/org/springframework/data/gemfire/config/CacheUsingPdxNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/CacheUsingPdxNamespaceTest.java index b7c7efd9..62021f6f 100644 --- a/src/test/java/org/springframework/data/gemfire/config/CacheUsingPdxNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/CacheUsingPdxNamespaceTest.java @@ -35,7 +35,7 @@ import com.gemstone.gemfire.pdx.PdxSerializer; /** * The CacheUsingPdxNamespaceTest class is a test suite of test case testing the Spring Data GemFire XML namespace * when PDX is configured in GemFire. - *

+ * * @author John Blum * @see org.junit.Test * @see org.junit.runner.RunWith diff --git a/src/test/java/org/springframework/data/gemfire/config/ClientRegionNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/ClientRegionNamespaceTest.java index 01d0366f..58db8dcd 100644 --- a/src/test/java/org/springframework/data/gemfire/config/ClientRegionNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/ClientRegionNamespaceTest.java @@ -114,8 +114,8 @@ public class ClientRegionNamespaceTest { assertEquals(5, attrs.getEvictionAttributes().getMaximum()); } - @SuppressWarnings("rawtypes") @Test + @SuppressWarnings({ "deprecation", "rawtypes" }) public void testPersistent() throws Exception { assertTrue(context.containsBean("persistent")); Region region = context.getBean("persistent", Region.class); diff --git a/src/test/java/org/springframework/data/gemfire/config/ClientRegionUsingDataPolicyAndShortcutTest.java b/src/test/java/org/springframework/data/gemfire/config/ClientRegionUsingDataPolicyAndShortcutTest.java index 7cf8febf..2c2acaa8 100644 --- a/src/test/java/org/springframework/data/gemfire/config/ClientRegionUsingDataPolicyAndShortcutTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/ClientRegionUsingDataPolicyAndShortcutTest.java @@ -25,7 +25,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; /** * The ClientRegionUsingDataPolicyAndShortcutTest class is a test suite of test case testing a client Region * bean definition with both data-policy and shortcut specified. - *

+ * * @author John Blum * @see org.junit.Test * @since 1.3.3 diff --git a/src/test/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBeanTest.java b/src/test/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBeanTest.java index 362557bc..8d02d393 100644 --- a/src/test/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBeanTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBeanTest.java @@ -34,7 +34,7 @@ import com.gemstone.gemfire.internal.cache.lru.MemLRUCapacityController; /** * 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.config.EvictionAttributesFactoryBean diff --git a/src/test/java/org/springframework/data/gemfire/config/GemfireV7GatewayNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/GemfireV7GatewayNamespaceTest.java index e5707cb5..db8bd795 100644 --- a/src/test/java/org/springframework/data/gemfire/config/GemfireV7GatewayNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/GemfireV7GatewayNamespaceTest.java @@ -37,7 +37,6 @@ import org.springframework.data.gemfire.TestUtils; import org.springframework.data.gemfire.test.GemfireTestBeanPostProcessor; import org.springframework.data.gemfire.wan.GatewaySenderFactoryBean; -import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.asyncqueue.AsyncEvent; import com.gemstone.gemfire.cache.asyncqueue.AsyncEventListener; @@ -51,14 +50,15 @@ import com.gemstone.gemfire.cache.wan.GatewayTransportFilter; /** * This test is only valid for GF 7.0 and above - *

+ * * @author David Turanski * @author John Blum */ @SuppressWarnings("unused") public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest { - /* (non-Javadoc) + /* + * (non-Javadoc) * @see org.springframework.data.gemfire.RecreatingContextTest#location() */ @Override diff --git a/src/test/java/org/springframework/data/gemfire/config/IndexNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/IndexNamespaceTest.java index a607e97e..3655db2d 100644 --- a/src/test/java/org/springframework/data/gemfire/config/IndexNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/IndexNamespaceTest.java @@ -29,16 +29,14 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.query.Index; -import com.gemstone.gemfire.cache.query.IndexType; /** - * * @author Costin Leau * @author David Turanski */ +@ContextConfiguration(locations="index-ns.xml", initializers=GemfireTestApplicationContextInitializer.class) @RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(locations="index-ns.xml", - initializers=GemfireTestApplicationContextInitializer.class) +@SuppressWarnings("deprecation") public class IndexNamespaceTest { private final String name = "test-index"; @@ -49,6 +47,7 @@ public class IndexNamespaceTest { @Before public void setUp() throws Exception { Cache cache = (Cache) context.getBean("gemfireCache"); + if (cache.getRegion(name) == null) { cache.createRegionFactory().create("test-index"); } @@ -62,7 +61,7 @@ public class IndexNamespaceTest { assertEquals("status", idx.getIndexedExpression()); assertEquals("simple", idx.getName()); assertEquals(name, idx.getRegion().getName()); - assertEquals(IndexType.FUNCTIONAL, idx.getType()); + assertEquals(com.gemstone.gemfire.cache.query.IndexType.FUNCTIONAL, idx.getType()); } @Test @@ -73,6 +72,7 @@ public class IndexNamespaceTest { assertEquals("tsi.name", idx.getIndexedExpression()); assertEquals("complex-index", idx.getName()); assertEquals(name, idx.getRegion().getName()); - assertEquals(IndexType.HASH, idx.getType()); + assertEquals(com.gemstone.gemfire.cache.query.IndexType.HASH, idx.getType()); } + } diff --git a/src/test/java/org/springframework/data/gemfire/config/JndiBindingsPropertyPlaceholderTest.java b/src/test/java/org/springframework/data/gemfire/config/JndiBindingsPropertyPlaceholderTest.java index 8fde976e..ea5e59d9 100644 --- a/src/test/java/org/springframework/data/gemfire/config/JndiBindingsPropertyPlaceholderTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/JndiBindingsPropertyPlaceholderTest.java @@ -38,7 +38,7 @@ import com.gemstone.gemfire.internal.datasource.ConfigProperty; /** * The JndiBindingsPropertyPlaceholderTest class is a test suite of test cases testing the configuration of a GemFire * Cache JNDI DataSource using property placeholders. - *

+ * * @author John Blum * @see org.junit.Test * @see org.springframework.context.ApplicationContext diff --git a/src/test/java/org/springframework/data/gemfire/config/JndiBindingsTest.java b/src/test/java/org/springframework/data/gemfire/config/JndiBindingsTest.java index db661d9e..087821ac 100644 --- a/src/test/java/org/springframework/data/gemfire/config/JndiBindingsTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/JndiBindingsTest.java @@ -22,7 +22,6 @@ import static org.junit.Assert.assertTrue; 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; @@ -31,7 +30,7 @@ import com.gemstone.gemfire.internal.datasource.GemFireBasicDataSource; /** * This test requires a real cache - *

+ * * @author David Turanski * @author John Blum */ diff --git a/src/test/java/org/springframework/data/gemfire/config/LocalRegionNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/LocalRegionNamespaceTest.java index 930211bd..3f3f2974 100644 --- a/src/test/java/org/springframework/data/gemfire/config/LocalRegionNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/LocalRegionNamespaceTest.java @@ -58,8 +58,8 @@ public class LocalRegionNamespaceTest { assertTrue(context.containsBean("simple")); } - @SuppressWarnings("rawtypes") @Test + @SuppressWarnings({ "deprecation", "rawtypes" }) public void testPublishingLocal() throws Exception { assertTrue(context.containsBean("pub")); RegionFactoryBean fb = context.getBean("&pub", RegionFactoryBean.class); @@ -117,4 +117,4 @@ public class LocalRegionNamespaceTest { RegionAttributes attrs = region.getAttributes(); assertTrue(attrs.getDataPolicy().withPersistence()); } -} \ No newline at end of file +} diff --git a/src/test/java/org/springframework/data/gemfire/config/PdxDiskStoreAwareBeanFactoryPostProcessorTest.java b/src/test/java/org/springframework/data/gemfire/config/PdxDiskStoreAwareBeanFactoryPostProcessorTest.java index 88384710..ad1bbf24 100644 --- a/src/test/java/org/springframework/data/gemfire/config/PdxDiskStoreAwareBeanFactoryPostProcessorTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/PdxDiskStoreAwareBeanFactoryPostProcessorTest.java @@ -49,7 +49,7 @@ import com.gemstone.gemfire.internal.cache.PartitionedRegion; /** * The PdxDiskStoreAwareBeanFactoryPostProcessorTest class is a test suite of test cases testing the functionality * of the PdxDiskStoreAwareBeanFactoryPostProcessor class. - *

+ * * @author John Blum * @see org.junit.Test * @see org.mockito.Mockito @@ -69,7 +69,7 @@ public class PdxDiskStoreAwareBeanFactoryPostProcessorTest { return (array == null || array.length == 0); } - protected static boolean isBeanType(final BeanDefinition beanDefinition, final Class beanType) { + protected static boolean isBeanType(final BeanDefinition beanDefinition, final Class beanType) { return (beanDefinition instanceof AbstractBeanDefinition && ((AbstractBeanDefinition) beanDefinition).hasBeanClass() && beanType.isAssignableFrom(((AbstractBeanDefinition) beanDefinition).getBeanClass())); diff --git a/src/test/java/org/springframework/data/gemfire/config/RegionEvictionAttributesNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/RegionEvictionAttributesNamespaceTest.java index dbac9889..453e9dd1 100644 --- a/src/test/java/org/springframework/data/gemfire/config/RegionEvictionAttributesNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/RegionEvictionAttributesNamespaceTest.java @@ -36,7 +36,7 @@ import com.gemstone.gemfire.internal.cache.lru.LRUCapacityController; /** * The RegionEvictionAttributesNamespaceTest class is a test suite of test cases testing the use of Eviction settings * (EvictionAttributes) in the SDG XML namespace. - *

+ * * @author John Blum * @since 1.3.4 */ diff --git a/src/test/java/org/springframework/data/gemfire/config/RegionWithSubRegionBeanDefinitionHashCodeTest.java b/src/test/java/org/springframework/data/gemfire/config/RegionWithSubRegionBeanDefinitionHashCodeTest.java index 1cc9df84..98926f2a 100644 --- a/src/test/java/org/springframework/data/gemfire/config/RegionWithSubRegionBeanDefinitionHashCodeTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/RegionWithSubRegionBeanDefinitionHashCodeTest.java @@ -33,14 +33,14 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; * Spring container BeanDefinition representing a GemFire Region having SubRegions. This test suite is meant to * ensure the correct behavior of and provide regression coverage for, JIRA issue SGF-178, "parent attribute causes * endless loop in hashCode". - *

+ * * The 'parent' attribute was added to the parent Region's BeanDefinition, referring to the parent Region's * BeanDefinition itself, before it recurses to parse the SubRegion elements, which is then used by the * AbstractRegionParser.doParseInternal method to set the parent property of the SubRegion's BeanDefinition. - *

+ * * Calling hashCode on a parent Region's BeanDefinition that has a parent 'attribute' referring to the parent Region's * BeanDefinition itself, causes infinite recursion and an eventual StackOverflowError. - *

+ * * * java.lang.StackOverflowError * at java.util.LinkedHashMap$LinkedHashIterator.(LinkedHashMap.java:345) @@ -68,10 +68,10 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; * at org.springframework.core.AttributeAccessorSupport.hashCode(AttributeAccessorSupport.java:99) * at org.springframework.beans.factory.support.AbstractBeanDefinition.hashCode(AbstractBeanDefinition.java:1052) * - *

+ * * This also causes problems for tools like Spring Tool Suite, which use the BeanDefinitions from the Spring container * context as meta-data in the IDE. - *

+ * * @author John Blum * @see org.junit.Test * @see org.junit.runner.RunWith diff --git a/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java index f362ad77..0469c1cc 100644 --- a/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java @@ -56,13 +56,13 @@ public class ReplicatedRegionNamespaceTest { public void testBasicReplica() throws Exception { assertTrue(context.containsBean("simple")); RegionFactoryBean fb = context.getBean("&simple", RegionFactoryBean.class); - assertEquals(false ,(Boolean)TestUtils.readField("close", fb)); + assertEquals(false, TestUtils.readField("close", fb)); RegionAttributes attrs = TestUtils.readField("attributes", fb); assertFalse(attrs.getConcurrencyChecksEnabled()); } - @SuppressWarnings("rawtypes") @Test + @SuppressWarnings({ "deprecation", "rawtypes" }) public void testPublishingReplica() throws Exception { assertTrue(context.containsBean("pub")); RegionFactoryBean fb = context.getBean("&pub", RegionFactoryBean.class); @@ -122,4 +122,4 @@ public class ReplicatedRegionNamespaceTest { assertEquals(existing, context.getBean("lookup")); } -} \ No newline at end of file +} diff --git a/src/test/java/org/springframework/data/gemfire/config/SubRegionNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/SubRegionNamespaceTest.java index ea3e2426..75805e28 100644 --- a/src/test/java/org/springframework/data/gemfire/config/SubRegionNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/SubRegionNamespaceTest.java @@ -37,7 +37,7 @@ import com.gemstone.gemfire.cache.Region; /** * The SubRegionNamespaceTest class is a test suite of test cases testing the contract and functionality of * Region/SubRegion creation in a GemFire Cache. - *

+ * * @author David Turanski * @author John Blum * @see org.junit.Test diff --git a/src/test/java/org/springframework/data/gemfire/config/SubRegionSubElementNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/SubRegionSubElementNamespaceTest.java index acae2f6c..6da72f52 100644 --- a/src/test/java/org/springframework/data/gemfire/config/SubRegionSubElementNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/SubRegionSubElementNamespaceTest.java @@ -36,7 +36,7 @@ import com.gemstone.gemfire.cache.util.CacheListenerAdapter; /** * The SubRegionSubElementNamespaceTest class... - *

+ * * @author John Blum * @see org.junit.Test * @see org.springframework.test.context.ContextConfiguration diff --git a/src/test/java/org/springframework/data/gemfire/config/SubRegionWithInvalidDataPolicyTest.java b/src/test/java/org/springframework/data/gemfire/config/SubRegionWithInvalidDataPolicyTest.java index 55ecece9..c7040542 100644 --- a/src/test/java/org/springframework/data/gemfire/config/SubRegionWithInvalidDataPolicyTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/SubRegionWithInvalidDataPolicyTest.java @@ -28,7 +28,7 @@ import org.xml.sax.SAXParseException; /** * The SubRegionWithInvalidDataPolicyTest class is a test suite of test cases testing the data-policy and persistent * attributes settings are consistent for GemFire SubRegion bean definitions. - *

+ * * @author John Blum * @see org.junit.Test * @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner diff --git a/src/test/java/org/springframework/data/gemfire/fork/CacheServerProcess.java b/src/test/java/org/springframework/data/gemfire/fork/CacheServerProcess.java index 0fd566d8..b1434914 100644 --- a/src/test/java/org/springframework/data/gemfire/fork/CacheServerProcess.java +++ b/src/test/java/org/springframework/data/gemfire/fork/CacheServerProcess.java @@ -20,10 +20,8 @@ import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Properties; - import org.springframework.data.gemfire.ForkUtil; -import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.CacheFactory; import com.gemstone.gemfire.cache.DataPolicy; @@ -31,11 +29,11 @@ import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.RegionFactory; import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache.server.CacheServer; -import com.gemstone.gemfire.distributed.DistributedSystem; /** * @author Costin Leau */ +@SuppressWarnings("unchecked") public class CacheServerProcess { public static void main(String[] args) throws Exception { @@ -75,4 +73,5 @@ public class CacheServerProcess { System.out.println("Waiting for shutdown"); bufferedReader.readLine(); } + } diff --git a/src/test/java/org/springframework/data/gemfire/function/FunctionArgumentResolverTest.java b/src/test/java/org/springframework/data/gemfire/function/FunctionArgumentResolverTest.java index 17d767d4..a6c33660 100644 --- a/src/test/java/org/springframework/data/gemfire/function/FunctionArgumentResolverTest.java +++ b/src/test/java/org/springframework/data/gemfire/function/FunctionArgumentResolverTest.java @@ -262,6 +262,7 @@ public class FunctionArgumentResolverTest { } @Test + @SuppressWarnings("unchecked") public void testMethodWithFunctionContextAndResultSender() throws NoSuchMethodException { FunctionContext functionContext = mock(FunctionContext.class); ResultSender resultSender = mock(ResultSender.class); diff --git a/src/test/java/org/springframework/data/gemfire/mapping/RegionsTest.java b/src/test/java/org/springframework/data/gemfire/mapping/RegionsTest.java index f49077ca..a0587271 100644 --- a/src/test/java/org/springframework/data/gemfire/mapping/RegionsTest.java +++ b/src/test/java/org/springframework/data/gemfire/mapping/RegionsTest.java @@ -41,13 +41,14 @@ import com.gemstone.gemfire.cache.Region; /** * The RegionsTest class is a test suite of test cases testing the contract and functionality of the Regions class. - *

+ * * @author John J. Blum * @see org.junit.Test * @see org.mockito.Mockito * @see org.springframework.data.gemfire.mapping.Regions * @since 1.3.4 */ +@SuppressWarnings("unchecked") public class RegionsTest { private MappingContext mockMappingContext; @@ -74,7 +75,6 @@ public class RegionsTest { } @Before - @SuppressWarnings("unchecked") public void setup() { mockMappingContext = mock(GemfireMappingContext.class, "GemfireMappingContext"); diff --git a/src/test/java/org/springframework/data/gemfire/repository/query/DefaultGemfireEntityInformationTest.java b/src/test/java/org/springframework/data/gemfire/repository/query/DefaultGemfireEntityInformationTest.java index b4d8f5c7..6f41c48b 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/query/DefaultGemfireEntityInformationTest.java +++ b/src/test/java/org/springframework/data/gemfire/repository/query/DefaultGemfireEntityInformationTest.java @@ -35,7 +35,7 @@ import org.springframework.data.mapping.context.MappingContext; * The DefaultGemfireEntityInformationTest class is a test suite of test cases testing the contract and functionality * of the DefaultGemfireEntityInformation class used to extract entity information during persistence/mapping operations * during data access to the underlying data store (GemFire). - *

+ * * @author John Blum * @see org.junit.Test * @see org.springframework.data.gemfire.repository.query.DefaultGemfireEntityInformation diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/Algorithm.java b/src/test/java/org/springframework/data/gemfire/repository/sample/Algorithm.java index 9f44408c..9726698c 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/Algorithm.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/Algorithm.java @@ -21,7 +21,7 @@ import org.springframework.data.gemfire.mapping.Region; /** * The Algorithm interface define abstract data type modeling a computer algorithm. - *

+ * * @author John Blum * @see org.springframework.data.annotation.Id * @see org.springframework.data.gemfire.mapping.Region diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/AlgorithmRepository.java b/src/test/java/org/springframework/data/gemfire/repository/sample/AlgorithmRepository.java index ff8b2e2c..7a0a3158 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/AlgorithmRepository.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/AlgorithmRepository.java @@ -21,7 +21,7 @@ import org.springframework.data.gemfire.repository.GemfireRepository; /** * The AlgorithmRepository class is a Data Access Object (DAO) for accessing and persistent data/state about Algorithms * to a GemFire Cache/Region. - *

+ * * @author John Blum * @see org.springframework.data.gemfire.repository.GemfireRepository * @since 1.4.0 diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/AlgorithmRepositoryTest.java b/src/test/java/org/springframework/data/gemfire/repository/sample/AlgorithmRepositoryTest.java index e53a5433..079ab464 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/AlgorithmRepositoryTest.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/AlgorithmRepositoryTest.java @@ -35,7 +35,7 @@ import com.gemstone.gemfire.cache.Region; * The AlgorithmRepositoryTest class is a test suite of test cases testing the contract and functionality of GemFire's * Repository extension when using a plain old Java interface for defining the application domain object/entity type, * rather than a Java class, that is the subject of the persistence operations. - *

+ * * @author John Blum * @see org.junit.Test * @see org.junit.runner.RunWith diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/AnimalRepositoryTest.java b/src/test/java/org/springframework/data/gemfire/repository/sample/AnimalRepositoryTest.java index 8346871b..2e169a98 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/AnimalRepositoryTest.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/AnimalRepositoryTest.java @@ -28,13 +28,14 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * The AnimalRepositoryTest class is a test suite of test cases testing the functionality behind PR #55 involving * persisting application domain object/entities to multiple Regions in GemFire's Cache. - *

+ * * @author Stuart Williams * @author John Blum * @see org.junit.Test * @see org.junit.runner.RunWith * @see org.springframework.test.context.ContextConfiguration * @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner + * @since 1.4.0 * @link https://github.com/spring-projects/spring-data-gemfire/pull/55 */ @ContextConfiguration("AnimalRepositoryTest-context.xml") diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/GuestUser.java b/src/test/java/org/springframework/data/gemfire/repository/sample/GuestUser.java index ed7919e8..4fbe1c7e 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/GuestUser.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/GuestUser.java @@ -20,11 +20,11 @@ import org.springframework.data.gemfire.mapping.Region; /** * The GuestUser class represents an authorized restricted user of a service or computer system, etc. - *

+ * * @author John Blum * @see org.springframework.data.gemfire.mapping.Region * @see org.springframework.data.gemfire.repository.sample.User - * @since 1.3.4 + * @since 1.4.0 */ @Region("/Local/Guest/Users") @SuppressWarnings("unused") diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/GuestUserRepository.java b/src/test/java/org/springframework/data/gemfire/repository/sample/GuestUserRepository.java index 0e9120b5..39a0175d 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/GuestUserRepository.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/GuestUserRepository.java @@ -22,11 +22,11 @@ import org.springframework.data.gemfire.repository.GemfireRepository; /** * The GuestUserRepository class is a DAO for accessing and persisting GuestUsers. - *

+ * * @author John Blum * @see org.springframework.data.gemfire.repository.GemfireRepository * @see org.springframework.data.gemfire.repository.sample.GuestUser - * @since 1.3.4 + * @since 1.4.0 */ @SuppressWarnings("unused") public interface GuestUserRepository extends GemfireRepository { diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/IncompatibleRegionKeyEntityIdAnimalRepositoryTest.java b/src/test/java/org/springframework/data/gemfire/repository/sample/IncompatibleRegionKeyEntityIdAnimalRepositoryTest.java index 50890ac7..7d99849f 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/IncompatibleRegionKeyEntityIdAnimalRepositoryTest.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/IncompatibleRegionKeyEntityIdAnimalRepositoryTest.java @@ -30,7 +30,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; /** * The IncompatibleRegionKeyEntityIdAnimalRepositoryTest class is a test suite of test cases testing the functionality * behind PR #55 involving persisting application domain object/entities to multiple Regions in GemFire's Cache. - *

+ * * @author John Blum * @see org.junit.Test * @see org.springframework.context.ConfigurableApplicationContext diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/Plant.java b/src/test/java/org/springframework/data/gemfire/repository/sample/Plant.java index e1c6bfc5..48e26ab5 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/Plant.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/Plant.java @@ -22,7 +22,7 @@ import org.springframework.util.ObjectUtils; /** * The Plant class is a very simple ADT modeling a plant for SDG Repository testing purposes. - *

+ * * @author John Blum * @see org.springframework.data.annotation.Id * @see org.springframework.data.gemfire.mapping.Region diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/PlantRepository.java b/src/test/java/org/springframework/data/gemfire/repository/sample/PlantRepository.java index e11294b1..c29c9d5a 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/PlantRepository.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/PlantRepository.java @@ -22,7 +22,7 @@ import org.springframework.data.gemfire.repository.Query; /** * The PlantRepository class is a Repository extension for accessing and storing Plants. * Note, this Spring GemFire Repository extension incorrectly maps Plants to the Plants Region on purpose - *

+ * * @author John Blum * @see org.springframework.data.gemfire.repository.GemfireRepository * @see org.springframework.data.gemfire.repository.Query diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/PlantRepositoryTest.java b/src/test/java/org/springframework/data/gemfire/repository/sample/PlantRepositoryTest.java index 4ed2ea29..6fd5cf47 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/PlantRepositoryTest.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/PlantRepositoryTest.java @@ -29,7 +29,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; /** * The PlantRepositoryTest class is a test suite of test cases testing the functionality behind PR #55 involving * persisting application domain object/entities to multiple Regions in GemFire's Cache. - *

+ * * @author John Blum * @see org.junit.Test * @see org.springframework.context.ConfigurableApplicationContext diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/Programmer.java b/src/test/java/org/springframework/data/gemfire/repository/sample/Programmer.java index 11e575df..8e669da2 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/Programmer.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/Programmer.java @@ -21,11 +21,11 @@ import org.springframework.util.StringUtils; /** * The Programmer class is a User representing/modeling a software engineer/developer. - *

+ * * @author John J. Blum * @see org.springframework.data.gemfire.mapping.Region * @see org.springframework.data.gemfire.repository.sample.User - * @since 1.3.4 + * @since 1.4.0 */ @Region("Programmers") @SuppressWarnings("unused") diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/ProgrammerRepository.java b/src/test/java/org/springframework/data/gemfire/repository/sample/ProgrammerRepository.java index 9c6ca3b6..d090b3d1 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/ProgrammerRepository.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/ProgrammerRepository.java @@ -23,11 +23,11 @@ import org.springframework.data.gemfire.repository.GemfireRepository; /** * The ProgrammerRepository class is a Data Access Object (DAO) for Programmer domain objects supporting basic CRUD * and Query operations. - *

+ * * @author John Blum * @see org.springframework.data.gemfire.repository.GemfireRepository * @see org.springframework.data.gemfire.repository.sample.Programmer - * @since 1.3.4 + * @since 1.4.0 */ @SuppressWarnings("unused") public interface ProgrammerRepository extends GemfireRepository { diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/RabbitRepository.java b/src/test/java/org/springframework/data/gemfire/repository/sample/RabbitRepository.java index c9b7c79a..36d1b7e1 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/RabbitRepository.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/RabbitRepository.java @@ -23,7 +23,7 @@ import org.springframework.data.gemfire.repository.Query; /** * The RabbitRepository class is a Spring Data GemFire Repository extension for accessing and persistent Rabbits * from/to an underlying data store (GemFire). - *

+ * * @author John Blum * @see org.springframework.data.gemfire.mapping.Region * @see org.springframework.data.gemfire.repository.GemfireRepository diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/RootUser.java b/src/test/java/org/springframework/data/gemfire/repository/sample/RootUser.java index 2cfc253c..b6407e6a 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/RootUser.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/RootUser.java @@ -20,11 +20,11 @@ import org.springframework.data.gemfire.mapping.Region; /** * The RootUser class represents an authorized administrative user of a service or computer system, etc. - *

+ * * @author John Blum * @see org.springframework.data.gemfire.mapping.Region * @see org.springframework.data.gemfire.repository.sample.User - * @since 1.3.4 + * @since 1.4.0 */ @Region("/Local/Admin/Users") @SuppressWarnings("unused") diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/RootUserRepository.java b/src/test/java/org/springframework/data/gemfire/repository/sample/RootUserRepository.java index c2af7845..d8db340e 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/RootUserRepository.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/RootUserRepository.java @@ -22,11 +22,11 @@ import org.springframework.data.gemfire.repository.GemfireRepository; /** * The RootUserRepository class is a DAO for accessing and persisting RootUsers. - *

+ * * @author John Blum * @see org.springframework.data.gemfire.repository.GemfireRepository * @see org.springframework.data.gemfire.repository.sample.RootUser - * @since 1.3.4 + * @since 1.4.0 */ @SuppressWarnings("unused") public interface RootUserRepository extends GemfireRepository { diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/SubRegionRepositoryIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/repository/sample/SubRegionRepositoryIntegrationTest.java index 66972d98..2ffa2267 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/SubRegionRepositoryIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/SubRegionRepositoryIntegrationTest.java @@ -41,7 +41,7 @@ import com.gemstone.gemfire.cache.Region; /** * The SubRegionRepositoryTest class is a test suite of test cases testing the use of GemFire Repositories on GemFire * Cache Subregions. - *

+ * * @author John Blum * @see org.junit.Test * @see org.junit.runner.RunWith @@ -53,7 +53,7 @@ import com.gemstone.gemfire.cache.Region; * @see com.gemstone.gemfire.cache.Region * @link https://jira.springsource.org/browse/SGF-251 * @link https://jira.springsource.org/browse/SGF-252 - * @since 1.0.0 + * @since 1.4.0 */ @ContextConfiguration("subregionRepository.xml") @RunWith(SpringJUnit4ClassRunner.class) diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/User.java b/src/test/java/org/springframework/data/gemfire/repository/sample/User.java index 3cf6c82a..fc6aecc4 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/User.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/User.java @@ -25,12 +25,12 @@ import org.springframework.util.ObjectUtils; /** * The User class represents an authorized user of a service or computer system, etc. - *

+ * * @author John Blum * @see java.lang.Comparable * @see org.springframework.data.annotation.Id * @see org.springframework.data.gemfire.mapping.Region - * @since 1.3.4 + * @since 1.4.0 */ @Region("Users") @SuppressWarnings("unused") diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/UserRepository.java b/src/test/java/org/springframework/data/gemfire/repository/sample/UserRepository.java index 18ab249f..601b40c4 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/UserRepository.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/UserRepository.java @@ -22,12 +22,12 @@ import org.springframework.data.gemfire.repository.GemfireRepository; /** * The UserRepository class is a DAO for accessing and persisting Users. - *

+ * * @author John Blum * @see org.springframework.data.gemfire.repository.GemfireRepository * @see org.springframework.data.gemfire.repository.Query * @see org.springframework.data.gemfire.repository.sample.User - * @since 1.3.4 + * @since 1.4.0 */ @SuppressWarnings("unused") public interface UserRepository extends GemfireRepository { diff --git a/src/test/java/org/springframework/data/gemfire/repository/sample/UserRepositoryQueriesIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/repository/sample/UserRepositoryQueriesIntegrationTest.java index 838f2ff0..be52c90d 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/sample/UserRepositoryQueriesIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/repository/sample/UserRepositoryQueriesIntegrationTest.java @@ -39,14 +39,13 @@ import com.gemstone.gemfire.cache.Region; /** * The RepositoryQueriesTest class is a test suite of test cases testing the GemFire Query capability of Spring Data * GemFire Repositories. - *

+ * * @author John Blum * @see org.junit.Test * @see org.junit.runner.RunWith * @see org.springframework.test.context.ContextConfiguration * @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner - * @since 1.3.3 (Spring Data GemFire) - * @since 7.0.1 (GemFire) + * @since 1.3.3 */ @ContextConfiguration("userRepositoryQueriesIntegrationTest.xml") @RunWith(SpringJUnit4ClassRunner.class) diff --git a/src/test/java/org/springframework/data/gemfire/repository/support/GemfireRepositoryFactoryUnitTests.java b/src/test/java/org/springframework/data/gemfire/repository/support/GemfireRepositoryFactoryUnitTests.java index 92a1b80d..43599a89 100644 --- a/src/test/java/org/springframework/data/gemfire/repository/support/GemfireRepositoryFactoryUnitTests.java +++ b/src/test/java/org/springframework/data/gemfire/repository/support/GemfireRepositoryFactoryUnitTests.java @@ -15,8 +15,8 @@ */ package org.springframework.data.gemfire.repository.support; -import static org.junit.Assert.*; -import static org.mockito.Mockito.*; +import static org.junit.Assert.assertThat; +import static org.mockito.Mockito.when; import java.util.ArrayList; import java.util.List; @@ -26,32 +26,39 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; import org.springframework.data.gemfire.mapping.GemfireMappingContext; import org.springframework.data.gemfire.repository.sample.Person; import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.repository.Repository; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.RegionAttributes; /** * Unit tests for {@link GemfireRepositoryFactory}. - * + * * @author Oliver Gierke + * @author John Blum + * @see org.springframework.data.gemfire.repository.support.GemfireRepositoryFactory */ @RunWith(MockitoJUnitRunner.class) +@SuppressWarnings("unused") public class GemfireRepositoryFactoryUnitTests { @Mock - Region region; + private Region region; @Mock @SuppressWarnings("rawtypes") - RegionAttributes attributes; + private RegionAttributes attributes; /** - * @see SGF-112 + * @link https://jira.spring.io/browse/SGF-112 */ - @Test + @Test(expected = IllegalStateException.class) @SuppressWarnings("unchecked") public void rejectsInterfacesExtendingPagingAndSortingRepository() { @@ -67,12 +74,23 @@ public class GemfireRepositoryFactoryUnitTests { try { factory.getRepository(SampleInterface.class); - } catch (IllegalStateException e) { - assertThat(e.getMessage(), Matchers.startsWith("Pagination is not supported by Gemfire repositories!")); + //factory.getRepository(SamplePagingInterface.class); + //factory.getRepository(SampleSortingInterface.class); + } catch (IllegalStateException expected) { + assertThat(expected.getMessage(), Matchers.startsWith("Pagination is not supported by Gemfire repositories!")); + throw expected; } } interface SampleInterface extends PagingAndSortingRepository { - } + + interface SamplePagingInterface extends Repository { + Page findAll(Pageable pageable); + } + + interface SampleSortingInterface extends Repository { + Iterable findAll(Sort sort); + } + } diff --git a/src/test/java/org/springframework/data/gemfire/support/ClientRegionShortcutWrapperTest.java b/src/test/java/org/springframework/data/gemfire/support/ClientRegionShortcutWrapperTest.java index 17b4a828..ad99cef2 100644 --- a/src/test/java/org/springframework/data/gemfire/support/ClientRegionShortcutWrapperTest.java +++ b/src/test/java/org/springframework/data/gemfire/support/ClientRegionShortcutWrapperTest.java @@ -28,7 +28,7 @@ import com.gemstone.gemfire.cache.client.ClientRegionShortcut; /** * 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 diff --git a/src/test/java/org/springframework/data/gemfire/support/GemfireCacheTest.java b/src/test/java/org/springframework/data/gemfire/support/GemfireCacheTest.java index 01694b3c..5c16999d 100644 --- a/src/test/java/org/springframework/data/gemfire/support/GemfireCacheTest.java +++ b/src/test/java/org/springframework/data/gemfire/support/GemfireCacheTest.java @@ -20,7 +20,6 @@ import java.util.Properties; import org.springframework.cache.Cache; -import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.CacheFactory; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.distributed.DistributedSystem; @@ -36,6 +35,7 @@ public class GemfireCacheTest extends AbstractNativeCacheTest createNativeCache() throws Exception { com.gemstone.gemfire.cache.Cache instance = null; try { @@ -49,9 +49,10 @@ public class GemfireCacheTest extends AbstractNativeCacheTest keys = Arrays.asList(new String[]{"key1","key2"}); + List keys = Arrays.asList("key1", "key2"); Map results = region.getAll(keys); assertEquals("{\"hello1\":\"world1\"}",results.get("key1")); assertEquals("{\"hello2\":\"world2\"}",results.get("key2")); } @Test - public void testObjectToJSon() throws JsonGenerationException, JsonMappingException, IOException { + public void testObjectToJSon() throws IOException { Person dave = new Person(1L,"Dave","Turanski"); region.put("dave",dave); String json = (String)region.get("dave"); diff --git a/src/test/java/org/springframework/data/gemfire/support/RegionShortcutWrapperTest.java b/src/test/java/org/springframework/data/gemfire/support/RegionShortcutWrapperTest.java index dd63db8f..425112ae 100644 --- a/src/test/java/org/springframework/data/gemfire/support/RegionShortcutWrapperTest.java +++ b/src/test/java/org/springframework/data/gemfire/support/RegionShortcutWrapperTest.java @@ -28,7 +28,7 @@ import com.gemstone.gemfire.cache.RegionShortcut; /** * 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 diff --git a/src/test/java/org/springframework/data/gemfire/support/SpringContextBootstrappingInitializerIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/support/SpringContextBootstrappingInitializerIntegrationTest.java index a76cf30e..478cfd26 100644 --- a/src/test/java/org/springframework/data/gemfire/support/SpringContextBootstrappingInitializerIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/support/SpringContextBootstrappingInitializerIntegrationTest.java @@ -54,7 +54,7 @@ import com.gemstone.gemfire.cache.Region; /** * The SpringContextBootstrappingInitializerTest class is a test suite of test cases testing the integrated * functionality of the SpringContextBootstrappingInitializer class. - *

+ * * @author John Blum * @see org.junit.Test * @see org.springframework.context.ConfigurableApplicationContext @@ -64,8 +64,7 @@ import com.gemstone.gemfire.cache.Region; * @see com.gemstone.gemfire.cache.CacheFactory * @see com.gemstone.gemfire.cache.CacheLoader * @see com.gemstone.gemfire.cache.Region - * @since 1.3.4 (Spring Data GemFire) - * @since 7.0.1 (GemFire) + * @since 1.4.0 */ @SuppressWarnings("unused") public class SpringContextBootstrappingInitializerIntegrationTest { diff --git a/src/test/java/org/springframework/data/gemfire/support/SpringContextBootstrappingInitializerTest.java b/src/test/java/org/springframework/data/gemfire/support/SpringContextBootstrappingInitializerTest.java index 77bb843d..88983d53 100644 --- a/src/test/java/org/springframework/data/gemfire/support/SpringContextBootstrappingInitializerTest.java +++ b/src/test/java/org/springframework/data/gemfire/support/SpringContextBootstrappingInitializerTest.java @@ -43,14 +43,14 @@ import org.springframework.util.ObjectUtils; * and functionality of the SpringContextBootstrappingInitializer class. This test class focuses on testing isolated * units of functionality in the Initializer class directly, mocking any dependencies as appropriate, in order for the * class to uphold it's contract. - *

+ * * @author John Blum * @see org.junit.Test * @see org.mockito.Mockito * @see org.springframework.context.ConfigurableApplicationContext * @see org.springframework.data.gemfire.support.SpringContextBootstrappingInitializer * @see org.springframework.data.gemfire.support.SpringContextBootstrappingInitializerIntegrationTest - * @since 1.3.4 + * @since 1.4.0 */ @SuppressWarnings("unused") public class SpringContextBootstrappingInitializerTest { diff --git a/src/test/java/org/springframework/data/gemfire/support/sample/TestUserDao.java b/src/test/java/org/springframework/data/gemfire/support/sample/TestUserDao.java index febdfc51..49205704 100644 --- a/src/test/java/org/springframework/data/gemfire/support/sample/TestUserDao.java +++ b/src/test/java/org/springframework/data/gemfire/support/sample/TestUserDao.java @@ -25,12 +25,12 @@ import org.springframework.util.Assert; /** * The TestUserDao class is an implementation of the UserDao Data Access Object (DAO) interface for performing * data access and persistence operations on Users. - *

+ * * @author John Blum * @see org.springframework.data.gemfire.repository.sample.User * @see org.springframework.data.gemfire.support.sample.UserDao * @see org.springframework.stereotype.Repository - * @since 1.3.4 + * @since 1.4.0 */ @Repository("userDao") @SuppressWarnings("unused") diff --git a/src/test/java/org/springframework/data/gemfire/support/sample/TestUserService.java b/src/test/java/org/springframework/data/gemfire/support/sample/TestUserService.java index 899e39f1..acc85d37 100644 --- a/src/test/java/org/springframework/data/gemfire/support/sample/TestUserService.java +++ b/src/test/java/org/springframework/data/gemfire/support/sample/TestUserService.java @@ -23,12 +23,12 @@ import org.springframework.util.Assert; /** * The TestUserService class is an implementation of the UserService service interface for performing service operations * on Users. - *

+ * * @author John Blum * @see org.springframework.data.gemfire.repository.sample.User * @see org.springframework.data.gemfire.support.sample.UserService * @see org.springframework.stereotype.Service - * @since 1.3.4 + * @since 1.4.0 */ @Service("userService") @SuppressWarnings("unused") diff --git a/src/test/java/org/springframework/data/gemfire/support/sample/UserApplicationConfiguration.java b/src/test/java/org/springframework/data/gemfire/support/sample/UserApplicationConfiguration.java index ccb7945f..6386b75a 100644 --- a/src/test/java/org/springframework/data/gemfire/support/sample/UserApplicationConfiguration.java +++ b/src/test/java/org/springframework/data/gemfire/support/sample/UserApplicationConfiguration.java @@ -24,13 +24,13 @@ import org.springframework.context.annotation.ImportResource; import org.springframework.data.gemfire.support.SpringContextBootstrappingInitializerIntegrationTest; /** - * The UserApplicationConfiguration class is a configuration component for confguring the user's application. - *

+ * The UserApplicationConfiguration class is a configuration component for configuring the user's application. + * * @author John Blum * @see org.springframework.context.annotation.Bean * @see org.springframework.context.annotation.Configuration * @see org.springframework.context.annotation.ImportResource - * @since 1.3.4 + * @since 1.4.0 */ @Configuration @ImportResource({ "classpath:org/springframework/data/gemfire/support/sample/initializer-gemfire-context.xml" }) diff --git a/src/test/java/org/springframework/data/gemfire/support/sample/UserDao.java b/src/test/java/org/springframework/data/gemfire/support/sample/UserDao.java index 8664b58f..8654bac8 100644 --- a/src/test/java/org/springframework/data/gemfire/support/sample/UserDao.java +++ b/src/test/java/org/springframework/data/gemfire/support/sample/UserDao.java @@ -18,10 +18,10 @@ package org.springframework.data.gemfire.support.sample; /** * The UserDao interface is a contract for implementing objects containing data access functionality for Users. - *

+ * * @author John Blum * @see org.springframework.data.gemfire.repository.sample.User - * @since 1.3.4 + * @since 1.4.0 */ public interface UserDao { } diff --git a/src/test/java/org/springframework/data/gemfire/support/sample/UserService.java b/src/test/java/org/springframework/data/gemfire/support/sample/UserService.java index 0a08dcbf..fd578ca0 100644 --- a/src/test/java/org/springframework/data/gemfire/support/sample/UserService.java +++ b/src/test/java/org/springframework/data/gemfire/support/sample/UserService.java @@ -18,10 +18,10 @@ package org.springframework.data.gemfire.support.sample; /** * The UserService interface is a contract for implementing objects to service Users. - *

+ * * @author John Blum * @see org.springframework.data.gemfire.repository.sample.User - * @since 1.3.4 + * @since 1.4.0 */ public interface UserService { } diff --git a/src/test/java/org/springframework/data/gemfire/test/MockRegionFactory.java b/src/test/java/org/springframework/data/gemfire/test/MockRegionFactory.java index 268f45e6..8e14e12c 100644 --- a/src/test/java/org/springframework/data/gemfire/test/MockRegionFactory.java +++ b/src/test/java/org/springframework/data/gemfire/test/MockRegionFactory.java @@ -24,13 +24,11 @@ import java.io.File; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.CacheListener; import com.gemstone.gemfire.cache.CacheLoader; import com.gemstone.gemfire.cache.CacheWriter; import com.gemstone.gemfire.cache.CustomExpiry; import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.DiskWriteAttributes; import com.gemstone.gemfire.cache.EvictionAttributes; import com.gemstone.gemfire.cache.ExpirationAttributes; import com.gemstone.gemfire.cache.MembershipAttributes; @@ -53,7 +51,7 @@ public class MockRegionFactory { private static QueryService queryService = mock(QueryService.class); private static RegionService regionService = mock(RegionService.class); - private AttributesFactory attributesFactory; + private com.gemstone.gemfire.cache.AttributesFactory attributesFactory; private final StubCache cache; @@ -65,10 +63,10 @@ public class MockRegionFactory { return createMockRegionFactory(null); } - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({ "deprecation", "rawtypes", "unchecked" }) public RegionFactory createMockRegionFactory(RegionAttributes attributes) { - attributesFactory = (attributes != null ? new AttributesFactory(attributes) - : new AttributesFactory()); + attributesFactory = (attributes != null ? new com.gemstone.gemfire.cache.AttributesFactory(attributes) + : new com.gemstone.gemfire.cache.AttributesFactory()); //Workaround for GemFire bug if (attributes !=null) { @@ -340,10 +338,12 @@ public class MockRegionFactory { } }); - when(regionFactory.setDiskWriteAttributes(any(DiskWriteAttributes.class))).thenAnswer(new Answer(){ + when(regionFactory.setDiskWriteAttributes(any(com.gemstone.gemfire.cache.DiskWriteAttributes.class))) + .thenAnswer(new Answer(){ @Override public RegionFactory answer(InvocationOnMock invocation) throws Throwable { - DiskWriteAttributes val = (DiskWriteAttributes)invocation.getArguments()[0]; + com.gemstone.gemfire.cache.DiskWriteAttributes val = + (com.gemstone.gemfire.cache.DiskWriteAttributes) invocation.getArguments()[0]; attributesFactory.setDiskWriteAttributes(val); return regionFactory; } @@ -505,8 +505,7 @@ public class MockRegionFactory { when(region.getAttributes()).thenAnswer(new Answer() { @Override public RegionAttributes answer(InvocationOnMock invocation) throws Throwable { - RegionAttributes attributes = attributesFactory.create(); - return attributes; + return attributesFactory.create(); } }); @@ -523,9 +522,7 @@ public class MockRegionFactory { String subRegionPath = (parentRegionName.startsWith("/") ? parentRegionName+"/"+subRegionName : "/"+parentRegionName+"/"+subRegionName); - Region region = cache.getRegion(subRegionPath); - - return region; + return cache.getRegion(subRegionPath); } }); diff --git a/src/test/java/org/springframework/data/gemfire/test/StubCache.java b/src/test/java/org/springframework/data/gemfire/test/StubCache.java index caab17ed..a5570565 100644 --- a/src/test/java/org/springframework/data/gemfire/test/StubCache.java +++ b/src/test/java/org/springframework/data/gemfire/test/StubCache.java @@ -1,6 +1,10 @@ package org.springframework.data.gemfire.test; -import static org.mockito.Mockito.*; - + +import static org.mockito.Mockito.anyInt; +import static org.mockito.Mockito.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; @@ -10,7 +14,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import java.util.Set; - import javax.naming.Context; import org.mockito.invocation.InvocationOnMock; @@ -38,12 +41,10 @@ import com.gemstone.gemfire.cache.query.Index; import com.gemstone.gemfire.cache.query.IndexExistsException; import com.gemstone.gemfire.cache.query.IndexInvalidException; import com.gemstone.gemfire.cache.query.IndexNameConflictException; -import com.gemstone.gemfire.cache.query.IndexType; import com.gemstone.gemfire.cache.query.QueryService; import com.gemstone.gemfire.cache.query.RegionNotFoundException; import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.cache.snapshot.CacheSnapshotService; -import com.gemstone.gemfire.cache.util.BridgeServer; import com.gemstone.gemfire.cache.util.Gateway; import com.gemstone.gemfire.cache.util.GatewayConflictResolver; import com.gemstone.gemfire.cache.util.GatewayHub; @@ -58,6 +59,8 @@ import com.gemstone.gemfire.i18n.LogWriterI18n; import com.gemstone.gemfire.pdx.PdxInstance; import com.gemstone.gemfire.pdx.PdxInstanceFactory; import com.gemstone.gemfire.pdx.PdxSerializer; + +@SuppressWarnings("deprecation") public class StubCache implements Cache { private Properties properties; @@ -390,7 +393,7 @@ public class StubCache implements Cache { */ @Override @Deprecated - public BridgeServer addBridgeServer() { + public com.gemstone.gemfire.cache.util.BridgeServer addBridgeServer() { throw new UnsupportedOperationException(); } @@ -462,8 +465,7 @@ public class StubCache implements Cache { @SuppressWarnings("unchecked") @Override public RegionFactory createRegionFactory() { - RegionFactory regionFactory = new MockRegionFactory(this).createRegionFactory(); - return regionFactory; + return new MockRegionFactory(this).createRegionFactory(); } /* (non-Javadoc) @@ -472,8 +474,7 @@ public class StubCache implements Cache { @SuppressWarnings("unchecked") @Override public RegionFactory createRegionFactory(RegionShortcut shortCut) { - RegionFactory regionFactory = new MockRegionFactory(this).createRegionFactory(); - return regionFactory; + return new MockRegionFactory(this).createRegionFactory(); } /* (non-Javadoc) @@ -482,8 +483,7 @@ public class StubCache implements Cache { @SuppressWarnings("unchecked") @Override public RegionFactory createRegionFactory(String arg0) { - RegionFactory regionFactory = new MockRegionFactory(this).createRegionFactory(); - return regionFactory; + return new MockRegionFactory(this).createRegionFactory(); } /* (non-Javadoc) @@ -491,8 +491,7 @@ public class StubCache implements Cache { */ @Override public RegionFactory createRegionFactory(RegionAttributes regionAttributes) { - RegionFactory regionFactory = new MockRegionFactory(this).createMockRegionFactory(regionAttributes); - return regionFactory; + return new MockRegionFactory(this).createMockRegionFactory(regionAttributes); } /* (non-Javadoc) @@ -754,9 +753,6 @@ public class StubCache implements Cache { this.searchTimeout = arg0; } - /** - * @return - */ DistributedSystem mockDistributedSystem() { DistributedSystem ds = mock(DistributedSystem.class); DistributedMember dm = mockDistributedMember(); @@ -777,10 +773,7 @@ public class StubCache implements Cache { return dm; } - /** - * @return - */ - CacheServer mockCacheServer() { + CacheServer mockCacheServer() { return new StubCacheServer(); } @@ -814,7 +807,7 @@ public class StubCache implements Cache { String indexName = (String)invocation.getArguments()[0]; String indexedExpression = (String)invocation.getArguments()[1]; String fromClause = (String)invocation.getArguments()[2]; - return mockIndex(indexName, IndexType.FUNCTIONAL, indexedExpression, fromClause, null); + return mockIndex(indexName, com.gemstone.gemfire.cache.query.IndexType.FUNCTIONAL, indexedExpression, fromClause, null); } }); when(qs.createIndex(anyString(), anyString(),anyString(),anyString())).thenAnswer(new Answer(){ @@ -824,7 +817,7 @@ public class StubCache implements Cache { String indexedExpression = (String)invocation.getArguments()[1]; String fromClause = (String)invocation.getArguments()[2]; String imports = (String)invocation.getArguments()[3]; - return mockIndex(indexName, IndexType.FUNCTIONAL, indexedExpression, fromClause, imports); + return mockIndex(indexName, com.gemstone.gemfire.cache.query.IndexType.FUNCTIONAL, indexedExpression, fromClause, imports); } }); @@ -835,7 +828,7 @@ public class StubCache implements Cache { String indexedExpression = (String)invocation.getArguments()[1]; String fromClause = (String)invocation.getArguments()[2]; - return mockIndex(indexName, IndexType.PRIMARY_KEY, indexedExpression, fromClause, null); + return mockIndex(indexName, com.gemstone.gemfire.cache.query.IndexType.PRIMARY_KEY, indexedExpression, fromClause, null); } }); @@ -846,7 +839,7 @@ public class StubCache implements Cache { String indexedExpression = (String)invocation.getArguments()[1]; String fromClause = (String)invocation.getArguments()[2]; - return mockIndex(indexName, IndexType.HASH, indexedExpression, fromClause, null); + return mockIndex(indexName, com.gemstone.gemfire.cache.query.IndexType.HASH, indexedExpression, fromClause, null); } }); @@ -858,15 +851,16 @@ public class StubCache implements Cache { String fromClause = (String)invocation.getArguments()[2]; String imports = (String)invocation.getArguments()[3]; - return mockIndex(indexName, IndexType.HASH, indexedExpression, fromClause, imports); + return mockIndex(indexName, com.gemstone.gemfire.cache.query.IndexType.HASH, indexedExpression, fromClause, imports); } }); return qs; } - @SuppressWarnings({ "rawtypes", "unchecked" }) - Index mockIndex(String indexName, IndexType indexType,String indexedExpression, String fromClause, String imports){ + @SuppressWarnings({ "rawtypes", "unchecked", "unused" }) + Index mockIndex(String indexName, com.gemstone.gemfire.cache.query.IndexType indexType, String indexedExpression, + String fromClause, String imports){ Index idx = mock(Index.class); when(idx.getFromClause()).thenReturn(fromClause); when(idx.getIndexedExpression()).thenReturn(indexedExpression); @@ -888,18 +882,8 @@ public class StubCache implements Cache { return this.allRegions; } - GatewaySender mockGatewaySender(String id, int remoteId) { - GatewaySender gwSender = mock(GatewaySender.class); - when(gwSender.getId()).thenReturn(id); - when(gwSender.getRemoteDSId()).thenReturn(remoteId); - return gwSender; - } - - /** - * @param props - */ public void setProperties(Properties props) { this.properties = props; } -} \ No newline at end of file +} diff --git a/src/test/java/org/springframework/data/gemfire/test/StubCacheServer.java b/src/test/java/org/springframework/data/gemfire/test/StubCacheServer.java index 2d4039bc..14688f4e 100644 --- a/src/test/java/org/springframework/data/gemfire/test/StubCacheServer.java +++ b/src/test/java/org/springframework/data/gemfire/test/StubCacheServer.java @@ -26,6 +26,7 @@ import com.gemstone.gemfire.distributed.DistributedMember; * @author David Turanski * @author John Blum */ +@SuppressWarnings("deprecation") public class StubCacheServer implements CacheServer { private boolean isRunning; diff --git a/src/test/java/org/springframework/data/gemfire/test/StubGatewaySenderFactory.java b/src/test/java/org/springframework/data/gemfire/test/StubGatewaySenderFactory.java index 9d542c55..060ead1a 100644 --- a/src/test/java/org/springframework/data/gemfire/test/StubGatewaySenderFactory.java +++ b/src/test/java/org/springframework/data/gemfire/test/StubGatewaySenderFactory.java @@ -12,7 +12,6 @@ */ package org.springframework.data.gemfire.test; -import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -20,19 +19,20 @@ import static org.mockito.Mockito.when; import java.util.ArrayList; import java.util.List; -import com.gemstone.gemfire.cache.Region; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + import com.gemstone.gemfire.cache.util.Gateway.OrderPolicy; import com.gemstone.gemfire.cache.wan.GatewayEventFilter; import com.gemstone.gemfire.cache.wan.GatewaySender; import com.gemstone.gemfire.cache.wan.GatewaySenderFactory; import com.gemstone.gemfire.cache.wan.GatewayTransportFilter; -import com.sun.org.apache.xpath.internal.operations.Bool; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; /** - * @author David Turanski + * The StubGatewaySenderFactory class for testing purposes. * + * @author David Turanski + * @see com.gemstone.gemfire.cache.wan.GatewaySenderFactory */ public class StubGatewaySenderFactory implements GatewaySenderFactory { @@ -210,4 +210,5 @@ public class StubGatewaySenderFactory implements GatewaySenderFactory { // TODO Auto-generated method stub return null; } + } diff --git a/src/test/java/org/springframework/data/gemfire/test/support/DataSourceAdapter.java b/src/test/java/org/springframework/data/gemfire/test/support/DataSourceAdapter.java index 132302cb..a126ec39 100644 --- a/src/test/java/org/springframework/data/gemfire/test/support/DataSourceAdapter.java +++ b/src/test/java/org/springframework/data/gemfire/test/support/DataSourceAdapter.java @@ -19,12 +19,15 @@ package org.springframework.data.gemfire.test.support; import java.io.PrintWriter; import java.sql.Connection; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; +import java.util.logging.Logger; import javax.sql.DataSource; /** * The DataSourceAdapter class is an implementation of the DataSource interface with unsupported operations by default. - *

+ * * @author John Blum + * @see java.sql.Connection * @see javax.sql.DataSource * @since 1.3.4 */ @@ -63,6 +66,11 @@ public abstract class DataSourceAdapter implements DataSource { throw new UnsupportedOperationException(UNSUPPORTED_OPERATION_EXCEPTION_MESSAGE); } + //@Override + public Logger getParentLogger() throws SQLFeatureNotSupportedException { + throw new UnsupportedOperationException(UNSUPPORTED_OPERATION_EXCEPTION_MESSAGE); + } + @Override public boolean isWrapperFor(final Class iface) throws SQLException { throw new UnsupportedOperationException(UNSUPPORTED_OPERATION_EXCEPTION_MESSAGE); diff --git a/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueFactoryBeanTest.java b/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueFactoryBeanTest.java index c271616d..31ca7247 100644 --- a/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueFactoryBeanTest.java +++ b/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueFactoryBeanTest.java @@ -39,7 +39,7 @@ import com.gemstone.gemfire.cache.util.Gateway; /** * The AsyncEventQueueFactoryBeanTest class is a test suite of test cases testing the contract and functionality * of the AsyncEventQueueFactoryBean class. - *

+ * * @author John Blum * @see org.junit.Test * @see org.mockito.Mockito diff --git a/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueWithListenerIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueWithListenerIntegrationTest.java index bb207f71..2772a7dd 100644 --- a/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueWithListenerIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueWithListenerIntegrationTest.java @@ -41,7 +41,7 @@ import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue; * The AsyncEvenntQueueWithListenerTest class is a test suite of test cases testing the circular references between * an Async Event Queue and a registered AsyncEventListener that refers back to the Async Event Queue on which the * listener registered. - *

+ * * @author John Blum * @see org.junit.Test * @see org.junit.runner.RunWith @@ -103,7 +103,7 @@ public class AsyncEventQueueWithListenerIntegrationTest { /** * The QueueAsyncEventListener class is an implementation of the AsyncEventListener interface that contains * a reference to the AsyncEventQueue upon which it is registered. - *

+ * * @see com.gemstone.gemfire.cache.asyncqueue.AsyncEvent * @see com.gemstone.gemfire.cache.asyncqueue.AsyncEventListener * @see com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue diff --git a/src/test/java/org/springframework/data/gemfire/wan/GatewaySenderFactoryBeanTest.java b/src/test/java/org/springframework/data/gemfire/wan/GatewaySenderFactoryBeanTest.java index d0c1cb29..779f9618 100644 --- a/src/test/java/org/springframework/data/gemfire/wan/GatewaySenderFactoryBeanTest.java +++ b/src/test/java/org/springframework/data/gemfire/wan/GatewaySenderFactoryBeanTest.java @@ -35,7 +35,7 @@ import com.gemstone.gemfire.cache.wan.GatewaySenderFactory; /** * The GatewaySenderFactoryBeanTest class is a test suite of test cases testing the contract and functionality of the * GatewaySenderFactoryBean class. - *

+ * * @author John Blum * @see com.gemstone.gemfire.cache.Cache * @see com.gemstone.gemfire.cache.wan.GatewaySender