/** * Create a VaadinSession * @param locale Client locale * @return VaadinSession instance * @throws Exception Failed to create session */ protected VaadinSession createVaadinSession(Locale locale) throws Exception { WrappedSession wrappedSession = mock(WrappedSession.class); VaadinServletService vaadinService = mock(VaadinServletService.class); when(vaadinService.getDeploymentConfiguration()) .thenReturn(new DefaultDeploymentConfiguration(VaadinServletService.class, getDeploymentProperties())); VaadinSession session = mock(VaadinSession.class); when(session.getState()).thenReturn(VaadinSession.State.OPEN); when(session.getSession()).thenReturn(wrappedSession); when(session.getService()).thenReturn(vaadinService); when(session.getSession().getId()).thenReturn(TEST_SESSION_ID); when(session.hasLock()).thenReturn(true); when(session.getLocale()).thenReturn(locale != null ? locale : Locale.US); return session; }
public TestSpringVaadinServletService(VaadinServlet servlet, WebApplicationContext applicationContext) throws ServiceException { super(servlet, new DefaultDeploymentConfiguration(TestSpringVaadinServletService.class, new Properties()), ""); this.appContext = applicationContext; init(); }
private DefaultDeploymentConfiguration createDeploymentConfiguration() { return new DefaultDeploymentConfiguration(getClass(), initProperties()); }
public VertxVaadinService(VertxVaadin vertxVaadin, DefaultDeploymentConfiguration deploymentConfiguration) { super(deploymentConfiguration); this.vertxVaadin = vertxVaadin; }