Package mondrian.test

Class CacheTest


  • public class CacheTest
    extends FoodMartTestCase
    Cunning tests to discover whether the cache manager is working to spec and is thread-safe.
    Author:
    Julian Hyde
    • Constructor Detail

      • CacheTest

        public CacheTest()
    • Method Detail

      • testNQueriesWaitingForSameSegmentRepeat

        public void testNQueriesWaitingForSameSegmentRepeat()
                                                     throws java.util.concurrent.ExecutionException,
                                                            java.lang.InterruptedException
        Tests that if N queries are executed at the same time, only one segment request will be sent. The query that arrives second should see that there is a pending segment in the aggregation manager, and should wait for that.

        If the test fails, look at segmentCreateViaSqlCount. If it has increased by more than one between before and after, the clients have not managed to share work. If it has not increased, the cache was probably not flushed correctly.

        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException