mondrian.test
Class CacheHitTest

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

public class CacheHitTest
extends FoodMartTestCase

The CacheHitTest class contains test suites that return hit ratio of aggregation cache for various sequences of MDX queries.

This is not run as part of Main test suite as it only reports ratios for further investigations.

Author:
kvu

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
CacheHitTest()
           
 
Method Summary
 void clearCache(String cube)
          Clears aggregation cache
 void report(ServerInfo serverInfo)
          Prints cache hit ratio.
 void runRandomSuite(junit.framework.TestSuite suite, int n)
          Loops n times, each time run a random test case in the test suite
 void runTestSuiteInOrder(junit.framework.TestSuite suite, int numIter)
          Loops numIte times, each time run all child test suite in the suite
 void testBigSetRandom()
          Runs a set of bigger MDX queries that requires more memory and targets a bigger region of cache in random order.
 void testSmallSetRandom()
          Runs a set of small MDX queries that targets a small region of aggregation cache in random order.
 void testSmallSetSequential()
          Runs a set of small MDX queries that targets a small region of aggregation cache sequentially.
 void testSmallSetVCRandom()
          Runs a set of small MDX queries that targets a small region of aggregation cache in random order.
 void testSmallSetVCSequential()
          Runs a set of small MDX queries that targets a small region of aggregation cache sequentially.
 
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

CacheHitTest

public CacheHitTest()
Method Detail

testSmallSetSequential

public void testSmallSetSequential()
                            throws Exception
Runs a set of small MDX queries that targets a small region of aggregation cache sequentially. All queries reference the relational Sales cube.

Throws:
Exception - on error

testSmallSetRandom

public void testSmallSetRandom()
                        throws Exception
Runs a set of small MDX queries that targets a small region of aggregation cache in random order. All queries reference the relational Sales cube.

Throws:
Exception - on error

testSmallSetVCSequential

public void testSmallSetVCSequential()
                              throws Exception
Runs a set of small MDX queries that targets a small region of aggregation cache sequentially. All queries reference the virtual Warehouse and Sales cube.

Throws:
Exception - on error

testSmallSetVCRandom

public void testSmallSetVCRandom()
                          throws Exception
Runs a set of small MDX queries that targets a small region of aggregation cache in random order. All queries reference the virtual Warehouse and Sales cube.

Throws:
Exception - on error

testBigSetRandom

public void testBigSetRandom()
                      throws Exception
Runs a set of bigger MDX queries that requires more memory and targets a bigger region of cache in random order. Queries reference to Sales cube as well as Warehouse and Sales cube.

Throws:
Exception - on error

runRandomSuite

public void runRandomSuite(junit.framework.TestSuite suite,
                           int n)
                    throws Exception
Loops n times, each time run a random test case in the test suite

Parameters:
suite - the suite of test cases
n - number of times
Throws:
Exception - on error

runTestSuiteInOrder

public void runTestSuiteInOrder(junit.framework.TestSuite suite,
                                int numIter)
                         throws Exception
Loops numIte times, each time run all child test suite in the suite

Parameters:
suite - the suite of test suites
numIter - number of iterations
Throws:
Exception - on error

report

public void report(ServerInfo serverInfo)
Prints cache hit ratio.

Parameters:
serverInfo - Server statistics

clearCache

public void clearCache(String cube)
Clears aggregation cache

Parameters:
cube - Cube name

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