|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.click.servlet.MockSession
Mock implementation of HttpSession
.
Constructor Summary | |
MockSession()
Create a default MockSession. |
|
MockSession(ServletContext servletContext)
Create a MockSession for the specified servletContext. |
|
MockSession(String id)
Create a MockSession for the specified session identifier. |
|
MockSession(String id,
ServletContext servletContext)
Create a MockSession for the specified id and servletContext. |
Method Summary | |
Object |
getAttribute(String name)
|
Enumeration |
getAttributeNames()
|
long |
getCreationTime()
|
String |
getId()
|
long |
getLastAccessedTime()
This method will return the current time by invoking System.currentTimeMillis(). |
int |
getMaxInactiveInterval()
|
ServletContext |
getServletContext()
|
HttpSessionContext |
getSessionContext()
|
Object |
getValue(String name)
|
String[] |
getValueNames()
|
void |
invalidate()
|
boolean |
isNew()
|
void |
putValue(String name,
Object value)
|
void |
removeAttribute(String name)
|
void |
removeValue(String name)
|
void |
setAttribute(String name,
Object value)
|
void |
setId(String id)
Sets session unique identifier. |
void |
setMaxInactiveInterval(int maxInterval)
|
void |
setServletContext(ServletContext servletContext)
Sets the servletContext to which the session belong. |
String |
toString()
Return a string representation of the session. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MockSession()
public MockSession(String id)
id
- session unique identifier.public MockSession(ServletContext servletContext)
servletContext
- the servletContext to which this session belongpublic MockSession(String id, ServletContext servletContext)
id
- session unique identifier.servletContext
- the servletContext to which this session belongMethod Detail |
public void setId(String id)
id
- a unique session identifierpublic void setServletContext(ServletContext servletContext)
servletContext
- the servletContext to which this session belongpublic Enumeration getAttributeNames()
getAttributeNames
in interface HttpSession
HttpSession.getAttributeNames()
public long getCreationTime()
getCreationTime
in interface HttpSession
HttpSession.getCreationTime()
public String getId()
getId
in interface HttpSession
HttpSession.getId()
public long getLastAccessedTime()
getLastAccessedTime
in interface HttpSession
HttpSession.getLastAccessedTime()
public int getMaxInactiveInterval()
getMaxInactiveInterval
in interface HttpSession
HttpSession.getMaxInactiveInterval()
public ServletContext getServletContext()
getServletContext
in interface HttpSession
HttpSession.getServletContext()
public HttpSessionContext getSessionContext()
getSessionContext
in interface HttpSession
HttpSession.getSessionContext()
public String[] getValueNames()
getValueNames
in interface HttpSession
HttpSession.getValueNames()
public void invalidate()
invalidate
in interface HttpSession
HttpSession.invalidate()
public boolean isNew()
isNew
in interface HttpSession
HttpSession.isNew()
public void setMaxInactiveInterval(int maxInterval)
setMaxInactiveInterval
in interface HttpSession
maxInterval
- an integer specifying the number of secondsHttpSession.setMaxInactiveInterval(int)
public void removeValue(String name)
removeValue
in interface HttpSession
name
- the name of the object to remove from this sessionHttpSession.removeValue(java.lang.String)
public void removeAttribute(String name)
removeAttribute
in interface HttpSession
name
- the name of the object to remove from this sessionHttpSession.removeAttribute(java.lang.String)
public Object getAttribute(String name)
getAttribute
in interface HttpSession
name
- a string specifying the name of the object
HttpSession.getAttribute(java.lang.String)
public Object getValue(String name)
getValue
in interface HttpSession
name
- a string specifying the name of the object
HttpSession.getValue(java.lang.String)
public void setAttribute(String name, Object value)
setAttribute
in interface HttpSession
name
- the name to which the object is bound; cannot be nullvalue
- the object to be boundHttpSession.setAttribute(java.lang.String, java.lang.Object)
public void putValue(String name, Object value)
putValue
in interface HttpSession
name
- the name to which the object is bound; cannot be nullvalue
- the object to be bound; cannot be nullHttpSession.putValue(java.lang.String, java.lang.Object)
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |