/** * Returns the {@link com.mockrunner.mock.web.MockHttpSession}. * @return the {@link com.mockrunner.mock.web.MockHttpSession} * @deprecated use {@link #getMockSession} */ public MockHttpSession getSession() { return getMockSession(); }
/** * Returns the {@link com.mockrunner.mock.web.MockHttpSession}. * @return the {@link com.mockrunner.mock.web.MockHttpSession} * @deprecated use {@link #getMockSession} */ public MockHttpSession getSession() { return getMockSession(); }
/** * Returns the {@link com.mockrunner.mock.web.MockHttpSession}. * @return the {@link com.mockrunner.mock.web.MockHttpSession} * @deprecated use {@link #getMockSession} */ public MockHttpSession getSession() { return getMockSession(); }
/** * Sets the session attribute for the specified key * @param key the session key * @param value the value */ public void setSessionAttribute(String key, Object value) { mockFactory.getMockSession().setAttribute(key, value); } }
/** * Sets the session attribute for the specified key * @param key the session key * @param value the value */ public void setSessionAttribute(String key, Object value) { mockFactory.getMockSession().setAttribute(key, value); } }
/** * Returns the session attribute for the specified key * @param key the session key * @return the attribute */ public Object getSessionAttribute(String key) { return mockFactory.getMockSession().getAttribute(key); }
/** * Sets the session attribute for the specified key * @param key the session key * @param value the value */ public void setSessionAttribute(String key, Object value) { mockFactory.getMockSession().setAttribute(key, value); } }
/** * Returns the session attribute for the specified key * @param key the session key * @return the attribute */ public Object getSessionAttribute(String key) { return mockFactory.getMockSession().getAttribute(key); }
/** * Returns the session attribute for the specified key * @param key the session key * @return the attribute */ public Object getSessionAttribute(String key) { return mockFactory.getMockSession().getAttribute(key); }
private void createMockObjectsBasedOn(WebMockObjectFactory factory, boolean createNewSession) { createNewMockObjects(createNewSession); if(!createNewSession) session = factory.getMockSession(); context = factory.getMockServletContext(); setUpDependencies(); JspFactory.setDefaultFactory(jspFactory); }
private void createMockObjectsBasedOn(WebMockObjectFactory factory, boolean createNewSession) { createNewMockObjects(createNewSession); if(!createNewSession) session = factory.getMockSession(); context = factory.getMockServletContext(); setUpDependencies(); JspFactory.setDefaultFactory(jspFactory); }
private void createMockObjectsBasedOn(WebMockObjectFactory factory, boolean createNewSession) { createNewMockObjects(createNewSession); if(!createNewSession) session = factory.getMockSession(); context = factory.getMockServletContext(); setUpDependencies(); JspFactory.setDefaultFactory(jspFactory); }
@Test public void testDoLogoutWithFilteredImageButton() throws Exception { addRequestParameter("logout.x", "11"); addRequestParameter("logout.y", "11"); doPost(); assertTrue(getWebMockObjectFactory().getMockSession().isValid()); createFilter(ImageButtonFilter.class); setDoChain(true); doPost(); assertFalse(getWebMockObjectFactory().getMockSession().isValid()); HttpServletRequest filteredRequest = (HttpServletRequest)getFilteredRequest(); assertEquals("11", filteredRequest.getParameter("logout")); assertNull(filteredRequest.getParameter("logout.x")); assertNull(filteredRequest.getParameter("logout.y")); } }
@Test public void testDoLogout() throws Exception { addRequestParameter("logout", "true"); doPost(); assertFalse(getWebMockObjectFactory().getMockSession().isValid()); }