From 1ba6dec41c2f02afbed81a1369c35e7a940c6720 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 5 Oct 2015 19:58:28 +0300 Subject: Move session store/load/remove logic to service from session (#9782, #18998) The session storage logic when implemented in VaadinSession was and must be partly static. This makes it impossible to override the storage logic. To be able to support storage customizations for portals (storing using APPLICATION_SCOPE), the logic was moved to VaadinService. For portals, all storage operations now use APPLICATION_SCOPE. Previously only the store operation was done using APPLICATION_SCOPE, leading to some portals not being able to load the session at all (the default scope for reading attributes in portals is PORTLET_SCOPE). Change-Id: I3d112608d98c883a457e650c0a25bf10c81acc78 --- server/tests/src/com/vaadin/server/VaadinPortletServiceTests.java | 2 +- server/tests/src/com/vaadin/server/VaadinSessionTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'server/tests/src/com') diff --git a/server/tests/src/com/vaadin/server/VaadinPortletServiceTests.java b/server/tests/src/com/vaadin/server/VaadinPortletServiceTests.java index 0e094bfabb..38f3b85043 100644 --- a/server/tests/src/com/vaadin/server/VaadinPortletServiceTests.java +++ b/server/tests/src/com/vaadin/server/VaadinPortletServiceTests.java @@ -200,7 +200,7 @@ public class VaadinPortletServiceTests { when(mockLock.isHeldByCurrentThread()).thenReturn(true); WrappedSession emptyWrappedSession = Mockito - .mock(WrappedSession.class); + .mock(WrappedPortletSession.class); when(emptyWrappedSession.getAttribute("null.lock")).thenReturn( mockLock); VaadinRequest requestWithUIIDSet = Mockito diff --git a/server/tests/src/com/vaadin/server/VaadinSessionTest.java b/server/tests/src/com/vaadin/server/VaadinSessionTest.java index fa7e892066..4944d37856 100644 --- a/server/tests/src/com/vaadin/server/VaadinSessionTest.java +++ b/server/tests/src/com/vaadin/server/VaadinSessionTest.java @@ -93,7 +93,7 @@ public class VaadinSessionTest { }; session = new VaadinSession(mockService); - session.storeInSession(mockService, mockWrappedSession); + mockService.storeSession(session, mockWrappedSession); ui = new UI() { Page page = new Page(this, getState(false).pageState) { -- cgit v1.2.3