* Note: shamelessly cloned from ManagerBase - beware of synch issues
* on the underlying sessions.
*/
private void doImminentSessionTimeout(Context activeContext) {
ManagerBase manager = (ManagerBase) activeContext.getManager();
Session[] sessions = manager.findSessions();
for (int i = 0; i < sessions.length; i++) {
if (sessions[i]!=null && sessions[i].isValid()) {
sessions[i].setMaxInactiveInterval(EXTRA_DELAY_SECS);
// leave it to be expired by the manager
}
}
try {
Thread.sleep(EXTRA_DELAY_SECS * 1000);
} catch (InterruptedException ie) {
// ignored
}
// Paranoid verification that active sessions have now gone
int count = 0;
sessions = manager.findSessions();
while (sessions.length != 0 && count < TIMEOUT_WAIT_SECS) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// Ignore
}
sessions = manager.findSessions();
count++;
}
sessions = manager.findSessions();
assertTrue(sessions.length == 0);
}