some final clean up for 3.1.0.M1

This commit is contained in:
David Turanski
2013-02-11 12:39:20 -05:00
parent 30cf17682c
commit 699f3bad51
26 changed files with 31 additions and 267 deletions

View File

@@ -12,7 +12,8 @@
*/
package org.springframework.data.gemfire.client;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import java.util.List;
@@ -33,7 +34,6 @@ 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.ClientCache;
import com.gemstone.gemfire.cache.client.Pool;
/**

View File

@@ -12,10 +12,7 @@
*/
package org.springframework.data.gemfire.client;
import static org.junit.Assert.*;
import java.util.Arrays;
import java.util.List;
import static org.junit.Assert.assertEquals;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -25,16 +22,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.ForkUtil;
import org.springframework.data.gemfire.fork.SpringCacheServerProcess;
import org.springframework.data.gemfire.repository.sample.Person;
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.ClientCache;
import com.gemstone.gemfire.cache.client.Pool;
/**
* @author David Turanski

View File

@@ -14,7 +14,6 @@ package org.springframework.data.gemfire.config;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.springframework.context.ConfigurableApplicationContext;

View File

@@ -82,6 +82,7 @@ public class FunctionCacheServerProcess {
bufferedReader.readLine();
}
@SuppressWarnings("serial")
static class ServerFunction extends FunctionAdapter {
/* (non-Javadoc)
@@ -104,6 +105,7 @@ public class FunctionCacheServerProcess {
}
@SuppressWarnings("serial")
static class EchoFunction extends FunctionAdapter {
/* (non-Javadoc)

View File

@@ -63,12 +63,6 @@ public class ListenerContainerTests {
ClientCacheFactory ccf = new ClientCacheFactory(props);
ccf.setPoolSubscriptionEnabled(true);
cache = ccf.create();
// not really used but here just for future tests :)
// PoolFactory pf = PoolManager.createFactory();
// pf.addServer("localhost", 40404);
// pf.setSubscriptionEnabled(true);
// Pool pool = pf.create("client");
}
@@ -94,7 +88,6 @@ public class ListenerContainerTests {
container = new ContinuousQueryListenerContainer();
container.setCache(cache);
//container.setPoolName("client");
container.setBeanName("container");
container.afterPropertiesSet();
container.addListener(new ContinuousQueryDefinition("test", query, adapter));

View File

@@ -63,6 +63,7 @@ public class ContainerXmlSetupTest {
assertEquals(3, cqs.length);
assertEquals(3, pcqs.length);
ForkUtil.sendSignal();
Thread.sleep(3000);
ctx.close();
}
}

View File

@@ -24,7 +24,6 @@ import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.springframework.data.gemfire.CacheFactoryBean;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.test.StubCache;

View File

@@ -28,10 +28,12 @@ import org.springframework.data.gemfire.GemfireTemplate;
*/
public class GemfireDaoSupportTests extends TestCase {
@SuppressWarnings("rawtypes")
public void testGemfireDaoSupportWithTemplate() throws Exception {
GemfireTemplate template = new GemfireTemplate();
final List test = new ArrayList();
GemfireDaoSupport dao = new GemfireDaoSupport() {
@SuppressWarnings("unchecked")
protected void initDao() {
test.add("test");
}

View File

@@ -20,8 +20,6 @@ import org.springframework.data.gemfire.CacheFactoryBean;
import org.springframework.data.gemfire.client.ClientCacheFactoryBean;
import org.springframework.data.gemfire.server.CacheServerFactoryBean;
import com.gemstone.gemfire.cache.Cache;
/**
* @author David Turanski
*

View File

@@ -14,10 +14,8 @@ package org.springframework.data.gemfire.test;
import java.util.Properties;
import org.springframework.data.gemfire.CacheFactoryBean;
import org.springframework.data.gemfire.client.ClientCacheFactoryBean;
import com.gemstone.gemfire.cache.CacheFactory;
import com.gemstone.gemfire.cache.client.ClientCacheFactory;
/**

View File

@@ -485,11 +485,12 @@ public class MockRegionFactory<K,V> {
return regionFactory;
}
RegionFactory createRegionFactory() {
@SuppressWarnings("rawtypes")
RegionFactory createRegionFactory() {
return createMockRegionFactory();
}
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public Region mockRegion(String name) {
RegionService regionService = mockRegionService();
Region region = mock(Region.class);
@@ -527,7 +528,6 @@ public class MockRegionFactory<K,V> {
when(region.createSubregion(anyString(),any(RegionAttributes.class))).thenAnswer(new Answer<Region>() {
@SuppressWarnings("rawtypes")
@Override
public Region answer(InvocationOnMock invocation) throws Throwable {
String name = (String)invocation.getArguments()[0];

View File

@@ -17,7 +17,6 @@ package org.springframework.data.gemfire.test;
*
*/
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.*;
import org.junit.Test;
import com.gemstone.gemfire.cache.Region;

View File

@@ -247,6 +247,7 @@ public class StubCache implements Cache {
/* (non-Javadoc)
* @see com.gemstone.gemfire.cache.GemFireCache#getRegionAttributes(java.lang.String)
*/
@SuppressWarnings("unchecked")
@Override
public <K, V> RegionAttributes<K, V> getRegionAttributes(String region) {
return allRegions().get(region).getAttributes();
@@ -271,6 +272,7 @@ public class StubCache implements Cache {
/* (non-Javadoc)
* @see com.gemstone.gemfire.cache.GemFireCache#listRegionAttributes()
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public <K, V> Map<String, RegionAttributes<K, V>> listRegionAttributes() {
Map<String, RegionAttributes<K, V>> attributes = new HashMap<String, RegionAttributes<K, V>>();
@@ -355,6 +357,7 @@ public class StubCache implements Cache {
/* (non-Javadoc)
* @see com.gemstone.gemfire.cache.RegionService#getRegion(java.lang.String)
*/
@SuppressWarnings("unchecked")
@Override
public <K, V> Region<K, V> getRegion(String name) {
return allRegions().get(name);
@@ -466,6 +469,7 @@ public class StubCache implements Cache {
/* (non-Javadoc)
* @see com.gemstone.gemfire.cache.Cache#createRegionFactory(com.gemstone.gemfire.cache.RegionShortcut)
*/
@SuppressWarnings("unchecked")
@Override
public <K, V> RegionFactory<K, V> createRegionFactory(RegionShortcut shortCut) {
RegionFactory<K, V> regionFactory = new MockRegionFactory<K,V>(this).createRegionFactory();
@@ -475,6 +479,7 @@ public class StubCache implements Cache {
/* (non-Javadoc)
* @see com.gemstone.gemfire.cache.Cache#createRegionFactory(java.lang.String)
*/
@SuppressWarnings("unchecked")
@Override
public <K, V> RegionFactory<K, V> createRegionFactory(String arg0) {
RegionFactory<K, V> regionFactory = new MockRegionFactory<K,V>(this).createRegionFactory();
@@ -635,6 +640,7 @@ public class StubCache implements Cache {
/* (non-Javadoc)
* @see com.gemstone.gemfire.cache.Cache#getMembers(com.gemstone.gemfire.cache.Region)
*/
@SuppressWarnings({"rawtypes"})
@Override
public Set<DistributedMember> getMembers(Region arg0) {
throw new UnsupportedOperationException();
@@ -859,6 +865,7 @@ public class StubCache implements Cache {
return qs;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
Index mockIndex(String indexName, IndexType indexType,String indexedExpression, String fromClause, String imports){
Index idx = mock(Index.class);
when(idx.getFromClause()).thenReturn(fromClause);
@@ -876,6 +883,7 @@ public class StubCache implements Cache {
return idx;
}
@SuppressWarnings("rawtypes")
public Map<String,Region> allRegions() {
return this.allRegions;
}

View File

@@ -262,7 +262,7 @@ public class StubCacheServer implements CacheServer {
*/
@Override
public void setLoadProbe(ServerLoadProbe loadProbe) {
this.serverLoadProbe = serverLoadProbe;
this.serverLoadProbe = loadProbe;
}
/* (non-Javadoc)