项目:holon-vaadin
文件:AbstractVaadinTest.java
/**
* 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;
}
项目:holon-vaadin7
文件:AbstractVaadinTest.java
/**
* 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();
}
public TestSpringVaadinServletService(VaadinServlet servlet,"");
this.appContext = applicationContext;
init();
}
项目:vaadin-vertx-samples
文件:VertxVaadin.java
项目:vaadin-vertx-samples
文件:VertxVaadinService.java