Class MultiThreadedDataValidityTest


  • @ContextConfiguration(locations="/test/MultiThreadedDataValidityTest-context.xml")
    @DirtiesContext(classMode=AFTER_CLASS)
    @PerformanceTest
    public class MultiThreadedDataValidityTest
    extends java.lang.Object
    • Constructor Detail

      • MultiThreadedDataValidityTest

        public MultiThreadedDataValidityTest()
    • 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.