listeners) {
+ this.listeners = listeners;
+ }
+
+ public void setCache(Cache cache) {
+ this.cache = cache;
+ }
+
+ /**
+ * @param evictionPolicy the evictionPolicy to set
+ */
+ public void setSubscriptionEvictionPolicy(SubscriptionEvictionPolicy evictionPolicy) {
+ this.evictionPolicy = evictionPolicy;
+ }
+
+ /**
+ * @param subscriptionCapacity the subscriptionCapacity to set
+ */
+ public void setSubscriptionCapacity(int subscriptionCapacity) {
+ this.subscriptionCapacity = subscriptionCapacity;
+ }
+
+ public void setSubscriptionDiskStore(Resource resource) {
+ this.subscriptionDiskStore = resource;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/springframework/data/gemfire/server/SubscriptionEvictionPolicy.java b/src/main/java/org/springframework/data/gemfire/server/SubscriptionEvictionPolicy.java
new file mode 100644
index 00000000..d7c1efda
--- /dev/null
+++ b/src/main/java/org/springframework/data/gemfire/server/SubscriptionEvictionPolicy.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2011 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.data.gemfire.server;
+
+import com.gemstone.gemfire.cache.server.CacheServer;
+
+/**
+ * Enumeration of the various client subscription policies for {@link CacheServer}.
+ *
+ * @author Costin Leau
+ */
+public enum SubscriptionEvictionPolicy {
+ NONE, MEM, ENTRY
+}
diff --git a/src/main/java/org/springframework/data/gemfire/server/package-info.java b/src/main/java/org/springframework/data/gemfire/server/package-info.java
new file mode 100644
index 00000000..457f4f8a
--- /dev/null
+++ b/src/main/java/org/springframework/data/gemfire/server/package-info.java
@@ -0,0 +1,5 @@
+/**
+ * Support package for GemFire {@link com.gemstone.gemfire.cache.server.CacheServer}.
+ *
+ */
+package org.springframework.data.gemfire.server;
\ No newline at end of file
diff --git a/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java b/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java
new file mode 100644
index 00000000..97a652d3
--- /dev/null
+++ b/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2011 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.data.gemfire.support;
+
+import org.springframework.dao.support.DaoSupport;
+import org.springframework.data.gemfire.GemfireTemplate;
+import org.springframework.util.Assert;
+
+import com.gemstone.gemfire.cache.Region;
+
+/**
+ * Convenient super class for GemFire data access objects. Intended for
+ * GemfireTemplate usage.
+ *
+ * Requires a Region to be set, providing a GemfireTemplate based on it to subclasses.
+ * Can alternatively be initialized directly via a GemfireTemplate, to reuse the latter's
+ * settings.
+ *
+ *
This class will create its own GemfireTemplate if an Region reference is passed in.
+ * A custom GemfireTemplate instance can be used through overriding createGemfireTemplate.
+ *
+ * @author Costin Leau
+ */
+public class GemfireDaoSupport extends DaoSupport {
+
+ private GemfireTemplate gemfireTemplate;
+
+ /**
+ * Sets the GemFire Region to be used by this DAO.
+ * Will automatically create a GemfireTemplate for the given Region.
+ *
+ * @param region
+ */
+ public void setRegion(Region, ?> region) {
+ this.gemfireTemplate = createGemfireTemplate(region);
+ }
+
+ /**
+ * Creates a GemfireTemplate for the given Region.
+ *
Can be overridden in subclasses to provide a GemfireTemplate instance
+ * with different configuration, or a custom GemfireTemplate subclass.
+ * @param region the GemFire Region to create a GemfireTemplate for
+ * @return the new GemfireTemplate instance
+ * @see #setRegion
+ */
+ protected GemfireTemplate createGemfireTemplate(Region, ?> region) {
+ return new GemfireTemplate(region);
+ }
+
+ /**
+ * Set the GemfireTemplate for this DAO explicitly,
+ * as an alternative to specifying a GemFire {@link Region}.
+ * @see #setRegion
+ */
+ public final void setGemfireTemplate(GemfireTemplate gemfireTemplate) {
+ this.gemfireTemplate = gemfireTemplate;
+ }
+
+ /**
+ * Return the GemfireTemplate for this DAO, pre-initialized
+ * with the Region or set explicitly.
+ */
+ public final GemfireTemplate getGemfireTemplate() {
+ return gemfireTemplate;
+ }
+
+ @Override
+ protected final void checkDaoConfig() {
+ Assert.notNull(gemfireTemplate, "region or gemfireTemplate is required");
+ }
+}
\ No newline at end of file
diff --git a/src/main/resources/META-INF/spring.schemas b/src/main/resources/META-INF/spring.schemas
index 25b420e3..2bb1ca58 100644
--- a/src/main/resources/META-INF/spring.schemas
+++ b/src/main/resources/META-INF/spring.schemas
@@ -1,2 +1,3 @@
http\://www.springframework.org/schema/gemfire/spring-gemfire-1.0.xsd=org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd
-http\://www.springframework.org/schema/gemfire/spring-gemfire.xsd=org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd
\ No newline at end of file
+http\://www.springframework.org/schema/gemfire/spring-gemfire-1.1.xsd=org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd
+http\://www.springframework.org/schema/gemfire/spring-gemfire.xsd=org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd
\ No newline at end of file
diff --git a/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd
index 9a92af95..2a69a302 100644
--- a/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd
+++ b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd
@@ -6,7 +6,7 @@
targetNamespace="http://www.springframework.org/schema/gemfire"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
- version="1.0">
+ version="1.0.1">
@@ -74,7 +74,7 @@ The name of the bean defining the GemFire cache (by default 'gemfire-cache').
]]>
-
+
-
+
-
+
-
+
+
+
+
+
+
@@ -396,7 +404,7 @@ The name of the partitioned region with which this newly created partitioned reg
]]>
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-->
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd
new file mode 100644
index 00000000..eb43844f
--- /dev/null
+++ b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd
@@ -0,0 +1,915 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ namespace and its 'properties' element.
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java
index 14441d78..f01ada81 100644
--- a/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java
+++ b/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -61,4 +61,5 @@ public class CacheIntegrationTest extends RecreatingContextTest{
public void testCacheWithXml() throws Exception {
Cache cache = ctx.getBean("cache-with-xml", Cache.class);
}
-}
+
+}
\ No newline at end of file
diff --git a/src/test/java/org/springframework/data/gemfire/DeclarableSupportTest.java b/src/test/java/org/springframework/data/gemfire/DeclarableSupportTest.java
index 9eaba86d..618932e7 100644
--- a/src/test/java/org/springframework/data/gemfire/DeclarableSupportTest.java
+++ b/src/test/java/org/springframework/data/gemfire/DeclarableSupportTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/GemfireBeanFactoryLocatorTest.java b/src/test/java/org/springframework/data/gemfire/GemfireBeanFactoryLocatorTest.java
index ae02e198..9e319e07 100644
--- a/src/test/java/org/springframework/data/gemfire/GemfireBeanFactoryLocatorTest.java
+++ b/src/test/java/org/springframework/data/gemfire/GemfireBeanFactoryLocatorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/RecreatingContextTest.java b/src/test/java/org/springframework/data/gemfire/RecreatingContextTest.java
index c578a925..f2282dc1 100644
--- a/src/test/java/org/springframework/data/gemfire/RecreatingContextTest.java
+++ b/src/test/java/org/springframework/data/gemfire/RecreatingContextTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/SimpleCacheListener.java b/src/test/java/org/springframework/data/gemfire/SimpleCacheListener.java
index 3a90bc04..76e6220d 100644
--- a/src/test/java/org/springframework/data/gemfire/SimpleCacheListener.java
+++ b/src/test/java/org/springframework/data/gemfire/SimpleCacheListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/SimpleCacheLoader.java b/src/test/java/org/springframework/data/gemfire/SimpleCacheLoader.java
index 2dfb5634..40df9573 100644
--- a/src/test/java/org/springframework/data/gemfire/SimpleCacheLoader.java
+++ b/src/test/java/org/springframework/data/gemfire/SimpleCacheLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/SimpleCacheWriter.java b/src/test/java/org/springframework/data/gemfire/SimpleCacheWriter.java
index 4b3ae8e5..486af831 100644
--- a/src/test/java/org/springframework/data/gemfire/SimpleCacheWriter.java
+++ b/src/test/java/org/springframework/data/gemfire/SimpleCacheWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java b/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java
index 6f8b97d7..d8c140e4 100644
--- a/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java
+++ b/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/SimplePartitionResolver.java b/src/test/java/org/springframework/data/gemfire/SimplePartitionResolver.java
index 740dc209..cf46a0c3 100644
--- a/src/test/java/org/springframework/data/gemfire/SimplePartitionResolver.java
+++ b/src/test/java/org/springframework/data/gemfire/SimplePartitionResolver.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/TestUtils.java b/src/test/java/org/springframework/data/gemfire/TestUtils.java
index 1eced00e..39e615b9 100644
--- a/src/test/java/org/springframework/data/gemfire/TestUtils.java
+++ b/src/test/java/org/springframework/data/gemfire/TestUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/TxIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/TxIntegrationTest.java
index 21385ef4..755eeae0 100644
--- a/src/test/java/org/springframework/data/gemfire/TxIntegrationTest.java
+++ b/src/test/java/org/springframework/data/gemfire/TxIntegrationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/UserObject.java b/src/test/java/org/springframework/data/gemfire/UserObject.java
index 46f50246..59311c60 100644
--- a/src/test/java/org/springframework/data/gemfire/UserObject.java
+++ b/src/test/java/org/springframework/data/gemfire/UserObject.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/client/RegionIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/client/RegionIntegrationTest.java
index 7ef7921f..3c56e761 100644
--- a/src/test/java/org/springframework/data/gemfire/client/RegionIntegrationTest.java
+++ b/src/test/java/org/springframework/data/gemfire/client/RegionIntegrationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java
index 08768d69..16287627 100644
--- a/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,12 +17,14 @@
package org.springframework.data.gemfire.config;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.springframework.core.io.Resource;
import org.springframework.data.gemfire.CacheFactoryBean;
+import org.springframework.data.gemfire.GemfireBeanFactoryLocator;
import org.springframework.data.gemfire.RecreatingContextTest;
import org.springframework.data.gemfire.TestUtils;
@@ -61,4 +63,17 @@ public class CacheNamespaceTest extends RecreatingContextTest {
assertEquals(ctx.getBean("props"), TestUtils.readField("properties", cfb));
}
+ @Test(expected = IllegalArgumentException.class)
+ public void testNoBeanFactory() throws Exception {
+ assertTrue(ctx.containsBean("no-bl"));
+ CacheFactoryBean cfb = (CacheFactoryBean) ctx.getBean("&no-bl");
+ GemfireBeanFactoryLocator locator = new GemfireBeanFactoryLocator();
+ try {
+ assertNotNull(locator.useBeanFactory("cache-with-name"));
+ locator.useBeanFactory("no-bl");
+ } finally {
+ locator.destroy();
+ }
+ }
+
}
\ No newline at end of file
diff --git a/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java
new file mode 100644
index 00000000..1148c3d0
--- /dev/null
+++ b/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2011 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.data.gemfire.config;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.springframework.data.gemfire.RecreatingContextTest;
+
+import com.gemstone.gemfire.cache.server.CacheServer;
+
+/**
+ *
+ * @author Costin Leau
+ */
+public class CacheServerNamespaceTest extends RecreatingContextTest {
+
+ @Override
+ protected String location() {
+ return "org/springframework/data/gemfire/config/server-ns.xml";
+ }
+
+ @Test
+ public void testBasicCacheServer() throws Exception {
+ CacheServer cacheServer = ctx.getBean("advanced-config", CacheServer.class);
+ assertTrue(cacheServer.isRunning());
+ assertEquals(1, cacheServer.getGroups().length);
+ assertEquals("test-server", cacheServer.getGroups()[0]);
+ assertEquals(22, cacheServer.getMaxConnections());
+
+ }
+}
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 307c3fd6..2b8ca351 100644
--- a/src/test/java/org/springframework/data/gemfire/config/ClientRegionNamespaceTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/ClientRegionNamespaceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/config/DiskStoreAndEvictionRegionParsingTest.java b/src/test/java/org/springframework/data/gemfire/config/DiskStoreAndEvictionRegionParsingTest.java
index 4700a40b..6f9b2b72 100644
--- a/src/test/java/org/springframework/data/gemfire/config/DiskStoreAndEvictionRegionParsingTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/DiskStoreAndEvictionRegionParsingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java
index d8059894..15b6624b 100644
--- a/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -61,6 +61,8 @@ public class PartitionedRegionNamespaceTest {
assertEquals("redundant", TestUtils.readField("name", fb));
RegionAttributes attrs = TestUtils.readField("attributes", fb);
+ assertTrue(attrs.getStatisticsEnabled());
+
PartitionAttributes pAttr = attrs.getPartitionAttributes();
assertEquals(1, pAttr.getRedundantCopies());
diff --git a/src/test/java/org/springframework/data/gemfire/config/PoolNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/PoolNamespaceTest.java
index 64d53739..e042b488 100644
--- a/src/test/java/org/springframework/data/gemfire/config/PoolNamespaceTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/PoolNamespaceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
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 c8aa6794..56eaf569 100644
--- a/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/config/TxManagerNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/TxManagerNamespaceTest.java
index 8e752f4f..f6d1e4a6 100644
--- a/src/test/java/org/springframework/data/gemfire/config/TxManagerNamespaceTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/TxManagerNamespaceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/serialization/AsmInstantiatorFactoryTest.java b/src/test/java/org/springframework/data/gemfire/serialization/AsmInstantiatorFactoryTest.java
index d0693e84..aac59925 100644
--- a/src/test/java/org/springframework/data/gemfire/serialization/AsmInstantiatorFactoryTest.java
+++ b/src/test/java/org/springframework/data/gemfire/serialization/AsmInstantiatorFactoryTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/serialization/WiringInstantiatorTest.java b/src/test/java/org/springframework/data/gemfire/serialization/WiringInstantiatorTest.java
index 36008fa2..8d09482c 100644
--- a/src/test/java/org/springframework/data/gemfire/serialization/WiringInstantiatorTest.java
+++ b/src/test/java/org/springframework/data/gemfire/serialization/WiringInstantiatorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 the original author or authors.
+ * Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/test/java/org/springframework/data/gemfire/support/GemfireDaoSupportTests.java b/src/test/java/org/springframework/data/gemfire/support/GemfireDaoSupportTests.java
new file mode 100644
index 00000000..5b369dda
--- /dev/null
+++ b/src/test/java/org/springframework/data/gemfire/support/GemfireDaoSupportTests.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2011 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.data.gemfire.support;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.springframework.data.gemfire.GemfireTemplate;
+
+/**
+ * @author Costin Leau
+ *
+ */
+public class GemfireDaoSupportTests extends TestCase {
+
+ public void testGemfireDaoSupportWithTemplate() throws Exception {
+ GemfireTemplate template = new GemfireTemplate();
+ final List test = new ArrayList();
+ GemfireDaoSupport dao = new GemfireDaoSupport() {
+ protected void initDao() {
+ test.add("test");
+ }
+ };
+ dao.setGemfireTemplate(template);
+ dao.afterPropertiesSet();
+ assertNotNull("template not created", dao.getGemfireTemplate());
+ assertEquals("incorrect template", template, dao.getGemfireTemplate());
+ assertEquals("initDao not called", test.size(), 1);
+ }
+
+ public void testInvalidDaoTemplate() throws Exception {
+ GemfireDaoSupport dao = new GemfireDaoSupport() {
+ };
+ try {
+ dao.afterPropertiesSet();
+ fail("expected exception");
+ } catch (IllegalArgumentException iae) {
+ // okay
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/test/resources/org/springframework/data/gemfire/basic-cache.xml b/src/test/resources/org/springframework/data/gemfire/basic-cache.xml
index dad99470..b25bd4f5 100644
--- a/src/test/resources/org/springframework/data/gemfire/basic-cache.xml
+++ b/src/test/resources/org/springframework/data/gemfire/basic-cache.xml
@@ -35,5 +35,8 @@
+
+
+
diff --git a/src/test/resources/org/springframework/data/gemfire/config/cache-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/cache-ns.xml
index c3e03f48..e80adb57 100644
--- a/src/test/resources/org/springframework/data/gemfire/config/cache-ns.xml
+++ b/src/test/resources/org/springframework/data/gemfire/config/cache-ns.xml
@@ -21,4 +21,6 @@
false
+
+
\ No newline at end of file
diff --git a/src/test/resources/org/springframework/data/gemfire/config/partitioned-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/partitioned-ns.xml
index 67a251f4..c2a2a803 100644
--- a/src/test/resources/org/springframework/data/gemfire/config/partitioned-ns.xml
+++ b/src/test/resources/org/springframework/data/gemfire/config/partitioned-ns.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/src/test/resources/org/springframework/data/gemfire/config/server-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/server-ns.xml
new file mode 100644
index 00000000..a03427d6
--- /dev/null
+++ b/src/test/resources/org/springframework/data/gemfire/config/server-ns.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/test/resources/port.properties b/src/test/resources/port.properties
index 66e8f405..00ec631d 100644
--- a/src/test/resources/port.properties
+++ b/src/test/resources/port.properties
@@ -1,2 +1,3 @@
gfe.port=40403
-gfe.port.4=40404
\ No newline at end of file
+gfe.port.4=40404
+gfe.port.6=40406
\ No newline at end of file