Class DefaultSearchRestrictionServiceDemoTest

    • Constructor Detail

      • DefaultSearchRestrictionServiceDemoTest

        public DefaultSearchRestrictionServiceDemoTest()
    • Method Detail

      • setUp

        public void setUp()
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • tearDown

        public void tearDown()
      • createAndAddSessionSearchRestriction

        public void createAndAddSessionSearchRestriction()
        Demonstrates how to create SessionSearchRestriction object and add it to the session.

        Test scenario:

        - prepare SessionSearchRestriction object
        - add session search restriction with usage of SearchRestrictionService#addSessionSearchRestrictions(java.util.Collection) method

      • clearSessionSearchRestriction

        public void clearSessionSearchRestriction()
        Demonstrates how to clear all registered session search restrictions.

        Test scenario:

        - prepare SessionSearchRestriction object
        - add session search restriction with usage of SearchRestrictionService#addSessionSearchRestrictions(java.util.Collection) method
        - clear session search restrictions

      • removeSessionSearchRestriction

        public void removeSessionSearchRestriction()
        Demonstrates how to remove few session search restrictions from list of registered session search restrictions.

        Test scenario:

        - prepare SessionSearchRestriction objects
        - add session search restriction with usage of SearchRestrictionService#addSessionSearchRestrictions(java.util.Collection) method
        - remove one session search restriction from list of registered session search restrictions.

      • enableAndDisableSearchRestriction

        public void enableAndDisableSearchRestriction()
        Demonstrates how enable and disable search restrictions (both - session and persistent model based restrictions).

        Test scenario:

        - check whether restrictions are enabled
        - disable restrictions
        - check whether restrictions are disabled
        - enable restrictions again
        - check whether restrictions are enabled

      • checkSearchRestrictionCreateAndGetSearchRestrictionsForType

        public void checkSearchRestrictionCreateAndGetSearchRestrictionsForType()
        Demonstrates how to check whether type has restrictions then create model based restrictions for some type and next obtain them from that type.

        Test scenario:
        - check whether model has some restrictions
        - create restrictions for type
        - get restrictions from model