Class MultiThreadedDataValidityTest
- java.lang.Object
-
- de.hybris.platform.regioncache.test.MultiThreadedDataValidityTest
-
@ContextConfiguration(locations="/test/MultiThreadedDataValidityTest-context.xml") @DirtiesContext(classMode=AFTER_CLASS) @PerformanceTest public class MultiThreadedDataValidityTest extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected CacheControllercontrollerprotected CacheRegionregion
-
Constructor Summary
Constructors Constructor Description MultiThreadedDataValidityTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclean()static voidcleanEHCache()voidinit()voidtestCacheConsistencyNoStaleDataSingleWriter()This test tries to ensure if no "stale data" is read out of cache.
-
-
-
Field Detail
-
controller
protected CacheController controller
-
region
protected CacheRegion region
-
-
Method Detail
-
init
public void init()
-
clean
public void clean()
-
cleanEHCache
public static void cleanEHCache()
-
testCacheConsistencyNoStaleDataSingleWriter
public void testCacheConsistencyNoStaleDataSingleWriter()
This test tries to ensure if no "stale data" is read out of cache. Stale data means an "old" value is returned from the cache, although another thread has updated the value. The test executes for a fixed amount of time. All writer and reader activities are recorded. After the test finishes the collected data is analyzed to find out possible "stale data" reads.Writer: place a new data in the Cache. sleep for a fixed time. Invalidate cache data. Continue with new cache data.
Reader: Read a cache data and place it in result list.
-
-