public abstract class RegionTestCase
extends org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase
This class also contains functionality that is used by subclasses. See
getRegionAttributes()
.
TODO:davidw: Test CacheStatistics
Modifier and Type | Class and Description |
---|---|
protected class |
RegionTestCase.TestExpiry |
Modifier and Type | Field and Description |
---|---|
protected int |
eventCount |
static Region |
preSnapshotRegion
Tests basic creation and loading of a snapshot from perspective of single VM
|
Constructor and Description |
---|
RegionTestCase() |
Modifier and Type | Method and Description |
---|---|
protected <K,V> Region<K,V> |
createRegion(java.lang.String name)
Returns a region with the given name and the attributes for this test.
|
protected <K,V> Region<K,V> |
createRootRegion() |
static boolean |
entryIsLocal(Region.Entry re) |
protected void |
flushIfNecessary(Region r)
Make sure all messages done on region r have been processed on the remote side.
|
protected abstract <K,V> RegionAttributes<K,V> |
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 |
postTearDownCacheTestCase() |
protected void |
postTearDownRegionTestCase() |
void |
remoteTestPostSnapshot(java.lang.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 |
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()
Configure custome entry expiration with an 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 expiration.
|
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.entrySet(boolean) method without recursion |
void |
testEntriesRecursive()
Tests the
Region.entrySet(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()
Configure entry expiration with a idle time.
|
void |
testEntryIdleTtl()
Verify that accessing an entry does not delay expiration due to TTL
|
void |
testEntryTtl3()
Configure entry expiration 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.keySet() 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(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 |
waitForDestroy(Region.Entry entry,
long p_tilt,
int pauseMs)
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(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(Region.Entry entry,
long p_tilt,
int pauseMs)
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(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, closeAllCache, closeCache, createExpiryRootRegion, createLonerCache, createRegion, createRegion, createRootRegion, createRootRegion, finishCacheXml, finishCacheXml, getCache, getCache, getCache, getCache, getCache, getClientCache, getClientCache, getDiskDir, getDiskDirs, getGemfireCache, getRootRegion, getRootRegion, hasCache, preTearDown, preTearDownCacheTestCase, removeExceptionTag1
basicGetSystem, cleanDiskDirs, cleanupAllVms, deleteBACKUPDiskStoreFile, destroyRegions, disconnectAllFromDS, disconnectFromDS, getBlackboard, getDistributedSystemProperties, getLonerSystem, getName, getSystem, getSystem, getSystemStatic, getTestClass, getTestMethodName, getUniqueName, initializeBlackboard, initializeDistributedTestCase, isConnectedToDS, nullSystem, postSetUp, postTearDown, postTearDownAssertions, preSetUp, preTearDownAssertions, setSystem, setUpDistributedTestCase, tearDownDistributedTestCase
protected volatile int eventCount
public static Region preSnapshotRegion
public final void postTearDownCacheTestCase() throws java.lang.Exception
postTearDownCacheTestCase
in interface org.apache.geode.test.dunit.cache.internal.CacheTestFixture
postTearDownCacheTestCase
in class org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase
java.lang.Exception
protected void postTearDownRegionTestCase() throws java.lang.Exception
java.lang.Exception
protected <K,V> Region<K,V> createRegion(java.lang.String name) throws CacheException
CacheException
getRegionAttributes()
protected <K,V> Region<K,V> createRootRegion() throws CacheException
CacheException
protected abstract <K,V> RegionAttributes<K,V> getRegionAttributes()
protected void pauseIfNecessary()
protected void pauseIfNecessary(int ms)
protected void flushIfNecessary(Region r)
public void testContainsKey() throws CacheException
public void testBadRegionAccess() throws CacheException
public void testPutNonExistentEntry() throws CacheException
Region.put(K, V)
on a previously non-existent region entry creates it.CacheException
protected boolean supportsSubregions()
protected boolean supportsLocalDestroyAndLocalInvalidate()
public void testNulls() throws CacheException
null
to various APIs throws the appropriate exception.CacheException
public void testCreateSubregions() throws CacheException
statistics
, so the region must have been created with statistics
enabled.CacheException
public static boolean entryIsLocal(Region.Entry re)
public void testDestroyEntry() throws CacheException
destroying
an entry and attempting to access it afterwards.CacheException
public void testDestroyRegion() throws CacheException
RegionDestroyedException
.CacheException
Region.destroyRegion()
public void testEntries() throws CacheException
Region.entrySet(boolean)
method without recursionCacheException
public void testEntriesRecursive() throws CacheException
Region.entrySet(boolean)
method with recursionCacheException
public void testGetCache() throws CacheException
Region.getCache()
method (for what it's worth)CacheException
public void testGetName() throws CacheException
Region.getName()
methodCacheException
public void testGetPathFromRoot() throws CacheException
Region.getFullPath()
methodCacheException
public void testGetParentRegion() throws CacheException
Region.getParentRegion()
methodCacheException
public void testRegionUserAttribute() throws CacheException
Region
's user attributeCacheException
Region.setUserAttribute(java.lang.Object)
public void testEntryUserAttribute() throws CacheException
CacheException
public void testInvalidateEntry() throws CacheException
CacheException
public void testInvalidateRegion() throws CacheException
CacheException
public void testKeys() throws CacheException
Region.keySet()
method.CacheException
public void testLocalDestroyEntry() throws CacheException
locally destroying
an entry and attempting to access it
afterwards. (Not too useful with a LOCAL
region.)CacheException
public void testLocalDestroyRegion() throws CacheException
RegionDestroyedException
.CacheException
Region.localDestroyRegion()
public void testCloseRegion() throws CacheException
CacheException
public void testLocalInvalidateEntry() throws CacheException
CacheException
public void testLocalInvalidateRegion() throws CacheException
CacheException
public void testSubregions() throws CacheException
Region.subregions(boolean)
method without recursionCacheException
public void testSubregionsRecursive() throws CacheException
Region.subregions(boolean)
method with recursionCacheException
public void testValues() throws CacheException
Region.values()
method without recursionCacheException
protected void waitForInvalidate(Region.Entry entry, long p_tilt)
entry
- entry we want to be invalidatedp_tilt
- earliest time we expect to see the invalidateprotected void waitForInvalidate(Region.Entry entry, long p_tilt, int pauseMs)
entry
- entry we want to be invalidatedp_tilt
- earliest time we expect to see the invalidatepauseMs
- the number of milliseconds to pause before checking againprotected void waitForDestroy(Region.Entry entry, long p_tilt)
entry
- entry we want to be invalidatedp_tilt
- earliest time we expect to see the invalidateprotected void waitForDestroy(Region.Entry entry, long p_tilt, int pauseMs)
entry
- entry we want to be invalidatedp_tilt
- earliest time we expect to see the invalidatepauseMs
- the number of milliseconds to pause before checking againprotected void waitForRegionDestroy(Region region, long p_tilt)
region
- region we want to be destroyedp_tilt
- earliest time we expect to see the destroypublic void testEntryTtlInvalidate() throws CacheException
CacheException
public void testCustomEntryTtl1()
public void testCustomEntryTtl2()
public void testCustomEntryTtl3()
public void testEntryTtl3()
public void testEntryFromLoadTtlInvalidate() throws CacheException, java.lang.InterruptedException
CacheException
java.lang.InterruptedException
public void testEntryTtlDestroy() throws CacheException, java.lang.InterruptedException
CacheException
java.lang.InterruptedException
public void testRegionTtlInvalidate() throws CacheException, java.lang.InterruptedException
CacheException
java.lang.InterruptedException
public void testRegionTtlDestroy() throws CacheException, java.lang.InterruptedException
CacheException
java.lang.InterruptedException
public void testEntryIdleInvalidate() throws CacheException, java.lang.InterruptedException
CacheException
java.lang.InterruptedException
public void testCustomEntryIdleTimeout1()
public void testCustomEntryIdleTimeout2()
public void testCustomEntryIdleTimeout3()
public void testEntryIdleTimeout3()
public void testCustomIdleOnce()
public void testCustomEntryIdleReset()
public void testEntryIdleDestroy() throws java.lang.Exception
java.lang.Exception
public void testEntryIdleReset() throws java.lang.Exception
java.lang.Exception
public void testEntryExpirationAfterMutate() throws CacheException, java.lang.InterruptedException
CacheException
java.lang.InterruptedException
public void testEntryIdleTtl()
public void testRegionExpirationAfterMutate() throws CacheException, java.lang.InterruptedException
CacheException
java.lang.InterruptedException
public void testRegionIdleInvalidate() throws java.lang.InterruptedException, CacheException
java.lang.InterruptedException
CacheException
public void testRegionIdleDestroy() throws CacheException, java.lang.InterruptedException
CacheException
java.lang.InterruptedException
public void testSnapshot() throws java.io.IOException, CacheException, java.lang.ClassNotFoundException
java.io.IOException
CacheException
java.lang.ClassNotFoundException
public void testRootSnapshot() throws java.io.IOException, CacheException, java.lang.ClassNotFoundException
java.io.IOException
CacheException
java.lang.ClassNotFoundException
public void remoteTestPostSnapshot(java.lang.String name, boolean isController, boolean isRoot) throws CacheException
CacheException