|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.shale.test.mock.MockHttpSession
public class MockHttpSession
Mock implementation of HttpSession
.
Constructor Summary | |
---|---|
MockHttpSession()
Configure a default instance. |
|
MockHttpSession(javax.servlet.ServletContext servletContext)
Configure a session instance associated with the specified servlet context. |
Method Summary | |
---|---|
void |
addAttributeListener(javax.servlet.http.HttpSessionAttributeListener listener)
Add a new listener instance that should be notified about attribute changes. |
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 |
isNew()
|
void |
putValue(java.lang.String name,
java.lang.Object value)
|
void |
removeAttribute(java.lang.String name)
|
void |
removeValue(java.lang.String name)
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
|
void |
setId(java.lang.String id)
Set the session identifier of this session. |
void |
setMaxInactiveInterval(int interval)
|
void |
setServletContext(javax.servlet.ServletContext servletContext)
Set the ServletContext associated with this session. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MockHttpSession()
Configure a default instance.
public MockHttpSession(javax.servlet.ServletContext servletContext)
Configure a session instance associated with the specified servlet context.
servletContext
- The associated servlet contextMethod Detail |
---|
public void addAttributeListener(javax.servlet.http.HttpSessionAttributeListener listener)
Add a new listener instance that should be notified about attribute changes.
listener
- The new listener to be addedpublic void setServletContext(javax.servlet.ServletContext servletContext)
Set the ServletContext associated with this session.
servletContext
- The associated servlet contextpublic void setId(java.lang.String id)
Set the session identifier of this session.
id
- The new session identifierpublic java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface javax.servlet.http.HttpSession
public java.util.Enumeration getAttributeNames()
getAttributeNames
in interface javax.servlet.http.HttpSession
public long getCreationTime()
getCreationTime
in interface javax.servlet.http.HttpSession
public java.lang.String getId()
getId
in interface javax.servlet.http.HttpSession
public long getLastAccessedTime()
getLastAccessedTime
in interface javax.servlet.http.HttpSession
public int getMaxInactiveInterval()
getMaxInactiveInterval
in interface javax.servlet.http.HttpSession
public javax.servlet.ServletContext getServletContext()
getServletContext
in interface javax.servlet.http.HttpSession
public javax.servlet.http.HttpSessionContext getSessionContext()
getSessionContext
in interface javax.servlet.http.HttpSession
public java.lang.Object getValue(java.lang.String name)
getValue
in interface javax.servlet.http.HttpSession
public java.lang.String[] getValueNames()
getValueNames
in interface javax.servlet.http.HttpSession
public void invalidate()
invalidate
in interface javax.servlet.http.HttpSession
public boolean isNew()
isNew
in interface javax.servlet.http.HttpSession
public void putValue(java.lang.String name, java.lang.Object value)
putValue
in interface javax.servlet.http.HttpSession
public void removeAttribute(java.lang.String name)
removeAttribute
in interface javax.servlet.http.HttpSession
public void removeValue(java.lang.String name)
removeValue
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 setMaxInactiveInterval(int interval)
setMaxInactiveInterval
in interface javax.servlet.http.HttpSession
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |