public abstract class RegionTestCase extends CacheTestCase
This class also contains functionality that is used by subclasses.
See getRegionAttributes().
| Modifier and Type | Class and Description |
|---|---|
protected class |
RegionTestCase.TestExpiry |
DistributedTestCase.ExpectedException, DistributedTestCase.WaitCriterion, DistributedTestCase.WaitCriterion2| Modifier and Type | Field and Description |
|---|---|
protected int |
eventCount |
static com.gemstone.gemfire.cache.Region |
preSnapshotRegion
Tests basic creation and loading of a snapshot from perspective of
single VM
|
cachelogPerTest, reconnect, system, testName| Constructor and Description |
|---|
RegionTestCase(String name) |
| Modifier and Type | Method and Description |
|---|---|
protected com.gemstone.gemfire.cache.Region |
createRegion(String name)
Returns a region with the given name and the attributes for this
test.
|
protected com.gemstone.gemfire.cache.Region |
createRootRegion() |
static boolean |
entryIsLocal(com.gemstone.gemfire.cache.Region.Entry re) |
protected abstract com.gemstone.gemfire.cache.RegionAttributes |
getRegionAttributes()
Returns the attributes of a region to be tested by this test.
|
protected void |
pauseIfNecessary()
pauses only if no ack
|
protected void |
pauseIfNecessary(int ms) |
void |
remoteTestPostSnapshot(String name,
boolean isController,
boolean isRoot) |
protected boolean |
supportsLocalDestroyAndLocalInvalidate()
Indicate whether localDestroy and localInvalidate are supported
|
protected boolean |
supportsSubregions()
Indicate whether subregions are supported
|
void |
tearDown2()
Tears down the test.
|
void |
testBadRegionAccess()
Tests that creating or getting entries at an improper time throws
exceptions.
|
void |
testCloseRegion()
Tests closing a region, and checks different behavior when this is a disk
region with persistBackup.
|
void |
testContainsKey()
Tests that creating an entry in a region actually creates it
|
void |
testCreateSubregions()
Tests creating subregions.
|
void |
testCustomEntryIdleReset()
Verify that a get or put resets the idle time on an entry
|
void |
testCustomEntryIdleTimeout1()
Verify that special entries expire but other entries in the region don't
|
void |
testCustomEntryIdleTimeout2()
Verify that special entries don't expire but other entries in the region do
|
void |
testCustomEntryIdleTimeout3()
Expire an entry with a custom idle time.
|
void |
testCustomEntryTtl1()
Verify that special entries expire but other entries in the region don't
|
void |
testCustomEntryTtl2()
Verify that special entries don't expire but other entries in the region do
|
void |
testCustomEntryTtl3()
Expire an entry with a custom ttl time.
|
void |
testCustomIdleOnce()
Verify that expiry is calculatod only once on an entry
|
void |
testDestroyEntry()
Tests
destroying an entry and attempting
to access it afterwards. |
void |
testDestroyRegion()
Tests destroying an entire region and that accessing it after it
has been destory causes a
RegionDestroyedException. |
void |
testEntries()
Tests the
Region.entries(boolean) method without recursion |
void |
testEntriesRecursive()
Tests the
Region.entries(boolean) method with recursion |
void |
testEntryExpirationAfterMutate() |
void |
testEntryFromLoadTtlInvalidate()
Tests that an entry whose value is loaded into a region
expires with an invalidation after a given time to live.
|
void |
testEntryIdleDestroy()
Tests that an entry in a region that remains idle for a
given amount of time is destroyed.
|
void |
testEntryIdleInvalidate()
Tests that an entry in a local region that remains idle for a
given amount of time is invalidated.
|
void |
testEntryIdleReset()
Verify that accessing an entry resets its idle time
|
void |
testEntryIdleTimeout3()
Expire an entry with a given idle time.
|
void |
testEntryIdleTtl()
Verify that accessing an entry does not delay expiration due
to TTL
|
void |
testEntryTtl3()
Expire an entry with a ttl time.
|
void |
testEntryTtlDestroy()
Tests that an entry in a region expires with a destroy
after a given time to live.
|
void |
testEntryTtlInvalidate()
Tests that an entry in a region expires with an
invalidation after a given time to live.
|
void |
testEntryUserAttribute()
Tests a region entry's user attribute
|
void |
testGetCache()
Tests the
Region.getCache() method (for what it's worth) |
void |
testGetName()
Tests the
Region.getName() method |
void |
testGetParentRegion()
Tests the
Region.getParentRegion() method |
void |
testGetPathFromRoot()
Tests the
Region.getFullPath() method |
void |
testInvalidateEntry()
Tests invalidating a region entry
|
void |
testInvalidateRegion()
Tests invalidating an entire region
|
void |
testKeys()
Tests the
Region.keys() method. |
void |
testLocalDestroyEntry()
Tests
locally destroying an entry and
attempting to access it afterwards. |
void |
testLocalDestroyRegion()
Tests locally destroying an entire region and that accessing it
after it has been destory causes a
RegionDestroyedException. |
void |
testLocalInvalidateEntry()
Tests locally invalidating a region entry
|
void |
testLocalInvalidateRegion()
Tests locally invalidating an entire region
|
void |
testNulls()
Tests that sending
null to various APIs throws the
appropriate exception. |
void |
testPutNonExistentEntry()
Tests that
Region.put(K, V) on a previously non-existent region
entry creates it. |
void |
testRegionExpirationAfterMutate() |
void |
testRegionIdleDestroy()
Tests that a region expires with a destruction after a
given idle time.
|
void |
testRegionIdleInvalidate()
Tests that a region that remains idle for a given amount of
time is invalidated.
|
void |
testRegionTtlDestroy()
Tests that a region expires with a destruction after a
given time to live.
|
void |
testRegionTtlInvalidate()
Tests that a region expires with an invalidation after a
given time to live.
|
void |
testRegionUserAttribute()
Tests a
Region's user attribute |
void |
testRootSnapshot() |
void |
testSnapshot() |
void |
testSubregions()
Tests the
Region.subregions(boolean) method without recursion |
void |
testSubregionsRecursive()
Tests the
Region.subregions(boolean) method with recursion |
void |
testValues()
Tests the
Region.values() method without recursion |
protected void |
waitForDestroy(com.gemstone.gemfire.cache.Region.Entry entry,
long p_tilt)
Since tilt is the earliest time we expect, one must
check the current time before invoking the operation
intended to keep the entry alive.
|
protected void |
waitForInvalidate(com.gemstone.gemfire.cache.Region.Entry entry,
long p_tilt)
Since tilt is the earliest time we expect, one must
check the current time before invoking the operation
intended to keep the entry alive.
|
protected void |
waitForRegionDestroy(com.gemstone.gemfire.cache.Region region,
long p_tilt)
Since tilt is the earliest time we expect, one must
check the current time before invoking the operation
intended to keep the region alive.
|
addExceptionTag1, basicGetCache, beginCacheXml, cleanDiskDirs, closeAllCache, closeCache, createLonerCache, createMcastCache, createMcastCache, createRegion, createRegion, createRootRegion, createRootRegion, disconnectFromDS, finishCacheXml, finishCacheXml, getCache, getCache, getCache, getCache, getClientCache, getDiskDirs, getGemfireCache, getInternalRegionArguments, getRootRegion, getRootRegion, hasCache, remoteTearDown, removeExceptionTag1, sendSerialMessageToAll, sendUnorderedMessageToAlladdExpectedException, addExpectedException, addHydraProperties, attachDebugger, checkBBFlag, cleanupAllVms, clearBBFlag, crashDistributedSystem, crashDistributedSystem, createLogWriter, disconnectAllFromDS, dumpAllStacks, dumpMyThreads, dumpStack, dumpStack, dumpStack, dumpStackTrace, fail, getAllDistributedSystemProperties, getDistributedSystemProperties, getDUnitLocatorAddress, getDUnitLocatorPort, getDUnitLocatorString, getDUnitLogLevel, getIPLiteral, getLogWriter, getLonerSystem, getMcastSystem, getMcastSystem, getRepeatTimeoutMs, getServerHostName, getSystem, getSystem, getTestClass, getTestName, getUniqueName, getVMCount, incBBFlag, invokeInEveryVM, invokeInEveryVM, invokeInEveryVM, invokeInEveryVM, invokeInEveryVMRepeatingIfNecessary, invokeInLocator, invokeRepeatingIfNecessary, isConnectedToDS, join, noteTiming, pause, pause, perVMSetUp, realTearDown, setDiskStoreForGateway, setSystem, setTestName, setUp, staticPause, tearDown, unregisterAllDataSerializersFromAllVms, unregisterDataSerializerInThisVM, unregisterInstantiatorsInThisVM, waitForBBFlag, waitForCriterion, waitMutexassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toStringprotected volatile int eventCount
public static com.gemstone.gemfire.cache.Region preSnapshotRegion
public RegionTestCase(String name)
public void tearDown2()
throws Exception
DistributedTestCaseDistributedTestCase.tearDown() method, and should be over ridden in its place.tearDown2 in class CacheTestCaseExceptionprotected final com.gemstone.gemfire.cache.Region createRegion(String name) throws com.gemstone.gemfire.cache.CacheException
com.gemstone.gemfire.cache.CacheExceptiongetRegionAttributes()protected final com.gemstone.gemfire.cache.Region createRootRegion()
throws com.gemstone.gemfire.cache.CacheException
com.gemstone.gemfire.cache.CacheExceptionprotected abstract com.gemstone.gemfire.cache.RegionAttributes getRegionAttributes()
protected void pauseIfNecessary()
protected void pauseIfNecessary(int ms)
public void testContainsKey()
throws com.gemstone.gemfire.cache.CacheException
com.gemstone.gemfire.cache.CacheExceptionRegion.containsKey(java.lang.Object),
Region.containsValueForKey(java.lang.Object)public void testBadRegionAccess()
throws com.gemstone.gemfire.cache.CacheException
com.gemstone.gemfire.cache.CacheExceptionRegion.get(java.lang.Object),
Region.getEntry(java.lang.Object),
Region.create(K, V)public void testPutNonExistentEntry()
throws com.gemstone.gemfire.cache.CacheException
Region.put(K, V) on a previously non-existent region
entry creates it.com.gemstone.gemfire.cache.CacheExceptionprotected boolean supportsSubregions()
protected boolean supportsLocalDestroyAndLocalInvalidate()
public void testNulls()
throws com.gemstone.gemfire.cache.CacheException
null to various APIs throws the
appropriate exception.com.gemstone.gemfire.cache.CacheExceptionpublic void testCreateSubregions()
throws com.gemstone.gemfire.cache.CacheException
statistics, so the region
must have been created with statistics enabled.com.gemstone.gemfire.cache.CacheExceptionpublic static boolean entryIsLocal(com.gemstone.gemfire.cache.Region.Entry re)
public void testDestroyEntry()
throws com.gemstone.gemfire.cache.CacheException
destroying an entry and attempting
to access it afterwards.com.gemstone.gemfire.cache.CacheExceptionpublic void testDestroyRegion()
throws com.gemstone.gemfire.cache.CacheException
RegionDestroyedException.com.gemstone.gemfire.cache.CacheExceptionRegion.destroyRegion()public void testEntries()
throws com.gemstone.gemfire.cache.CacheException
Region.entries(boolean) method without recursioncom.gemstone.gemfire.cache.CacheExceptionpublic void testEntriesRecursive()
throws com.gemstone.gemfire.cache.CacheException
Region.entries(boolean) method with recursioncom.gemstone.gemfire.cache.CacheExceptionpublic void testGetCache()
throws com.gemstone.gemfire.cache.CacheException
Region.getCache() method (for what it's worth)com.gemstone.gemfire.cache.CacheExceptionpublic void testGetName()
throws com.gemstone.gemfire.cache.CacheException
Region.getName() methodcom.gemstone.gemfire.cache.CacheExceptionpublic void testGetPathFromRoot()
throws com.gemstone.gemfire.cache.CacheException
Region.getFullPath() methodcom.gemstone.gemfire.cache.CacheExceptionpublic void testGetParentRegion()
throws com.gemstone.gemfire.cache.CacheException
Region.getParentRegion() methodcom.gemstone.gemfire.cache.CacheExceptionpublic void testRegionUserAttribute()
throws com.gemstone.gemfire.cache.CacheException
Region's user attributecom.gemstone.gemfire.cache.CacheExceptionRegion.setUserAttribute(java.lang.Object)public void testEntryUserAttribute()
throws com.gemstone.gemfire.cache.CacheException
com.gemstone.gemfire.cache.CacheExceptionpublic void testInvalidateEntry()
throws com.gemstone.gemfire.cache.CacheException
com.gemstone.gemfire.cache.CacheExceptionpublic void testInvalidateRegion()
throws com.gemstone.gemfire.cache.CacheException
com.gemstone.gemfire.cache.CacheExceptionpublic void testKeys()
throws com.gemstone.gemfire.cache.CacheException
Region.keys() method.com.gemstone.gemfire.cache.CacheExceptionpublic void testLocalDestroyEntry()
throws com.gemstone.gemfire.cache.CacheException
locally destroying an entry and
attempting to access it afterwards. (Not too useful with a
LOCAL region.)com.gemstone.gemfire.cache.CacheExceptionpublic void testLocalDestroyRegion()
throws com.gemstone.gemfire.cache.CacheException
RegionDestroyedException.com.gemstone.gemfire.cache.CacheExceptionRegion.localDestroyRegion()public void testCloseRegion()
throws com.gemstone.gemfire.cache.CacheException
com.gemstone.gemfire.cache.CacheExceptionpublic void testLocalInvalidateEntry()
throws com.gemstone.gemfire.cache.CacheException
com.gemstone.gemfire.cache.CacheExceptionpublic void testLocalInvalidateRegion()
throws com.gemstone.gemfire.cache.CacheException
com.gemstone.gemfire.cache.CacheExceptionpublic void testSubregions()
throws com.gemstone.gemfire.cache.CacheException
Region.subregions(boolean) method without recursioncom.gemstone.gemfire.cache.CacheExceptionpublic void testSubregionsRecursive()
throws com.gemstone.gemfire.cache.CacheException
Region.subregions(boolean) method with recursioncom.gemstone.gemfire.cache.CacheExceptionpublic void testValues()
throws com.gemstone.gemfire.cache.CacheException
Region.values() method without recursioncom.gemstone.gemfire.cache.CacheExceptionprotected void waitForInvalidate(com.gemstone.gemfire.cache.Region.Entry entry,
long p_tilt)
entry - entry we want to be invalidatedp_tilt - earliest time we expect to see the invalidateprotected void waitForDestroy(com.gemstone.gemfire.cache.Region.Entry entry,
long p_tilt)
entry - entry we want to be invalidatedp_tilt - earliest time we expect to see the invalidateprotected void waitForRegionDestroy(com.gemstone.gemfire.cache.Region region,
long p_tilt)
region - region we want to be destroyedp_tilt - earliest time we expect to see the destroypublic void testEntryTtlInvalidate()
throws com.gemstone.gemfire.cache.CacheException
com.gemstone.gemfire.cache.CacheExceptionpublic void testCustomEntryTtl1()
public void testCustomEntryTtl2()
public void testCustomEntryTtl3()
public void testEntryTtl3()
public void testEntryFromLoadTtlInvalidate()
throws com.gemstone.gemfire.cache.CacheException,
InterruptedException
com.gemstone.gemfire.cache.CacheExceptionInterruptedExceptionpublic void testEntryTtlDestroy()
throws com.gemstone.gemfire.cache.CacheException,
InterruptedException
com.gemstone.gemfire.cache.CacheExceptionInterruptedExceptionpublic void testRegionTtlInvalidate()
throws com.gemstone.gemfire.cache.CacheException,
InterruptedException
com.gemstone.gemfire.cache.CacheExceptionInterruptedExceptionpublic void testRegionTtlDestroy()
throws com.gemstone.gemfire.cache.CacheException,
InterruptedException
com.gemstone.gemfire.cache.CacheExceptionInterruptedExceptionpublic void testEntryIdleInvalidate()
throws com.gemstone.gemfire.cache.CacheException,
InterruptedException
com.gemstone.gemfire.cache.CacheExceptionInterruptedExceptionpublic void testCustomEntryIdleTimeout1()
public void testCustomEntryIdleTimeout2()
public void testCustomEntryIdleTimeout3()
public void testEntryIdleTimeout3()
public void testCustomIdleOnce()
public void testCustomEntryIdleReset()
public void testEntryIdleDestroy()
throws com.gemstone.gemfire.cache.CacheException,
InterruptedException
com.gemstone.gemfire.cache.CacheExceptionInterruptedExceptionpublic void testEntryIdleReset()
throws Exception
Exceptionpublic void testEntryExpirationAfterMutate()
throws com.gemstone.gemfire.cache.CacheException,
InterruptedException
com.gemstone.gemfire.cache.CacheExceptionInterruptedExceptionpublic void testEntryIdleTtl()
public void testRegionExpirationAfterMutate()
throws com.gemstone.gemfire.cache.CacheException,
InterruptedException
com.gemstone.gemfire.cache.CacheExceptionInterruptedExceptionpublic void testRegionIdleInvalidate()
throws InterruptedException,
com.gemstone.gemfire.cache.CacheException
InterruptedExceptioncom.gemstone.gemfire.cache.CacheExceptionpublic void testRegionIdleDestroy()
throws com.gemstone.gemfire.cache.CacheException,
InterruptedException
com.gemstone.gemfire.cache.CacheExceptionInterruptedExceptionpublic void testSnapshot()
throws IOException,
com.gemstone.gemfire.cache.CacheException,
ClassNotFoundException
IOExceptioncom.gemstone.gemfire.cache.CacheExceptionClassNotFoundExceptionpublic void testRootSnapshot()
throws IOException,
com.gemstone.gemfire.cache.CacheException,
ClassNotFoundException
IOExceptioncom.gemstone.gemfire.cache.CacheExceptionClassNotFoundExceptionpublic void remoteTestPostSnapshot(String name, boolean isController, boolean isRoot) throws com.gemstone.gemfire.cache.CacheException
com.gemstone.gemfire.cache.CacheExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.