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

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

View File

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

View File

@@ -1,99 +0,0 @@
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.gemfire;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import org.junit.Test;
import com.gemstone.gemfire.cache.GemFireCache;
import com.gemstone.gemfire.cache.Region;
/**
*
* @author David Turanski
* @author John Blum
*/
public class SubRegionTest extends RecreatingContextTest {
@Override
protected String location() {
return "org/springframework/data/gemfire/basic-subregion.xml";
}
@Test
public void testAll() throws Exception {
testBasic();
testContext();
testChildOnly();
}
@SuppressWarnings({ "rawtypes", "unchecked" })
private void testBasic() throws Exception {
CacheFactoryBean cacheFactoryBean = new CacheFactoryBean();
cacheFactoryBean.setBeanName("gemfireCache");
cacheFactoryBean.setUseBeanFactoryLocator(false);
cacheFactoryBean.afterPropertiesSet();
GemFireCache cache = cacheFactoryBean.getObject();
assertNotNull(cache);
RegionFactoryBean regionFactory = new ReplicatedRegionFactoryBean();
regionFactory.setCache(cache);
regionFactory.setName("Outer");
regionFactory.afterPropertiesSet();
Region outer = regionFactory.getObject();
assertNotNull(outer);
assertEquals("Outer", outer.getName());
assertEquals("/Outer", outer.getFullPath());
assertSame(outer, cache.getRegion("/Outer"));
RegionFactoryBean subRegionFactory = new RegionFactoryBean() { };
subRegionFactory.setCache(cache);
subRegionFactory.setParent(outer);
subRegionFactory.setName("/Outer/Inner");
subRegionFactory.setRegionName("Inner");
subRegionFactory.afterPropertiesSet();
Region inner = subRegionFactory.getObject();
assertNotNull(inner);
assertSame(inner, outer.getSubregion("Inner"));
assertSame(inner, cache.getRegion("/Outer/Inner"));
}
@SuppressWarnings("rawtypes")
private void testContext() throws Exception {
Region parent = ctx.getBean("parent", Region.class);
Region child = ctx.getBean("/parent/child", Region.class);
assertNotNull(parent.getSubregion("child"));
assertSame(child, parent.getSubregion("child"));
assertEquals("/parent/child", child.getFullPath());
}
@SuppressWarnings("rawtypes")
public void testChildOnly() throws Exception {
Region child = ctx.getBean("/parent/child", Region.class);
assertEquals("/parent/child", child.getFullPath());
}
}

View File

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

View File

@@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.springframework.data.gemfire.support;
package org.springframework.data.gemfire.cache;
import static org.junit.Assert.assertNotNull;
@@ -25,10 +25,10 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
* @author John Blum
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/org/springframework/data/gemfire/support/cache-manager-client-cache.xml")
@ContextConfiguration("/org/springframework/data/gemfire/cache/cache-manager-client-cache.xml")
public class ClientCacheManagerTest {
@Autowired
@Autowired
GemfireCacheManager cacheManager;
@Test

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2002-2013 the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
@@ -18,6 +18,11 @@ import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import java.util.List;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.Pool;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -31,11 +36,6 @@ import org.springframework.data.gemfire.repository.sample.PersonRepository;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.Pool;
/**
* @author David Turanski
*

View File

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

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2002-2013 the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
@@ -14,6 +14,9 @@ package org.springframework.data.gemfire.client;
import static org.junit.Assert.assertEquals;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.Region;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -25,9 +28,6 @@ import org.springframework.data.gemfire.fork.SpringCacheServerProcess;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.Region;
/**
* @author David Turanski
*
@@ -35,26 +35,26 @@ import com.gemstone.gemfire.cache.Region;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/org/springframework/data/gemfire/client/datasource-client-with-regions.xml")
public class GemFireDataSourceWithLocalRegionTest {
@Autowired
@Autowired
ApplicationContext ctx;
@BeforeClass
public static void startUp() throws Exception {
ForkUtil.startCacheServer(SpringCacheServerProcess.class.getName() + " "
ForkUtil.startCacheServer(SpringCacheServerProcess.class.getName() + " "
+ "/org/springframework/data/gemfire/client/datasource-server.xml");
}
@Test
public void testRegionDefinitionNotOverridden() {
Region<?,?> simple = ctx.getBean("simple",Region.class);
assertEquals(DataPolicy.NORMAL,
simple.getAttributes().getDataPolicy());
}
@AfterClass
public static void cleanUp() {
ForkUtil.sendSignal();

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2002-2013 the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
@@ -16,13 +16,13 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.Region;
import org.junit.Test;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.Region;
/**
* @author David Turanski
* @author John Blum

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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