From ddf73a0fce1e943b3aacf7e0791504c841ce3800 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Thu, 25 Apr 2013 15:32:50 +0300 Subject: Pass ServletConfig to atmosphere init (#11716) Furthermore, the exception that might get thrown from there is passed up through the call stack until it can be handled in a sensible way. Change-Id: I4a741b5ad4d9216255932c2328b49e73e92df2f4 --- .../server/TestAbstractApplicationServletStaticFilesLocation.java | 6 ++++-- server/tests/src/com/vaadin/server/VaadinSessionTest.java | 3 ++- .../src/com/vaadin/tests/server/TestStreamVariableMapping.java | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'server/tests') diff --git a/server/tests/src/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java b/server/tests/src/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java index c7330001d3..2a83f5d5b2 100644 --- a/server/tests/src/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java +++ b/server/tests/src/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java @@ -28,9 +28,11 @@ public class TestAbstractApplicationServletStaticFilesLocation extends TestCase // Workaround to avoid calling init and creating servlet config Field f = VaadinServlet.class.getDeclaredField("servletService"); f.setAccessible(true); - f.set(servlet, new VaadinServletService(servlet, + VaadinServletService service = new VaadinServletService(servlet, new DefaultDeploymentConfiguration(servlet.getClass(), - new Properties()))); + new Properties())); + service.init(); + f.set(servlet, service); } diff --git a/server/tests/src/com/vaadin/server/VaadinSessionTest.java b/server/tests/src/com/vaadin/server/VaadinSessionTest.java index 3f83fde711..8f471afd46 100644 --- a/server/tests/src/com/vaadin/server/VaadinSessionTest.java +++ b/server/tests/src/com/vaadin/server/VaadinSessionTest.java @@ -45,7 +45,7 @@ public class VaadinSessionTest { private UI ui; @Before - public void setup() { + public void setup() throws Exception { mockServlet = new VaadinServlet() { @Override public String getServletName() { @@ -55,6 +55,7 @@ public class VaadinSessionTest { mockService = new VaadinServletService(mockServlet, new MockDeploymentConfiguration()); + mockService.init(); mockHttpSession = EasyMock.createMock(HttpSession.class); mockWrappedSession = new WrappedHttpSession(mockHttpSession) { diff --git a/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java b/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java index 3ea114b488..bee932a29f 100644 --- a/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java +++ b/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java @@ -76,10 +76,12 @@ public class TestStreamVariableMapping extends TestCase { variableName)); } - private LegacyCommunicationManager createCommunicationManager() { + private LegacyCommunicationManager createCommunicationManager() + throws Exception { VaadinServletService vss = new VaadinServletService( EasyMock.createMock(VaadinServlet.class), new MockDeploymentConfiguration()); + vss.init(); return new LegacyCommunicationManager( new AlwaysLockedVaadinSession(vss)); } -- cgit v1.2.3