SGF-417 - Update apache-geode SDG branch based on the latest Apache Geode developments (snapshot 20150713182515).

This commit is contained in:
John Blum
2015-07-13 17:37:55 -07:00
parent 52b5162d93
commit 2ecbd7b53d
7 changed files with 110 additions and 58 deletions

View File

@@ -16,7 +16,6 @@
package org.springframework.data.gemfire;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import org.junit.Test;
@@ -32,38 +31,41 @@ public class DataPolicyConverterTest {
private final DataPolicyConverter converter = new DataPolicyConverter();
protected int getDataPolicyEnumerationSize() {
int count = 0;
for (byte ordinal = 0; ordinal < Byte.MAX_VALUE; ordinal++) {
try {
assertNotNull(DataPolicy.fromOrdinal(ordinal));
if (DataPolicy.fromOrdinal(ordinal) != null) {
count++;
}
}
catch (Exception ignore) {
return ordinal;
catch (ArrayIndexOutOfBoundsException ignore) {
break;
}
catch (Error ignore) {
return ordinal;
catch (Throwable ignore) {
}
}
throw new IndexOutOfBoundsException("The size of the Data Policy enumeration could not be determined"
+ " because the ordinal based on Byte.MAX_VALUE was exhausted!");
return count;
}
@Test
public void testPolicyToDataPolicy() {
// exclude DEFAULT
public void policyToDataPolicyConversion() {
assertEquals(getDataPolicyEnumerationSize(), DataPolicyConverter.Policy.values().length - 1);
assertEquals(DataPolicy.EMPTY, DataPolicyConverter.Policy.EMPTY.toDataPolicy());
assertEquals(DataPolicy.NORMAL, DataPolicyConverter.Policy.NORMAL.toDataPolicy());
assertEquals(DataPolicy.PRELOADED, DataPolicyConverter.Policy.PRELOADED.toDataPolicy());
assertEquals(DataPolicy.PARTITION, DataPolicyConverter.Policy.PARTITION.toDataPolicy());
assertEquals(DataPolicy.PERSISTENT_PARTITION, DataPolicyConverter.Policy.PERSISTENT_PARTITION.toDataPolicy());
assertEquals(DataPolicy.HDFS_PARTITION, DataPolicyConverter.Policy.HDFS_PARTITION.toDataPolicy());
assertEquals(DataPolicy.HDFS_PERSISTENT_PARTITION, DataPolicyConverter.Policy.HDFS_PERSISTENT_PARTITION.toDataPolicy());
assertEquals(DataPolicy.REPLICATE, DataPolicyConverter.Policy.REPLICATE.toDataPolicy());
assertEquals(DataPolicy.PERSISTENT_REPLICATE, DataPolicyConverter.Policy.PERSISTENT_REPLICATE.toDataPolicy());
assertEquals(DataPolicy.DEFAULT, DataPolicyConverter.Policy.DEFAULT.toDataPolicy());
}
@Test
public void testConvert() {
public void convertDataPolicyStrings() {
assertEquals(DataPolicy.EMPTY, converter.convert("empty"));
assertEquals(DataPolicy.PARTITION, converter.convert("Partition"));
assertEquals(DataPolicy.PERSISTENT_REPLICATE, converter.convert("PERSISTENT_REPLICATE"));

View File

@@ -38,20 +38,22 @@ import com.gemstone.gemfire.cache.RegionShortcut;
public class RegionShortcutWrapperTest {
@Test
public void testOneForOneMapping() {
public void oneForOneMapping() {
for (RegionShortcut shortcut : RegionShortcut.values()) {
assertNotNull(RegionShortcutWrapper.valueOf(shortcut.name()));
assertFalse(RegionShortcutWrapper.UNSPECIFIED.equals(RegionShortcutWrapper.valueOf(shortcut)));
RegionShortcutWrapper wrapper = RegionShortcutWrapper.valueOf(shortcut.name());
assertNotNull(wrapper);
assertFalse(RegionShortcutWrapper.UNSPECIFIED.equals(wrapper));
}
}
@Test
public void testRegionShortcutUnspecified() {
public void unspecifiedRegionShortcut() {
assertEquals(RegionShortcutWrapper.UNSPECIFIED, RegionShortcutWrapper.valueOf((RegionShortcut) null));
}
@Test
public void testIsHeapLru() {
public void isHeapLru() {
assertFalse(RegionShortcutWrapper.LOCAL.isHeapLru());
assertTrue(RegionShortcutWrapper.LOCAL_HEAP_LRU.isHeapLru());
assertFalse(RegionShortcutWrapper.LOCAL_OVERFLOW.isHeapLru());
@@ -79,13 +81,14 @@ public class RegionShortcutWrapperTest {
}
@Test
public void testIsLocal() {
public void isLocal() {
assertTrue(RegionShortcutWrapper.LOCAL.isLocal());
assertTrue(RegionShortcutWrapper.LOCAL_HEAP_LRU.isLocal());
assertTrue(RegionShortcutWrapper.LOCAL_OVERFLOW.isLocal());
assertTrue(RegionShortcutWrapper.LOCAL_PERSISTENT.isLocal());
assertTrue(RegionShortcutWrapper.LOCAL_PERSISTENT_OVERFLOW.isLocal());
assertFalse(RegionShortcutWrapper.PARTITION.isLocal());
assertFalse(RegionShortcutWrapper.PARTITION_HDFS.isLocal());
assertFalse(RegionShortcutWrapper.PARTITION_HEAP_LRU.isLocal());
assertFalse(RegionShortcutWrapper.PARTITION_OVERFLOW.isLocal());
assertFalse(RegionShortcutWrapper.PARTITION_PERSISTENT.isLocal());
@@ -93,10 +96,13 @@ public class RegionShortcutWrapperTest {
assertFalse(RegionShortcutWrapper.PARTITION_PROXY.isLocal());
assertFalse(RegionShortcutWrapper.PARTITION_PROXY_REDUNDANT.isLocal());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT.isLocal());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_HDFS.isLocal());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_HEAP_LRU.isLocal());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_OVERFLOW.isLocal());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_PERSISTENT.isLocal());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_PERSISTENT_OVERFLOW.isLocal());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_WRITEONLY_HDFS_STORE.isLocal());
assertFalse(RegionShortcutWrapper.PARTITION_WRITEONLY_HDFS_STORE.isLocal());
assertFalse(RegionShortcutWrapper.REPLICATE.isLocal());
assertFalse(RegionShortcutWrapper.REPLICATE_HEAP_LRU.isLocal());
assertFalse(RegionShortcutWrapper.REPLICATE_OVERFLOW.isLocal());
@@ -107,13 +113,14 @@ public class RegionShortcutWrapperTest {
}
@Test
public void testIsOverflow() {
public void isOverflow() {
assertFalse(RegionShortcutWrapper.LOCAL.isOverflow());
assertFalse(RegionShortcutWrapper.LOCAL_HEAP_LRU.isOverflow());
assertTrue(RegionShortcutWrapper.LOCAL_OVERFLOW.isOverflow());
assertFalse(RegionShortcutWrapper.LOCAL_PERSISTENT.isOverflow());
assertTrue(RegionShortcutWrapper.LOCAL_PERSISTENT_OVERFLOW.isOverflow());
assertFalse(RegionShortcutWrapper.PARTITION.isOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_HDFS.isOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_HEAP_LRU.isOverflow());
assertTrue(RegionShortcutWrapper.PARTITION_OVERFLOW.isOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_PERSISTENT.isOverflow());
@@ -121,10 +128,13 @@ public class RegionShortcutWrapperTest {
assertFalse(RegionShortcutWrapper.PARTITION_PROXY.isOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_PROXY_REDUNDANT.isOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT.isOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_HDFS.isOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_HEAP_LRU.isOverflow());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_OVERFLOW.isOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_PERSISTENT.isOverflow());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_PERSISTENT_OVERFLOW.isOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_WRITEONLY_HDFS_STORE.isOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_WRITEONLY_HDFS_STORE.isOverflow());
assertFalse(RegionShortcutWrapper.REPLICATE.isOverflow());
assertFalse(RegionShortcutWrapper.REPLICATE_HEAP_LRU.isOverflow());
assertTrue(RegionShortcutWrapper.REPLICATE_OVERFLOW.isOverflow());
@@ -135,13 +145,14 @@ public class RegionShortcutWrapperTest {
}
@Test
public void testIsPartition() {
public void isPartition() {
assertFalse(RegionShortcutWrapper.LOCAL.isPartition());
assertFalse(RegionShortcutWrapper.LOCAL_HEAP_LRU.isPartition());
assertFalse(RegionShortcutWrapper.LOCAL_OVERFLOW.isPartition());
assertFalse(RegionShortcutWrapper.LOCAL_PERSISTENT.isPartition());
assertFalse(RegionShortcutWrapper.LOCAL_PERSISTENT_OVERFLOW.isPartition());
assertTrue(RegionShortcutWrapper.PARTITION.isPartition());
assertTrue(RegionShortcutWrapper.PARTITION_HDFS.isPartition());
assertTrue(RegionShortcutWrapper.PARTITION_HEAP_LRU.isPartition());
assertTrue(RegionShortcutWrapper.PARTITION_OVERFLOW.isPartition());
assertTrue(RegionShortcutWrapper.PARTITION_PERSISTENT.isPartition());
@@ -149,10 +160,13 @@ public class RegionShortcutWrapperTest {
assertTrue(RegionShortcutWrapper.PARTITION_PROXY.isPartition());
assertTrue(RegionShortcutWrapper.PARTITION_PROXY_REDUNDANT.isPartition());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT.isPartition());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_HDFS.isPartition());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_HEAP_LRU.isPartition());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_OVERFLOW.isPartition());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_PERSISTENT.isPartition());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_PERSISTENT_OVERFLOW.isPartition());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_WRITEONLY_HDFS_STORE.isPartition());
assertTrue(RegionShortcutWrapper.PARTITION_WRITEONLY_HDFS_STORE.isPartition());
assertFalse(RegionShortcutWrapper.REPLICATE.isPartition());
assertFalse(RegionShortcutWrapper.REPLICATE_HEAP_LRU.isPartition());
assertFalse(RegionShortcutWrapper.REPLICATE_OVERFLOW.isPartition());
@@ -163,13 +177,14 @@ public class RegionShortcutWrapperTest {
}
@Test
public void testIsPersistent() {
public void isPersistent() {
assertFalse(RegionShortcutWrapper.LOCAL.isPersistent());
assertFalse(RegionShortcutWrapper.LOCAL_HEAP_LRU.isPersistent());
assertFalse(RegionShortcutWrapper.LOCAL_OVERFLOW.isPersistent());
assertTrue(RegionShortcutWrapper.LOCAL_PERSISTENT.isPersistent());
assertTrue(RegionShortcutWrapper.LOCAL_PERSISTENT_OVERFLOW.isPersistent());
assertFalse(RegionShortcutWrapper.PARTITION.isPersistent());
assertFalse(RegionShortcutWrapper.PARTITION_HDFS.isPersistent());
assertFalse(RegionShortcutWrapper.PARTITION_HEAP_LRU.isPersistent());
assertFalse(RegionShortcutWrapper.PARTITION_OVERFLOW.isPersistent());
assertTrue(RegionShortcutWrapper.PARTITION_PERSISTENT.isPersistent());
@@ -177,10 +192,13 @@ public class RegionShortcutWrapperTest {
assertFalse(RegionShortcutWrapper.PARTITION_PROXY.isPersistent());
assertFalse(RegionShortcutWrapper.PARTITION_PROXY_REDUNDANT.isPersistent());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT.isPersistent());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_HDFS.isPersistent());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_HEAP_LRU.isPersistent());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_OVERFLOW.isPersistent());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_PERSISTENT.isPersistent());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_PERSISTENT_OVERFLOW.isPersistent());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_WRITEONLY_HDFS_STORE.isPersistent());
assertFalse(RegionShortcutWrapper.PARTITION_WRITEONLY_HDFS_STORE.isPersistent());
assertFalse(RegionShortcutWrapper.REPLICATE.isPersistent());
assertFalse(RegionShortcutWrapper.REPLICATE_HEAP_LRU.isPersistent());
assertFalse(RegionShortcutWrapper.REPLICATE_OVERFLOW.isPersistent());
@@ -191,13 +209,14 @@ public class RegionShortcutWrapperTest {
}
@Test
public void testIsPersistentOverflow() {
public void isPersistentOverflow() {
assertFalse(RegionShortcutWrapper.LOCAL.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.LOCAL_HEAP_LRU.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.LOCAL_OVERFLOW.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.LOCAL_PERSISTENT.isPersistentOverflow());
assertTrue(RegionShortcutWrapper.LOCAL_PERSISTENT_OVERFLOW.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.PARTITION.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_HDFS.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_HEAP_LRU.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_OVERFLOW.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_PERSISTENT.isPersistentOverflow());
@@ -205,10 +224,13 @@ public class RegionShortcutWrapperTest {
assertFalse(RegionShortcutWrapper.PARTITION_PROXY.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_PROXY_REDUNDANT.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_HDFS.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_HEAP_LRU.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_OVERFLOW.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_PERSISTENT.isPersistentOverflow());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_PERSISTENT_OVERFLOW.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_WRITEONLY_HDFS_STORE.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.PARTITION_WRITEONLY_HDFS_STORE.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.REPLICATE.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.REPLICATE_HEAP_LRU.isPersistentOverflow());
assertFalse(RegionShortcutWrapper.REPLICATE_OVERFLOW.isPersistentOverflow());
@@ -218,13 +240,14 @@ public class RegionShortcutWrapperTest {
assertFalse(RegionShortcutWrapper.UNSPECIFIED.isPersistentOverflow());
}
@Test
public void testIsProxy() {
public void isProxy() {
assertFalse(RegionShortcutWrapper.LOCAL.isProxy());
assertFalse(RegionShortcutWrapper.LOCAL_HEAP_LRU.isProxy());
assertFalse(RegionShortcutWrapper.LOCAL_OVERFLOW.isProxy());
assertFalse(RegionShortcutWrapper.LOCAL_PERSISTENT.isProxy());
assertFalse(RegionShortcutWrapper.LOCAL_PERSISTENT_OVERFLOW.isProxy());
assertFalse(RegionShortcutWrapper.PARTITION.isProxy());
assertFalse(RegionShortcutWrapper.PARTITION_HDFS.isProxy());
assertFalse(RegionShortcutWrapper.PARTITION_HEAP_LRU.isProxy());
assertFalse(RegionShortcutWrapper.PARTITION_OVERFLOW.isProxy());
assertFalse(RegionShortcutWrapper.PARTITION_PERSISTENT.isProxy());
@@ -232,10 +255,13 @@ public class RegionShortcutWrapperTest {
assertTrue(RegionShortcutWrapper.PARTITION_PROXY.isProxy());
assertTrue(RegionShortcutWrapper.PARTITION_PROXY_REDUNDANT.isProxy());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT.isProxy());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_HDFS.isProxy());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_HEAP_LRU.isProxy());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_OVERFLOW.isProxy());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_PERSISTENT.isProxy());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_PERSISTENT_OVERFLOW.isProxy());
assertFalse(RegionShortcutWrapper.PARTITION_REDUNDANT_WRITEONLY_HDFS_STORE.isProxy());
assertFalse(RegionShortcutWrapper.PARTITION_WRITEONLY_HDFS_STORE.isProxy());
assertFalse(RegionShortcutWrapper.REPLICATE.isProxy());
assertFalse(RegionShortcutWrapper.REPLICATE_HEAP_LRU.isProxy());
assertFalse(RegionShortcutWrapper.REPLICATE_OVERFLOW.isProxy());
@@ -245,13 +271,14 @@ public class RegionShortcutWrapperTest {
assertFalse(RegionShortcutWrapper.UNSPECIFIED.isProxy());
}
@Test
public void testIsRedundant() {
public void isRedundant() {
assertFalse(RegionShortcutWrapper.LOCAL.isRedundant());
assertFalse(RegionShortcutWrapper.LOCAL_HEAP_LRU.isRedundant());
assertFalse(RegionShortcutWrapper.LOCAL_OVERFLOW.isRedundant());
assertFalse(RegionShortcutWrapper.LOCAL_PERSISTENT.isRedundant());
assertFalse(RegionShortcutWrapper.LOCAL_PERSISTENT_OVERFLOW.isRedundant());
assertFalse(RegionShortcutWrapper.PARTITION.isRedundant());
assertFalse(RegionShortcutWrapper.PARTITION_HDFS.isRedundant());
assertFalse(RegionShortcutWrapper.PARTITION_HEAP_LRU.isRedundant());
assertFalse(RegionShortcutWrapper.PARTITION_OVERFLOW.isRedundant());
assertFalse(RegionShortcutWrapper.PARTITION_PERSISTENT.isRedundant());
@@ -259,10 +286,13 @@ public class RegionShortcutWrapperTest {
assertFalse(RegionShortcutWrapper.PARTITION_PROXY.isRedundant());
assertTrue(RegionShortcutWrapper.PARTITION_PROXY_REDUNDANT.isRedundant());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT.isRedundant());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_HDFS.isRedundant());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_HEAP_LRU.isRedundant());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_OVERFLOW.isRedundant());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_PERSISTENT.isRedundant());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_PERSISTENT_OVERFLOW.isRedundant());
assertTrue(RegionShortcutWrapper.PARTITION_REDUNDANT_WRITEONLY_HDFS_STORE.isRedundant());
assertFalse(RegionShortcutWrapper.PARTITION_WRITEONLY_HDFS_STORE.isRedundant());
assertFalse(RegionShortcutWrapper.REPLICATE.isRedundant());
assertFalse(RegionShortcutWrapper.REPLICATE_HEAP_LRU.isRedundant());
assertFalse(RegionShortcutWrapper.REPLICATE_OVERFLOW.isRedundant());
@@ -273,7 +303,7 @@ public class RegionShortcutWrapperTest {
}
@Test
public void testIsReplicate() {
public void isReplicate() {
assertFalse(RegionShortcutWrapper.LOCAL.isReplicate());
assertFalse(RegionShortcutWrapper.LOCAL_HEAP_LRU.isReplicate());
assertFalse(RegionShortcutWrapper.LOCAL_OVERFLOW.isReplicate());

View File

@@ -37,6 +37,9 @@ import com.gemstone.gemfire.cache.TimeoutException;
import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue;
import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueueFactory;
import com.gemstone.gemfire.cache.control.ResourceManager;
import com.gemstone.gemfire.cache.hdfs.HDFSStore;
import com.gemstone.gemfire.cache.hdfs.HDFSStoreFactory;
import com.gemstone.gemfire.cache.lucene.LuceneService;
import com.gemstone.gemfire.cache.query.Index;
import com.gemstone.gemfire.cache.query.IndexExistsException;
import com.gemstone.gemfire.cache.query.IndexInvalidException;
@@ -127,7 +130,7 @@ public class StubCache implements Cache {
@Override
public CacheTransactionManager getCacheTransactionManager() {
if (cacheTransactionManager == null) {
cacheTransactionManager = new StubCacheTransactionMananger();
cacheTransactionManager = new StubCacheTransactionManager();
}
return cacheTransactionManager;
@@ -266,9 +269,11 @@ public class StubCache implements Cache {
@Override
public <K, V> Map<String, RegionAttributes<K, V>> listRegionAttributes() {
Map<String, RegionAttributes<K, V>> attributes = new HashMap<String, RegionAttributes<K, V>>();
for (Entry<String, Region> entry: allRegions().entrySet()) {
attributes.put(entry.getKey(), entry.getValue().getAttributes());
}
return attributes;
}
@@ -333,14 +338,12 @@ public class StubCache implements Cache {
*/
@Override
public QueryService getQueryService() {
QueryService qs = null;
try {
qs = mockQueryService();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return qs;
return mockQueryService();
}
catch (Exception ignore) {
return null;
}
}
/* (non-Javadoc)
@@ -366,11 +369,13 @@ public class StubCache implements Cache {
@Override
public Set<Region<?, ?>> rootRegions() {
Set<Region<?,?>> rootRegions = new HashSet<Region<?,?>>();
for (String key: allRegions().keySet()) {
if (!key.contains("/")) {
if (!key.contains(Region.SEPARATOR)) {
rootRegions.add(allRegions().get(key));
}
}
return rootRegions;
}
@@ -580,12 +585,10 @@ public class StubCache implements Cache {
/* (non-Javadoc)
* @see com.gemstone.gemfire.cache.Cache#getLuceneService()
*/
/*
@Override
public LuceneService getLuceneService() {
throw new UnsupportedOperationException(NOT_IMPLEMENTED);
}
*/
/* (non-Javadoc)
* @see com.gemstone.gemfire.cache.Cache#getMembers()
@@ -846,4 +849,14 @@ public class StubCache implements Cache {
return false;
}
@Override
public HDFSStoreFactory createHDFSStoreFactory() {
throw new UnsupportedOperationException("Not Implemented!");
}
@Override
public HDFSStore findHDFSStore(final String s) {
throw new UnsupportedOperationException("Not Implemented!");
}
}

View File

@@ -28,9 +28,10 @@ import com.gemstone.gemfire.cache.TransactionWriter;
* @author David Turanski
*
*/
public class StubCacheTransactionMananger implements CacheTransactionManager {
public class StubCacheTransactionManager implements CacheTransactionManager {
private List<TransactionListener> listeners = new ArrayList<TransactionListener>();
private TransactionWriter writer;
/* (non-Javadoc)
@@ -38,8 +39,7 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
*/
@Override
public void begin() {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Not Implemented!");
}
/* (non-Javadoc)
@@ -47,7 +47,7 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
*/
@Override
public void commit() throws CommitConflictException {
throw new UnsupportedOperationException("Not Implemented!");
}
/* (non-Javadoc)
@@ -55,8 +55,7 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
*/
@Override
public void rollback() {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Not Implemented!");
}
/* (non-Javadoc)
@@ -64,8 +63,7 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
*/
@Override
public TransactionId suspend() {
// TODO Auto-generated method stub
return null;
throw new UnsupportedOperationException("Not Implemented!");
}
/* (non-Javadoc)
@@ -73,8 +71,7 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
*/
@Override
public void resume(TransactionId transactionId) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Not Implemented!");
}
/* (non-Javadoc)
@@ -82,7 +79,6 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
*/
@Override
public boolean isSuspended(TransactionId transactionId) {
// TODO Auto-generated method stub
return false;
}
@@ -91,7 +87,6 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
*/
@Override
public boolean tryResume(TransactionId transactionId) {
// TODO Auto-generated method stub
return false;
}
@@ -100,7 +95,6 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
*/
@Override
public boolean tryResume(TransactionId transactionId, long time, TimeUnit unit) {
// TODO Auto-generated method stub
return false;
}
@@ -109,7 +103,6 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
*/
@Override
public boolean exists(TransactionId transactionId) {
// TODO Auto-generated method stub
return false;
}
@@ -118,7 +111,6 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
*/
@Override
public boolean exists() {
// TODO Auto-generated method stub
return false;
}
@@ -127,7 +119,6 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
*/
@Override
public TransactionId getTransactionId() {
// TODO Auto-generated method stub
return null;
}
@@ -137,7 +128,6 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
@Override
@Deprecated
public TransactionListener getListener() {
// TODO Auto-generated method stub
return null;
}
@@ -148,14 +138,14 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
public TransactionListener[] getListeners() {
return listeners.toArray(new TransactionListener[listeners.size()]);
}
/* (non-Javadoc)
* @see com.gemstone.gemfire.cache.CacheTransactionManager#setListener(com.gemstone.gemfire.cache.TransactionListener)
*/
@Override
@Deprecated
public TransactionListener setListener(TransactionListener newListener) {
// TODO Auto-generated method stub
return null;
throw new UnsupportedOperationException("Not Implemented!");
}
/* (non-Javadoc)
@@ -164,7 +154,6 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
@Override
public void addListener(TransactionListener aListener) {
this.listeners.add(aListener);
}
/* (non-Javadoc)
@@ -181,7 +170,6 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
@Override
public void initListeners(TransactionListener[] newListeners) {
this.listeners = Arrays.asList(newListeners);
}
/* (non-Javadoc)
@@ -200,4 +188,14 @@ public class StubCacheTransactionMananger implements CacheTransactionManager {
return this.writer;
}
@Override
public void setDistributed(final boolean b) {
throw new UnsupportedOperationException("Not Implemented!");
}
@Override
public boolean isDistributed() {
return false;
}
}