Package org.eclipse.jetty.server.session
Class AbstractSessionDataStoreTest
- java.lang.Object
-
- org.eclipse.jetty.server.session.AbstractSessionDataStoreTest
-
public abstract class AbstractSessionDataStoreTest extends java.lang.ObjectAbstractSessionDataStoreTest
-
-
Field Summary
Fields Modifier and Type Field Description protected java.net.URLClassLoader_contextClassLoaderstatic longANCIENT_TIMESTAMPA timestamp representing a time that was close to the epoch, and thus happened a long time ago.static intGRACE_PERIOD_SECstatic longRECENT_TIMESTAMP
-
Constructor Summary
Constructors Constructor Description AbstractSessionDataStoreTest()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleancheckSessionExists(SessionData data)abstract booleancheckSessionPersisted(SessionData data)abstract SessionDataStoreFactorycreateSessionDataStoreFactory()abstract voidpersistSession(SessionData data)abstract voidpersistUnreadableSession(SessionData data)voidtestDeleteSessionDoesNotExist()Test deletion of non-existent session.voidtestDeleteSessionExists()Test that we can delete a persisted session.voidtestExistsDifferentContext()voidtestExistsIsExpired()Test the exist() method with a session that does exist and is expiredvoidtestExistsNotExists()Test the exist() method with a session that does not existvoidtestExistsNotExpired()Test the exist() method with a session that does exist and is not expiredvoidtestGetExpiredDifferentNode()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.voidtestGetExpiredNotPersisted()Test SessionDataStore.getExpired: tests the situation where the session candidates don't exist in the store.voidtestGetExpiredPersistedAndExpired()Test SessionDataStore.getExpired.voidtestGetExpiredPersistedAndExpiredOnly()Test SessionDataStore.getExpired: tests the situation where there are more persisted expired sessions in the store than present in the candidate list.voidtestGetExpiredPersistedNotExpired()Test SessionDataStore.getExpired: tests the situation where the session candidates are not expired in the store.voidtestLoadSessionDoesNotExist()Test that a non-existent session cannot be loaded.voidtestLoadSessionExists()Test that we can load a persisted session.voidtestLoadSessionExpired()Test that an expired session can be loaded.voidtestLoadSessionFails()Test that a session that cannot be loaded throws exception.voidtestSavePeriodDirtySession()Check that a session whose attributes have changed will always be saved despite the savePeriodvoidtestSavePeriodOnCreate()Check that a session that has never previously been saved will be saved despite the savePeriod setting.voidtestSavePeriodOnUpdate()Test setting a save period to avoid writes when the attributes haven't changed.voidtestStoreObjectAttributes()Test that the store can persist a session that contains serializable Proxy objects in the attributes.voidtestStoreSession()Test that the store can persist a session.voidtestUpdateSession()Test that the store can update a pre-existing session.
-
-
-
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
-
-
Method Detail
-
createSessionDataStoreFactory
public abstract SessionDataStoreFactory createSessionDataStoreFactory()
-
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.ExceptionTest 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.ExceptionTest that the store can update a pre-existing session.- Throws:
java.lang.Exception
-
testStoreObjectAttributes
@Test public void testStoreObjectAttributes() throws java.lang.ExceptionTest 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.ExceptionTest that we can load a persisted session.- Throws:
java.lang.Exception
-
testLoadSessionExpired
@Test public void testLoadSessionExpired() throws java.lang.ExceptionTest that an expired session can be loaded.- Throws:
java.lang.Exception
-
testLoadSessionDoesNotExist
@Test public void testLoadSessionDoesNotExist() throws java.lang.ExceptionTest that a non-existent session cannot be loaded.- Throws:
java.lang.Exception
-
testLoadSessionFails
@Test public void testLoadSessionFails() throws java.lang.ExceptionTest that a session that cannot be loaded throws exception.- Throws:
java.lang.Exception
-
testDeleteSessionExists
@Test public void testDeleteSessionExists() throws java.lang.ExceptionTest that we can delete a persisted session.- Throws:
java.lang.Exception
-
testDeleteSessionDoesNotExist
@Test public void testDeleteSessionDoesNotExist() throws java.lang.ExceptionTest deletion of non-existent session.- Throws:
java.lang.Exception
-
testGetExpiredPersistedAndExpired
@Test public void testGetExpiredPersistedAndExpired() throws java.lang.ExceptionTest 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.ExceptionTest 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.ExceptionTest 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.ExceptionTest 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.ExceptionTest 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.ExceptionTest 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.ExceptionTest the exist() method with a session that does exist and is expired- Throws:
java.lang.Exception
-
testExistsNotExists
@Test public void testExistsNotExists() throws java.lang.ExceptionTest 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.ExceptionTest 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.ExceptionCheck 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.ExceptionCheck that a session whose attributes have changed will always be saved despite the savePeriod- Throws:
java.lang.Exception
-
-