|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.resteasy.mock.MockHttpSession
public class MockHttpSession
Mock implementation of the HttpSession interface.
Supports the Servlet 2.4 API level.
Used for testing the web framework; also useful for testing application controllers.
| Field Summary | |
|---|---|
static java.lang.String |
SESSION_COOKIE_NAME
|
| Constructor Summary | |
|---|---|
MockHttpSession()
Create a new MockHttpSession with a default org.springframework.mock.web.MockServletContext. |
|
MockHttpSession(javax.servlet.ServletContext servletContext)
Create a new MockHttpSession. |
|
| Method Summary | |
|---|---|
void |
access()
|
void |
clearAttributes()
Clear all of this session's attributes. |
void |
deserializeState(java.io.Serializable state)
Deserialize the attributes of this session from a state object created by serializeState(). |
java.lang.Object |
getAttribute(java.lang.String name)
|
java.util.Enumeration |
getAttributeNames()
|
long |
getCreationTime()
|
java.lang.String |
getId()
|
long |
getLastAccessedTime()
|
int |
getMaxInactiveInterval()
|
javax.servlet.ServletContext |
getServletContext()
|
javax.servlet.http.HttpSessionContext |
getSessionContext()
|
java.lang.Object |
getValue(java.lang.String name)
|
java.lang.String[] |
getValueNames()
|
void |
invalidate()
|
boolean |
isInvalid()
|
boolean |
isNew()
|
void |
putValue(java.lang.String name,
java.lang.Object value)
|
void |
removeAttribute(java.lang.String name)
|
void |
removeValue(java.lang.String name)
|
java.io.Serializable |
serializeState()
Serialize the attributes of this session into an object that can be turned into a byte array with standard Java serialization. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
|
void |
setMaxInactiveInterval(int interval)
|
void |
setNew(boolean value)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SESSION_COOKIE_NAME
| Constructor Detail |
|---|
public MockHttpSession()
org.springframework.mock.web.MockServletContext.
org.springframework.mock.web.MockServletContextpublic MockHttpSession(javax.servlet.ServletContext servletContext)
servletContext - the ServletContext that the session runs in| Method Detail |
|---|
public long getCreationTime()
getCreationTime in interface javax.servlet.http.HttpSessionpublic java.lang.String getId()
getId in interface javax.servlet.http.HttpSessionpublic void access()
public long getLastAccessedTime()
getLastAccessedTime in interface javax.servlet.http.HttpSessionpublic javax.servlet.ServletContext getServletContext()
getServletContext in interface javax.servlet.http.HttpSessionpublic void setMaxInactiveInterval(int interval)
setMaxInactiveInterval in interface javax.servlet.http.HttpSessionpublic int getMaxInactiveInterval()
getMaxInactiveInterval in interface javax.servlet.http.HttpSessionpublic javax.servlet.http.HttpSessionContext getSessionContext()
getSessionContext in interface javax.servlet.http.HttpSessionpublic java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface javax.servlet.http.HttpSessionpublic java.lang.Object getValue(java.lang.String name)
getValue in interface javax.servlet.http.HttpSessionpublic java.util.Enumeration getAttributeNames()
getAttributeNames in interface javax.servlet.http.HttpSessionpublic java.lang.String[] getValueNames()
getValueNames in interface javax.servlet.http.HttpSession
public void setAttribute(java.lang.String name,
java.lang.Object value)
setAttribute in interface javax.servlet.http.HttpSession
public void putValue(java.lang.String name,
java.lang.Object value)
putValue in interface javax.servlet.http.HttpSessionpublic void removeAttribute(java.lang.String name)
removeAttribute in interface javax.servlet.http.HttpSessionpublic void removeValue(java.lang.String name)
removeValue in interface javax.servlet.http.HttpSessionpublic void clearAttributes()
public void invalidate()
invalidate in interface javax.servlet.http.HttpSessionpublic boolean isInvalid()
public void setNew(boolean value)
public boolean isNew()
isNew in interface javax.servlet.http.HttpSessionpublic java.io.Serializable serializeState()
public void deserializeState(java.io.Serializable state)
serializeState().
state - a representation of this session's serialized state
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||