MultiVMRegionTestCase (Apache Geode 1.8.0)
Date: 2018-11-29

org.apache.geode.cache30

## Class MultiVMRegionTestCase

- java.lang.Object
- - org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase
  - - org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase
    - - org.apache.geode.cache30.RegionTestCase
      - - org.apache.geode.cache30.MultiVMRegionTestCase

- All Implemented Interfaces:
    java.io.Serializable, org.apache.geode.test.dunit.cache.internal.CacheTestFixture, org.apache.geode.test.dunit.internal.DistributedTestFixture

      public abstract class MultiVMRegionTestCase
      extends RegionTestCase

  Abstract superclass of `Region` tests that involve more than one VM.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.geode.cache30.RegionTestCase

      `RegionTestCase.TestExpiry`

  - ### Field Summary

    - ### Fields inherited from class org.apache.geode.cache30.RegionTestCase

      `eventCount, preSnapshotRegion`

    - ### Fields inherited from class org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase

      `cache`

    - ### Fields inherited from class org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase

      `system, testNameForDistributedTestCase`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultiVMRegionTestCase()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `caseTearDown()`
    `protected void` | `createRegionWithAttribute(org.apache.geode.test.dunit.VM vm, java.lang.String name, boolean syncDiskWrite)`
    `static void` | `doOpsLoopNoFlush(int runTimeMs, boolean includeClear, boolean includePutAll)`
    `static java.util.Map` | `getCCRegionContents()`
    `java.util.Properties` | `getDistributedSystemProperties()`
    `protected <K,V> RegionAttributes<K,V>` | `getRegionAttributes(java.lang.String type)` return the region attributes for the given type of region.
    `protected long` | `getRepeatTimeoutMs()` The number of milliseconds to try repeating validation code in the event that AssertionError is thrown.
    `protected static <K,V> TestCacheLoader<K,V>` | `loader()`
    `protected void` | `postTearDownRegionTestCase()`
    `protected static <K,V> void` | `setLoader(TestCacheLoader<K,V> loader)`
    `protected boolean` | `supportsNetLoad()` Indicate whether this region supports netload
    `protected boolean` | `supportsReplication()` Indicate whether replication/GII supported
    `protected boolean` | `supportsTransactions()` Indicate whether this region supports transactions
    `void` | `testCacheLoaderModifyingArgument()` Tests that when a `CacheLoader` modifies the callback argument in place, the change is visible to the `CacheWriter` even if it is in another VM.
    `void` | `testCacheLoaderWithNetLoad()`
    `void` | `testCacheLoaderWithNetSearch()`
    `void` | `testConcurrentOperations()` This is a for the ConcurrentMap operations.
    `void` | `testDefinedEntryUpdated()` Two VMs create a region.
    `void` | `testDistributedDestroy()` Tests that destroying an entry is propagated to all VMs that define that entry.
    `void` | `testDistributedGet()` Tests that doing a distributed get results in a `netSearch`.
    `void` | `testDistributedInvalidate()` Tests that invalidating an entry is propagated to all VMs that define that entry.
    `void` | `testDistributedInvalidate4()` Tests that invalidating an entry in multiple VMs does not cause any problems.
    `void` | `testDistributedPut()` Tests that an entry update is propagated to other caches that have that same entry defined.
    `void` | `testDistributedPutNoUpdate()` Tests that doing a `put` on a distributed region in one VM does not effect a region in a different VM that does not have that key defined.
    `void` | `testDistributedRegionDestroy()` Tests that destroying a region is propagated to all VMs that define that region.
    `void` | `testDistributedRegionInvalidate()` Tests that invalidating a region is propagated to all VMs that define that entry.
    `void` | `testDistributedUpdate()` Tests that doing a `put` in a distributed region one VM updates the value in another VM.
    `void` | `testEntryTtlDestroyEvent()` Tests that an entry in a distributed region that expires with a distributed destroy causes an event in other VM with isExpiration flag set.
    `void` | `testEntryTtlLocalDestroy()` Tests that an entry in a distributed region expires with a local destroy after a given time to live.
    `void` | `testGetInitialImage()` Tests that a newly-created mirrored region contains all of the entries of another region.
    `void` | `testLargeGetInitialImage()` Tests that a newly-created mirrored region contains all of the entries of another region, with a large quantity of data.
    `void` | `testLocalAndRemoteCacheWriters()` Tests that, when given a choice, a local `CacheWriter` is invoked instead of a remote one.
    `void` | `testLocalCacheLoader()` Tests that a local loader is preferred to a remote one
    `void` | `testLocalDestroy()` Tests that a Region.localDestroy(java.lang.Object) does not effect other VMs that define that entry.
    `void` | `testLocalRegionDestroy()` Tests that a `Region.localDestroyRegion()` is not propagated to other VMs that define that region.
    `void` | `testMirroredDataFromNonMirrored()` Tests that a mirrored region gets data pushed to it from a non-mirrored region and the afterCreate event is invoked on a listener.
    `void` | `testMirroredLocalLoad()` Tests that a local load occurs, even with mirroring
    `void` | `testMirroredNetLoad()` Tests sure that a `netLoad` occurs, even with mirroring
    `void` | `testNBRegionDestructionDuringGetInitialImage()`
    `void` | `testNBRegionInvalidationDuringGetInitialImage()`
    `void` | `testNetSearchObservesIdleTime()`
    `void` | `testNetSearchObservesTtl()`
    `void` | `testNoDataSerializer()` Tests what happens when one VM attempts to read an object for which it does not have a registered `DataSerializer`.
    `void` | `testNoInstantiator()` Tests what happens when one VM attempts to read an object for which it does not have a registered `Instantiator`.
    `void` | `testNoLoaderWithInvalidEntry()` Tests that a remote `CacheLoader` is not invoked if the remote region has an invalid entry (that is, a key, but no value).
    `void` | `testNoMirroredDataToNonMirrored()` Tests that a mirrored region does not push data to a non-mirrored region.
    `void` | `testNonblockingGetInitialImage()` Tests that distributed ack operations do not block while another cache is doing a getInitialImage.
    `void` | `testNoRegionKeepAlive()` Tests that a region is not kept alive
    `void` | `testNoRemoteCacheLoader()` Tests that `Region.get(java.lang.Object)` returns `null` when there is no remote loader.
    `void` | `testOrderedUpdates()` Verifies that distributed updates are delivered in order.
    `void` | `testRemoteCacheListener()` Tests that a `CacheListener` is invoked in a remote VM.
    `void` | `testRemoteCacheListenerInSubregion()` Tests that a `CacheListener` is invoked in a remote VM.
    `void` | `testRemoteCacheLoader()` Tests that a `CacheLoader` is invoked in a remote VM.
    `void` | `testRemoteCacheLoaderArg()` Tests that the parameter passed to a remote `CacheLoader` is actually passed.
    `void` | `testRemoteCacheLoaderException()` Tests that a remote `CacheLoader` that throws a `CacheLoaderException` results is propagated back to the caller.
    `void` | `testRemoteCacheWriter()` Tests that a remote `CacheWriter` is invoked and that `CacheWriter` arguments and `CacheWriterException`s are propagated appropriately.
    `void` | `testRemoteLoaderNetSearch()` Tests that invoking `netSearch` in a remote loader returns `null` instead of causing infinite recursion.
    `void` | `testReplicate()` Tests that keys and values are pushed with `DataPolicy.REPLICATE`.
    `void` | `testTXAlgebra()`
    `void` | `testTXMultiRegion()`
    `void` | `testTXNonblockingGetInitialImage()` Tests that distributed ack operations do not block while another cache is doing a getInitialImage.
    `void` | `testTXRmtMirror()`
    `void` | `testTXSimpleOps()` Tests that an entry update is propagated to other caches that have that same entry defined.
    `void` | `testTXUpdateLoadNoConflict()` Tests that the push of a loaded value does not cause a conflict on the side receiving the update
    `void` | `testUpdateResetsIdleTime()` Tests to makes sure that a distributed update resets the expiration timer.
    `void` | `versionTestClearOnNonReplicateWithConcurrentEvents()`
    `void` | `versionTestClearWithConcurrentEvents()`
    `void` | `versionTestClearWithConcurrentEventsAsync()`
    `void` | `versionTestConcurrentEvents()` This tests the concurrency versioning system to ensure that event conflation happens correctly and that the statistic is being updated properly
    `void` | `versionTestConcurrentEventsOnEmptyRegion()` This tests the concurrency versioning system to ensure that event conflation happens correctly and that the statistic is being updated properly
    `void` | `versionTestConcurrentEventsOnNonReplicatedRegion()` This tests the concurrency versioning system to ensure that event conflation happens correctly and that the statistic is being updated properly
    `void` | `versionTestGetAllWithVersions()`
    `void` | `versionTestGIISendsTombstones()`
    `void` | `versionTestTombstones()`

    - ### Methods inherited from class org.apache.geode.cache30.RegionTestCase

      `createRegion, createRootRegion, entryIsLocal, flushIfNecessary, getRegionAttributes, pauseIfNecessary, pauseIfNecessary, postTearDownCacheTestCase, remoteTestPostSnapshot, supportsLocalDestroyAndLocalInvalidate, supportsSubregions, testBadRegionAccess, testCloseRegion, testContainsKey, testCreateSubregions, testCustomEntryIdleReset, testCustomEntryIdleTimeout1, testCustomEntryIdleTimeout2, testCustomEntryIdleTimeout3, testCustomEntryTtl1, testCustomEntryTtl2, testCustomEntryTtl3, testCustomIdleOnce, testDestroyEntry, testDestroyRegion, testEntries, testEntriesRecursive, testEntryExpirationAfterMutate, testEntryFromLoadTtlInvalidate, testEntryIdleDestroy, testEntryIdleInvalidate, testEntryIdleReset, testEntryIdleTimeout3, testEntryIdleTtl, testEntryTtl3, testEntryTtlDestroy, testEntryTtlInvalidate, testEntryUserAttribute, testGetCache, testGetName, testGetParentRegion, testGetPathFromRoot, testInvalidateEntry, testInvalidateRegion, testKeys, testLocalDestroyEntry, testLocalDestroyRegion, testLocalInvalidateEntry, testLocalInvalidateRegion, testNulls, testPutNonExistentEntry, testRegionExpirationAfterMutate, testRegionIdleDestroy, testRegionIdleInvalidate, testRegionTtlDestroy, testRegionTtlInvalidate, testRegionUserAttribute, testRootSnapshot, testSnapshot, testSubregions, testSubregionsRecursive, testValues, waitForDestroy, waitForDestroy, waitForInvalidate, waitForInvalidate, waitForRegionDestroy`

    - ### Methods inherited from class org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase

      `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`

    - ### Methods inherited from class org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase

      `basicGetSystem, cleanDiskDirs, cleanupAllVms, deleteBACKUPDiskStoreFile, destroyRegions, disconnectAllFromDS, disconnectFromDS, getBlackboard, getLonerSystem, getName, getSystem, getSystem, getSystemStatic, getTestClass, getTestMethodName, getUniqueName, initializeBlackboard, initializeDistributedTestCase, isConnectedToDS, nullSystem, postSetUp, postTearDown, postTearDownAssertions, preSetUp, preTearDownAssertions, setSystem, setUpDistributedTestCase, tearDownDistributedTestCase`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.geode.test.dunit.internal.DistributedTestFixture

      `getName, postSetUp, postTearDown, postTearDownAssertions, preSetUp, preTearDownAssertions`

