Class 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
    • Constructor Detail

      • MemberCacheControlTest

        public MemberCacheControlTest()
      • MemberCacheControlTest

        public MemberCacheControlTest​(java.lang.String name)
    • 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 class FoodMartTestCase
        Throws:
        java.lang.Exception
      • 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 context
        cubeName - Cube name
        names - the full-qualified Member name
        Returns:
        the Member
        Throws:
        MondrianException - when not found.
      • 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.