Package mondrian.rolap
Class CacheControlTest
- java.lang.Object
-
- TestCase
-
- mondrian.test.FoodMartTestCase
-
- mondrian.rolap.CacheControlTest
-
public class CacheControlTest extends FoodMartTestCase
Unit-test for cache-flushing functionality.- Since:
- Sep 27, 2006
- Author:
- jhyde
-
-
Field Summary
-
Fields inherited from class mondrian.test.FoodMartTestCase
propSaver
-
-
Constructor Summary
Constructors Constructor Description CacheControlTest()Creates a CacheControlTest.CacheControlTest(String name)Creates a CacheControlTest with the given name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static voidassertContains(String pattern, String message)Asserts that a given string contains a given pattern.static voidflushCache(TestContext testContext)Flushes the entire contents of the cache.(package private) DiffRepositorygetDiffRepos()Returns the repository of result strings.(package private) CacheControl.CellRegionmemberRegion(String uniqueName)Helper method, creates a region consisting of a single member, given its unique name (e.g.voidtestCreateCellRegion()Tests creation of a cell region against an abstract implementation ofCacheControl.voidtestCrossjoin()Tests crossjoin of regions,CacheControl.createCrossjoinRegion(mondrian.olap.CacheControl.CellRegion...).voidtestFlush()Creates a cell region, runs a query, then flushes the cache.voidtestFlushNonPrimedContent()voidtestMondrian1094()voidtestNegative()A number of negative tests, trying to do invalid things with cache flushing and getting errors.voidtestNormalize()Tests the algorithm which converts a cache region specification into normal form.voidtestNormalize2()Creates a cell region, runs a query, then flushes the cache.voidtestPartialFlush()Creates a partial cell region, runs a query, then flushes the cache.voidtestPartialFlush_2()This is a test for MONDRIAN-1120voidtestPartialFlushRange()Creates a partial cell region over a range, runs a query, then flushes the cache.-
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, verifySameNativeAndNot, warehouseMembersCanadaMexicoUsa
-
-
-
-
Constructor Detail
-
CacheControlTest
public CacheControlTest()
Creates a CacheControlTest.
-
CacheControlTest
public CacheControlTest(String name)
Creates a CacheControlTest with the given name.
-
-
Method Detail
-
getDiffRepos
DiffRepository getDiffRepos()
Returns the repository of result strings.- Returns:
- repository of result strings
-
flushCache
public static void flushCache(TestContext testContext)
Flushes the entire contents of the cache. Utility method used to ensure that cache control tests are starting with a blank page.- Parameters:
testContext- Test context
-
testCreateCellRegion
public void testCreateCellRegion()
Tests creation of a cell region against an abstract implementation ofCacheControl.
-
testNormalize2
public void testNormalize2()
Creates a cell region, runs a query, then flushes the cache.
-
testFlush
public void testFlush()
Creates a cell region, runs a query, then flushes the cache.
-
testPartialFlush
public void testPartialFlush()
Creates a partial cell region, runs a query, then flushes the cache.
-
testPartialFlush_2
public void testPartialFlush_2() throws ExceptionThis is a test for MONDRIAN-1120SegmentCacheIndexImpl.intersects was not comparing the header column values to those of the cache region.
- Throws:
Exception
-
testPartialFlushRange
public void testPartialFlushRange()
Creates a partial cell region over a range, runs a query, then flushes the cache.
-
assertContains
static void assertContains(String pattern, String message)
Asserts that a given string contains a given pattern.- Parameters:
pattern- Pattern to findmessage- String- Throws:
junit.framework.AssertionFailedError- if pattern is not found
-
testNegative
public void testNegative()
A number of negative tests, trying to do invalid things with cache flushing and getting errors.
-
testCrossjoin
public void testCrossjoin()
Tests crossjoin of regions,CacheControl.createCrossjoinRegion(mondrian.olap.CacheControl.CellRegion...).
-
memberRegion
CacheControl.CellRegion memberRegion(String uniqueName)
Helper method, creates a region consisting of a single member, given its unique name (e.g. "[Gender].[F]").
-
testNormalize
public void testNormalize()
Tests the algorithm which converts a cache region specification into normal form.
-
testFlushNonPrimedContent
public void testFlushNonPrimedContent() throws ExceptionTest case for bug MONDRIAN-1077, "Cache flush for region that is not necessarily populated results in NullPointerException".- Throws:
Exception
-
-