use of org.eclipse.scout.rt.testing.server.TestHttpSession in project scout.rt by eclipse.
the class ServerSessionCacheTest method testMultipleHttpSessions.
/**
* If there are multiple HTTP sessions (can happen, if many requests are created in parallel for the same sessionId),
* but a single sessionId, a new server session should only be created once.
*/
@Test
public void testMultipleHttpSessions() {
TestHttpSession httpSession1 = new TestHttpSession();
TestHttpSession httpSession2 = new TestHttpSession();
IServerSessionLifecycleHandler handler = new TestServerSessionLifecycleHandler();
IServerSession session1 = BEANS.get(ServerSessionCache.class).getOrCreate(handler, httpSession1);
IServerSession session2 = BEANS.get(ServerSessionCache.class).getOrCreate(handler, httpSession2);
assertSame(session1, session2);
}
Aggregations