@Override public Object getContainerRequest() { return new MockHttpServletRequest( application, new MockHttpSession(context), context); } },
/** * Get the value for the given name. * * @param name * The name * @return The value or null * @deprecated use getAttribute(String) instead */ @Override @Deprecated public Object getValue(final String name) { return getAttribute(name); }
/** * Get the session. * * @param b * Ignored, there is always a session * @return The session */ @Override public HttpSession getSession(boolean b) { HttpSession sess = null; if (session instanceof MockHttpSession) { MockHttpSession mockHttpSession = (MockHttpSession)session; if (b) { mockHttpSession.setTemporary(false); } if (mockHttpSession.isTemporary() == false) { sess = session; } } return sess; }
/** * Remove a value. * * @param name * The name of the value * @deprecated Use removeAttribute(String) instead */ @Override @Deprecated public void removeValue(String name) { removeAttribute(name); }
/** * Invalidate the session. */ @Override public void invalidate() { Session session = (Session) attributes.get("wicket:" + BaseWicketTester.TestFilterConfig.class.getName() + ":session"); if (session != null) { session.onInvalidate(); } attributes.clear(); id = generateSessionId(); }
/** * Set a value. * * @param name * The name of the value * @param o * The value * @deprecated Use setAttribute(String, Object) instead */ @Override @Deprecated public void putValue(final String name, final Object o) { setAttribute(name, o); }
/** * Get the requested session id. Always returns the id of the current session. * * @return The session id */ @Override public String getRequestedSessionId() { if (session instanceof MockHttpSession && ((MockHttpSession)session).isTemporary()) { return null; } return session.getId(); }
/** * Remove a value. * * @param name * The name of the value * @deprecated Use removeAttribute(String) instead */ @Override @Deprecated public void removeValue(String name) { removeAttribute(name); }
/** * Invalidate the session. */ @Override public void invalidate() { Session session = (Session) attributes.get("wicket:" + BaseWicketTester.TestFilterConfig.class.getName() + ":session"); if (session != null) { session.onInvalidate(); } attributes.clear(); id = generateSessionId(); }
/** * Set a value. * * @param name * The name of the value * @param o * The value * @deprecated Use setAttribute(String, Object) instead */ @Override @Deprecated public void putValue(final String name, final Object o) { setAttribute(name, o); }
/** * Get the requested session id. Always returns the id of the current session. * * @return The session id */ @Override public String getRequestedSessionId() { if (session instanceof MockHttpSession && ((MockHttpSession)session).isTemporary()) { return null; } return session.getId(); }
MockHttpSession httpSession = new MockHttpSession(context);
/** * Get the session. * * @param createNew * Ignored, there is always a session * @return The session */ @Override public HttpSession getSession(boolean createNew) { HttpSession sess = null; if (session instanceof MockHttpSession) { MockHttpSession mockHttpSession = (MockHttpSession)session; if (createNew) { mockHttpSession.setTemporary(false); } if (mockHttpSession.isTemporary() == false) { sess = session; } } return sess; }
/** * Get the value for the given name. * * @param name * The name * @return The value or null * @deprecated use getAttribute(String) instead */ @Override @Deprecated public Object getValue(final String name) { return getAttribute(name); }
httpSession = new MockHttpSession(servletContext);
httpSession = new MockHttpSession(servletContext);