mondrian.test
Class CacheTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by mondrian.test.FoodMartTestCase
              extended by mondrian.test.CacheTest
All Implemented Interfaces:
junit.framework.Test

public class CacheTest
extends FoodMartTestCase

Cunning tests to discover whether the cache manager is working to spec and is thread-safe.

Author:
Julian Hyde

Nested Class Summary
 
Nested classes/interfaces inherited from class mondrian.test.FoodMartTestCase
FoodMartTestCase.QueryAndResult
 
Field Summary
 
Fields inherited from class mondrian.test.FoodMartTestCase
propSaver
 
Constructor Summary
CacheTest()
           
 
Method Summary
 void testNQueriesWaitingForSameSegmentRepeat()
          Tests that if N queries are executed at the same time, only one segment request will be sent.
 
Methods inherited from class mondrian.test.FoodMartTestCase
allMember, assertAxisReturns, assertAxisThrows, assertBooleanExprReturns, assertExprReturns, assertExprThrows, assertQueriesReturnSimilarResults, assertQueryReturns, assertQueryThrows, assertSize, cubeByName, execute, executeExpr, executeQuery, executeSingletonAxis, genderMembersIncludingAll, getConnection, getDimensionWithName, getTestContext, isDefaultNullMemberRepresentation, isGroupingSetsSupported, member, productMembersPotScrubbersPotsAndPans, storeMembersCAAndOR, storeMembersUsaAndCanada, tearDown, warehouseMembersCanadaMexicoUsa
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheTest

public CacheTest()
Method Detail

testNQueriesWaitingForSameSegmentRepeat

public void testNQueriesWaitingForSameSegmentRepeat()
                                             throws ExecutionException,
                                                    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:
ExecutionException
InterruptedException

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads