Package mondrian.rolap
Class MemberCacheControlTest
- java.lang.Object
-
- TestCase
-
- mondrian.test.FoodMartTestCase
-
- mondrian.rolap.MemberCacheControlTest
-
public class MemberCacheControlTest extends FoodMartTestCase
Unit tests for flushing member cache and editing cached member properties.The purpose of the cache control API is to clear the cache so that changes made to the DBMS can be seen. However, it is difficult to write tests that modify the database. So these tests just check that the relevant caches have been cleared. It is assumed that the updated values will be loaded next time mondrian goes to the database.
- Since:
- Jan 2008
- Author:
- mberkowitz
-
-
Field Summary
-
Fields inherited from class mondrian.test.FoodMartTestCase
propSaver
-
-
Constructor Summary
Constructors Constructor Description MemberCacheControlTest()
MemberCacheControlTest(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static RolapMember
findMember(TestContext tc, java.lang.String cubeName, java.lang.String... names)
Finds a Member by its name and the name of its containing cube.(package private) DiffRepository
getDiffRepos()
TestContext
getTestContext()
Returns the test context.protected void
setUp()
protected void
tearDown()
void
testAddCommand()
void
testAddCommandNegative()
Tests a variety of negative cases including add/delete/move null members add/delete/move members in parent-child hierarchies.void
testDeleteCommand()
void
testFilter()
Tests operations on member sets, in particular theCacheControl.filter(mondrian.olap.Level, mondrian.olap.CacheControl.MemberSet)
method.void
testFlushHierarchy()
Test case for bug MONDRIAN-1076, "Add CacheControl API to flush members from dimension cache".void
testMemberOpsFailIfCacheEnabled()
Tests that member operations fail if cache is enabled.void
testMoveCommand()
void
testMoveFailBadLevel()
void
testSetPropertyCommandOnLeafMember()
Test that edits the properties of a single leaf Member.void
testSetPropertyCommandOnNonLeafMember()
Test that edits properties of Members at various Levels (use Retail Dimension), but leaves grouping unchanged, so results not changed.-
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, isDefaultNullMemberRepresentation, isGroupingSetsSupported, member, productMembersPotScrubbersPotsAndPans, storeMembersCAAndOR, storeMembersUsaAndCanada, verifySameNativeAndNot, warehouseMembersCanadaMexicoUsa
-
-
-
-
Method Detail
-
setUp
protected void setUp() throws java.lang.Exception
- Throws:
java.lang.Exception
-
tearDown
protected void tearDown() throws java.lang.Exception
- Overrides:
tearDown
in classFoodMartTestCase
- Throws:
java.lang.Exception
-
getDiffRepos
DiffRepository getDiffRepos()
-
getTestContext
public TestContext getTestContext()
Description copied from class:FoodMartTestCase
Returns the test context. Override this method if you wish to use a different source for your FoodMart connection.- Overrides:
getTestContext
in classFoodMartTestCase
-
findMember
protected static RolapMember findMember(TestContext tc, java.lang.String cubeName, java.lang.String... names)
Finds a Member by its name and the name of its containing cube.- Parameters:
tc
- Test contextcubeName
- Cube namenames
- the full-qualified Member name- Returns:
- the Member
- Throws:
MondrianException
- when not found.
-
testFilter
public void testFilter()
Tests operations on member sets, in particular theCacheControl.filter(mondrian.olap.Level, mondrian.olap.CacheControl.MemberSet)
method.
-
testMemberOpsFailIfCacheEnabled
public void testMemberOpsFailIfCacheEnabled()
Tests that member operations fail if cache is enabled.
-
testSetPropertyCommandOnLeafMember
public void testSetPropertyCommandOnLeafMember()
Test that edits the properties of a single leaf Member.
-
testSetPropertyCommandOnNonLeafMember
public void testSetPropertyCommandOnNonLeafMember()
Test that edits properties of Members at various Levels (use Retail Dimension), but leaves grouping unchanged, so results not changed.
-
testAddCommand
public void testAddCommand()
-
testDeleteCommand
public void testDeleteCommand()
-
testMoveCommand
public void testMoveCommand()
-
testMoveFailBadLevel
public void testMoveFailBadLevel()
-
testAddCommandNegative
public void testAddCommandNegative()
Tests a variety of negative cases including add/delete/move null members add/delete/move members in parent-child hierarchies.
-
testFlushHierarchy
public void testFlushHierarchy()
Test case for bug MONDRIAN-1076, "Add CacheControl API to flush members from dimension cache".
-
-