Class AbstractSessionDataStoreTest


  • public abstract class AbstractSessionDataStoreTest
    extends java.lang.Object
    AbstractSessionDataStoreTest
    • Field Detail

      • GRACE_PERIOD_SEC

        public static final int GRACE_PERIOD_SEC
      • ANCIENT_TIMESTAMP

        public static final long ANCIENT_TIMESTAMP
        A timestamp representing a time that was close to the epoch, and thus happened a long time ago. Used as expiry timestamp for to signify a session is expired.
        See Also:
        Constant Field Values
      • RECENT_TIMESTAMP

        public static final long RECENT_TIMESTAMP
      • _contextClassLoader

        protected java.net.URLClassLoader _contextClassLoader
    • Constructor Detail

      • AbstractSessionDataStoreTest

        public AbstractSessionDataStoreTest()
    • Method Detail

      • persistSession

        public abstract void persistSession​(SessionData data)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • persistUnreadableSession

        public abstract void persistUnreadableSession​(SessionData data)
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • checkSessionExists

        public abstract boolean checkSessionExists​(SessionData data)
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • checkSessionPersisted

        public abstract boolean checkSessionPersisted​(SessionData data)
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testStoreSession

        @Test
        public void testStoreSession()
                              throws java.lang.Exception
        Test that the store can persist a session. The session uses an attribute class that is only known to the webapp classloader. This tests that we use the webapp loader when we serialize the session data (ie save the session).
        Throws:
        java.lang.Exception
      • testUpdateSession

        @Test
        public void testUpdateSession()
                               throws java.lang.Exception
        Test that the store can update a pre-existing session.
        Throws:
        java.lang.Exception
      • testStoreObjectAttributes

        @Test
        public void testStoreObjectAttributes()
                                       throws java.lang.Exception
        Test that the store can persist a session that contains serializable Proxy objects in the attributes.
        Throws:
        java.lang.Exception
      • testLoadSessionExists

        @Test
        public void testLoadSessionExists()
                                   throws java.lang.Exception
        Test that we can load a persisted session.
        Throws:
        java.lang.Exception
      • testLoadSessionExpired

        @Test
        public void testLoadSessionExpired()
                                    throws java.lang.Exception
        Test that an expired session can be loaded.
        Throws:
        java.lang.Exception
      • testLoadSessionDoesNotExist

        @Test
        public void testLoadSessionDoesNotExist()
                                         throws java.lang.Exception
        Test that a non-existent session cannot be loaded.
        Throws:
        java.lang.Exception
      • testLoadSessionFails

        @Test
        public void testLoadSessionFails()
                                  throws java.lang.Exception
        Test that a session that cannot be loaded throws exception.
        Throws:
        java.lang.Exception
      • testDeleteSessionExists

        @Test
        public void testDeleteSessionExists()
                                     throws java.lang.Exception
        Test that we can delete a persisted session.
        Throws:
        java.lang.Exception
      • testDeleteSessionDoesNotExist

        @Test
        public void testDeleteSessionDoesNotExist()
                                           throws java.lang.Exception
        Test deletion of non-existent session.
        Throws:
        java.lang.Exception
      • testGetExpiredPersistedAndExpired

        @Test
        public void testGetExpiredPersistedAndExpired()
                                               throws java.lang.Exception
        Test SessionDataStore.getExpired. Tests the situation where the session candidates are also expired in the store.
        Throws:
        java.lang.Exception
      • testGetExpiredPersistedNotExpired

        @Test
        public void testGetExpiredPersistedNotExpired()
                                               throws java.lang.Exception
        Test SessionDataStore.getExpired: tests the situation where the session candidates are not expired in the store.
        Throws:
        java.lang.Exception
      • testGetExpiredNotPersisted

        @Test
        public void testGetExpiredNotPersisted()
                                        throws java.lang.Exception
        Test SessionDataStore.getExpired: tests the situation where the session candidates don't exist in the store.
        Throws:
        java.lang.Exception
      • testGetExpiredPersistedAndExpiredOnly

        @Test
        public void testGetExpiredPersistedAndExpiredOnly()
                                                   throws java.lang.Exception
        Test SessionDataStore.getExpired: tests the situation where there are more persisted expired sessions in the store than present in the candidate list.
        Throws:
        java.lang.Exception
      • testGetExpiredDifferentNode

        @Test
        public void testGetExpiredDifferentNode()
                                         throws java.lang.Exception
        Test SessionDataStore.getExpired: tests the situation where there are sessions that are not in use on the node, but have expired and are last used by another node.
        Throws:
        java.lang.Exception
      • testExistsNotExpired

        @Test
        public void testExistsNotExpired()
                                  throws java.lang.Exception
        Test the exist() method with a session that does exist and is not expired
        Throws:
        java.lang.Exception
      • testExistsIsExpired

        @Test
        public void testExistsIsExpired()
                                 throws java.lang.Exception
        Test the exist() method with a session that does exist and is expired
        Throws:
        java.lang.Exception
      • testExistsNotExists

        @Test
        public void testExistsNotExists()
                                 throws java.lang.Exception
        Test the exist() method with a session that does not exist
        Throws:
        java.lang.Exception
      • testExistsDifferentContext

        @Test
        public void testExistsDifferentContext()
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSavePeriodOnUpdate

        @Test
        public void testSavePeriodOnUpdate()
                                    throws java.lang.Exception
        Test setting a save period to avoid writes when the attributes haven't changed.
        Throws:
        java.lang.Exception
      • testSavePeriodOnCreate

        @Test
        public void testSavePeriodOnCreate()
                                    throws java.lang.Exception
        Check that a session that has never previously been saved will be saved despite the savePeriod setting.
        Throws:
        java.lang.Exception
      • testSavePeriodDirtySession

        @Test
        public void testSavePeriodDirtySession()
                                        throws java.lang.Exception
        Check that a session whose attributes have changed will always be saved despite the savePeriod
        Throws:
        java.lang.Exception