- - ### Constructor Detail

    - #### MultiVMRegionTestCase

          public MultiVMRegionTestCase()

  - ### Method Detail

    - #### loader

          protected static <K,V> TestCacheLoader<K,V> loader()

    - #### setLoader

          protected static <K,V> void setLoader(TestCacheLoader<K,V> loader)

    - #### caseTearDown

          public static void caseTearDown()

    - #### postTearDownRegionTestCase

          protected final void postTearDownRegionTestCase()
                                                   throws java.lang.Exception

      Overrides:
        `postTearDownRegionTestCase` in class `RegionTestCase`
      Throws:
        `java.lang.Exception`

    - #### getDistributedSystemProperties

          public java.util.Properties getDistributedSystemProperties()

      Specified by:
        `getDistributedSystemProperties` in interface `org.apache.geode.test.dunit.internal.DistributedTestFixture`
      Overrides:
        `getDistributedSystemProperties` in class `org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase`

    - #### testConcurrentOperations

          public void testConcurrentOperations()

      This is a for the ConcurrentMap operations. 4 VMs are used to create the region and operations are performed on one of the nodes

    - #### testDistributedUpdate

          public void testDistributedUpdate()

      Tests that doing a `put` in a distributed region one VM updates the value in another VM.

    - #### testOrderedUpdates

          public void testOrderedUpdates()
                                  throws java.lang.Exception

      Verifies that distributed updates are delivered in order.

      Note that this test does not make sense for regions that are `Scope.DISTRIBUTED_NO_ACK` for which we do not guarantee the ordering of updates for a single producer/single consumer.

      Throws:
        `java.lang.Exception`

    - #### testDistributedGet

          public void testDistributedGet()

      Tests that doing a distributed get results in a `netSearch`.

    - #### testDistributedPutNoUpdate

          public void testDistributedPutNoUpdate()
                                          throws java.lang.Exception

      Tests that doing a `put` on a distributed region in one VM does not effect a region in a different VM that does not have that key defined.
      Throws:
        `java.lang.Exception`

    - #### testDefinedEntryUpdated

          public void testDefinedEntryUpdated()

      Two VMs create a region. One populates a region entry. The other VM defines that entry. The first VM updates the entry. The second VM should see the updated value.

    - #### testDistributedDestroy

          public void testDistributedDestroy()

      Tests that destroying an entry is propagated to all VMs that define that entry.

    - #### testDistributedRegionDestroy

          public void testDistributedRegionDestroy()

      Tests that destroying a region is propagated to all VMs that define that region.

    - #### testLocalDestroy

          public void testLocalDestroy()
                                throws java.lang.Exception

      Tests that a Region.localDestroy(java.lang.Object) does not effect other VMs that define that entry.
      Throws:
        `java.lang.Exception`

    - #### testLocalRegionDestroy

          public void testLocalRegionDestroy()
                                      throws java.lang.Exception

      Tests that a `Region.localDestroyRegion()` is not propagated to other VMs that define that region.
      Throws:
        `java.lang.Exception`

    - #### testDistributedInvalidate

          public void testDistributedInvalidate()

      Tests that invalidating an entry is propagated to all VMs that define that entry.

    - #### testDistributedInvalidate4

          public void testDistributedInvalidate4()

      Tests that invalidating an entry in multiple VMs does not cause any problems.

    - #### testDistributedRegionInvalidate

          public void testDistributedRegionInvalidate()

      Tests that invalidating a region is propagated to all VMs that define that entry.

    - #### testRemoteCacheListener

          public void testRemoteCacheListener()

      Tests that a `CacheListener` is invoked in a remote VM.

    - #### testRemoteCacheListenerInSubregion

          public void testRemoteCacheListenerInSubregion()

      Tests that a `CacheListener` is invoked in a remote VM.

    - #### supportsNetLoad

          protected boolean supportsNetLoad()

      Indicate whether this region supports netload
      Returns:
        true if it supports netload

    - #### testRemoteCacheLoader

          public void testRemoteCacheLoader()

      Tests that a `CacheLoader` is invoked in a remote VM. This essentially tests `netLoad`.

    - #### testRemoteCacheLoaderArg

          public void testRemoteCacheLoaderArg()

      Tests that the parameter passed to a remote `CacheLoader` is actually passed.

    - #### testRemoteCacheLoaderException

          public void testRemoteCacheLoaderException()

      Tests that a remote `CacheLoader` that throws a `CacheLoaderException` results is propagated back to the caller.

    - #### testCacheLoaderWithNetSearch

          public void testCacheLoaderWithNetSearch()

    - #### testCacheLoaderWithNetLoad

          public void testCacheLoaderWithNetLoad()

    - #### testNoRemoteCacheLoader

          public void testNoRemoteCacheLoader()

      Tests that `Region.get(java.lang.Object)` returns `null` when there is no remote loader.

    - #### testNoLoaderWithInvalidEntry

          public void testNoLoaderWithInvalidEntry()

      Tests that a remote `CacheLoader` is not invoked if the remote region has an invalid entry (that is, a key, but no value).

    - #### testRemoteCacheWriter

          public void testRemoteCacheWriter()

      Tests that a remote `CacheWriter` is invoked and that `CacheWriter` arguments and `CacheWriterException`s are propagated appropriately.

    - #### testLocalAndRemoteCacheWriters

          public void testLocalAndRemoteCacheWriters()

      Tests that, when given a choice, a local `CacheWriter` is invoked instead of a remote one.

    - #### testCacheLoaderModifyingArgument

          public void testCacheLoaderModifyingArgument()

      Tests that when a `CacheLoader` modifies the callback argument in place, the change is visible to the `CacheWriter` even if it is in another VM.

    - #### testRemoteLoaderNetSearch

          public void testRemoteLoaderNetSearch()

      Tests that invoking `netSearch` in a remote loader returns `null` instead of causing infinite recursion.

    - #### testLocalCacheLoader

          public void testLocalCacheLoader()

      Tests that a local loader is preferred to a remote one

    - #### testDistributedPut

          public void testDistributedPut()

      Tests that an entry update is propagated to other caches that have that same entry defined.

    - #### supportsReplication

          protected boolean supportsReplication()

      Indicate whether replication/GII supported
      Returns:
        true if replication is supported

    - #### testReplicate

          public void testReplicate()

      Tests that keys and values are pushed with `DataPolicy.REPLICATE`.

    - #### testGetInitialImage

          public void testGetInitialImage()

      Tests that a newly-created mirrored region contains all of the entries of another region.

    - #### testLargeGetInitialImage

          public void testLargeGetInitialImage()

      Tests that a newly-created mirrored region contains all of the entries of another region, with a large quantity of data.

    - #### testMirroredDataFromNonMirrored

          public void testMirroredDataFromNonMirrored()

      Tests that a mirrored region gets data pushed to it from a non-mirrored region and the afterCreate event is invoked on a listener.

    - #### testNoMirroredDataToNonMirrored

          public void testNoMirroredDataToNonMirrored()

      Tests that a mirrored region does not push data to a non-mirrored region.

    - #### testMirroredLocalLoad

          public void testMirroredLocalLoad()

      Tests that a local load occurs, even with mirroring

    - #### testMirroredNetLoad

          public void testMirroredNetLoad()

      Tests sure that a `netLoad` occurs, even with mirroring

    - #### testNoRegionKeepAlive

          public void testNoRegionKeepAlive()

      Tests that a region is not kept alive

    - #### testNetSearchObservesTtl

          public void testNetSearchObservesTtl()

    - #### testNetSearchObservesIdleTime

          public void testNetSearchObservesIdleTime()

    - #### testEntryTtlDestroyEvent

          public void testEntryTtlDestroyEvent()

      Tests that an entry in a distributed region that expires with a distributed destroy causes an event in other VM with isExpiration flag set.

    - #### testEntryTtlLocalDestroy

          public void testEntryTtlLocalDestroy()
                                        throws java.lang.Exception

      Tests that an entry in a distributed region expires with a local destroy after a given time to live.
      Throws:
        `java.lang.Exception`

    - #### testUpdateResetsIdleTime

          public void testUpdateResetsIdleTime()

      Tests to makes sure that a distributed update resets the expiration timer.

    - #### testNonblockingGetInitialImage

          public void testNonblockingGetInitialImage()

      Tests that distributed ack operations do not block while another cache is doing a getInitialImage.

    - #### testTXNonblockingGetInitialImage

          public void testTXNonblockingGetInitialImage()

      Tests that distributed ack operations do not block while another cache is doing a getInitialImage.

    - #### testNBRegionInvalidationDuringGetInitialImage

          public void testNBRegionInvalidationDuringGetInitialImage()
                                                             throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### testNBRegionDestructionDuringGetInitialImage

          public void testNBRegionDestructionDuringGetInitialImage()

    - #### testNoDataSerializer

          public void testNoDataSerializer()

      Tests what happens when one VM attempts to read an object for which it does not have a registered `DataSerializer`.
      Since:
        GemFire 3.5

    - #### testNoInstantiator

          public void testNoInstantiator()

      Tests what happens when one VM attempts to read an object for which it does not have a registered `Instantiator`.
      Since:
        GemFire 3.5

    - #### testTXSimpleOps

          public void testTXSimpleOps()

      Tests that an entry update is propagated to other caches that have that same entry defined.

    - #### supportsTransactions

          protected boolean supportsTransactions()

      Indicate whether this region supports transactions
      Returns:
        true if it supports transactions

    - #### testTXUpdateLoadNoConflict

          public void testTXUpdateLoadNoConflict()

      Tests that the push of a loaded value does not cause a conflict on the side receiving the update

    - #### testTXMultiRegion

          public void testTXMultiRegion()

    - #### testTXRmtMirror

          public void testTXRmtMirror()

    - #### testTXAlgebra

          public void testTXAlgebra()

    - #### getRegionAttributes

          protected <K,V> RegionAttributes<K,V> getRegionAttributes(java.lang.String type)

      return the region attributes for the given type of region. See GemFireCache.getRegionAttributes(String). Subclasses are expected to reimplement this method. See DistributedAckRegionCCEDUnitTest.getRegionAttributes(String).

    - #### versionTestGIISendsTombstones

          public void versionTestGIISendsTombstones()

    - #### versionTestConcurrentEvents

          public void versionTestConcurrentEvents()
                                           throws java.lang.Exception

      This tests the concurrency versioning system to ensure that event conflation happens correctly and that the statistic is being updated properly
      Throws:
        `java.lang.Exception`

    - #### createRegionWithAttribute

          protected void createRegionWithAttribute(org.apache.geode.test.dunit.VM vm,
                                                   java.lang.String name,
                                                   boolean syncDiskWrite)

    - #### versionTestClearWithConcurrentEvents

          public void versionTestClearWithConcurrentEvents()

    - #### versionTestClearWithConcurrentEventsAsync

          public void versionTestClearWithConcurrentEventsAsync()

    - #### versionTestClearOnNonReplicateWithConcurrentEvents

          public void versionTestClearOnNonReplicateWithConcurrentEvents()

    - #### versionTestTombstones

          public void versionTestTombstones()

    - #### versionTestConcurrentEventsOnEmptyRegion

          public void versionTestConcurrentEventsOnEmptyRegion()

      This tests the concurrency versioning system to ensure that event conflation happens correctly and that the statistic is being updated properly

    - #### doOpsLoopNoFlush

          public static void doOpsLoopNoFlush(int runTimeMs,
                                              boolean includeClear,
                                              boolean includePutAll)

    - #### versionTestConcurrentEventsOnNonReplicatedRegion

          public void versionTestConcurrentEventsOnNonReplicatedRegion()

      This tests the concurrency versioning system to ensure that event conflation happens correctly and that the statistic is being updated properly

    - #### versionTestGetAllWithVersions

          public void versionTestGetAllWithVersions()

    - #### getRepeatTimeoutMs

          protected long getRepeatTimeoutMs()

      The number of milliseconds to try repeating validation code in the event that AssertionError is thrown. For ACK scopes, no repeat should be necessary.

    - #### getCCRegionContents

          public static java.util.Map getCCRegionContents()