Skip to content

Commit

Permalink
Issue #6309 remove duplicate commented out session test (#6310) (#6318)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Bartel <[email protected]>
  • Loading branch information
janbartel authored May 24, 2021
1 parent 04df6d4 commit 487e4e4
Showing 1 changed file with 0 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,51 +214,6 @@ public void run()
}
}

/**
* Test sessions are saved when shutdown with a store.
*/
/* @Test
public void testNoInvalidateOnShutdown()
throws Exception
{
Server server = new Server();
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/test");
context.setServer(server);
server.setHandler(context);
AbstractSessionCacheFactory cacheFactory = newSessionCacheFactory(SessionCache.NEVER_EVICT, false, false, false, false);
DefaultSessionCache cache = (DefaultSessionCache)cacheFactory.getSessionCache(context.getSessionHandler());
TestSessionDataStore store = new TestSessionDataStore(true);//fake passivation
cache.setSessionDataStore(store);
context.getSessionHandler().setSessionCache(cache);
server.start();
//put a session in the cache and store
long now = System.currentTimeMillis();
SessionData data = store.newSessionData("1234", now - 20, now - 10, now - 20, TimeUnit.MINUTES.toMillis(10));
Session session = cache.newSession(data);
TestSessionActivationListener listener = new TestSessionActivationListener();
cache.add("1234", session);
assertTrue(cache.contains("1234"));
session.setAttribute("aaa", listener);
cache.release("1234", session);
assertTrue(store.exists("1234"));
assertTrue(cache.contains("1234"));
server.stop(); //calls shutdown
assertTrue(store.exists("1234"));
assertFalse(cache.contains("1234"));
assertEquals(2, listener.passivateCalls);
assertEquals(1, listener.activateCalls);
}
*/

/**
* Test that a session id can be renewed.
*/
Expand Down

0 comments on commit 487e4e4

Please sign in to comment.