예제 #1
0
  @Test
  public void testDoFilter_marksUISessionAsChangedWithConnectionId() throws Exception {
    HttpSession httpSession = mockHttpSession();
    request.setSession(httpSession);
    request.setParameter("cid", "foo");
    UISessionImpl deserializedUISession = new UISessionImpl(null, httpSession, "foo");
    setUISession(httpSession, deserializedUISession);

    rwtClusterSupport.doFilter(request, response, chain);

    verify(httpSession).setAttribute(endsWith("foo"), same(deserializedUISession));
  }
예제 #2
0
  @Test
  public void testDoFilter_attachesApplicationContextToUISessionWithConnectionId()
      throws Exception {
    ApplicationContextImpl applicationContext = mock(ApplicationContextImpl.class);
    HttpSession httpSession = mockHttpSession(mockServletContext(applicationContext));
    request.setSession(httpSession);
    request.setParameter("cid", "foo");
    UISessionImpl deserializedUISession = new UISessionImpl(null, httpSession, "foo");
    setUISession(httpSession, deserializedUISession);

    rwtClusterSupport.doFilter(request, response, chain);

    assertSame(applicationContext, deserializedUISession.getApplicationContext());
  }