servletunit
Class HttpSessionSimulator

java.lang.Object
  extended byservletunit.HttpSessionSimulator

public class HttpSessionSimulator
extends java.lang.Object

This class simulates an HttpSession object. You can actually work with sessions. The simulation is done using a static session object inside HttpServletRequest.


Constructor Summary
HttpSessionSimulator(ServletContext context)
           
 
Method Summary
 java.lang.Object getAttribute(java.lang.String s)
           
 java.util.Enumeration getAttributeNames()
           
 long getCreationTime()
           
 java.lang.String getId()
           
 long getLastAccessedTime()
           
 int getMaxInactiveInterval()
           
 ServletContext getServletContext()
           
 HttpSessionContext getSessionContext()
          This method is not supported.
 java.lang.Object getValue(java.lang.String s)
           
 java.lang.String[] getValueNames()
           
 void invalidate()
           
 boolean isNew()
           
protected  boolean isValid()
           
 void putValue(java.lang.String s, java.lang.Object obj)
           
 void removeAttribute(java.lang.String s)
           
 void removeValue(java.lang.String s)
           
 void setAttribute(java.lang.String s, java.lang.Object obj)
           
 void setMaxInactiveInterval(int i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpSessionSimulator

public HttpSessionSimulator(ServletContext context)
Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String s)
                              throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

getAttributeNames

public java.util.Enumeration getAttributeNames()
                                        throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

getCreationTime

public long getCreationTime()
                     throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

getId

public java.lang.String getId()

getLastAccessedTime

public long getLastAccessedTime()

getMaxInactiveInterval

public int getMaxInactiveInterval()
                           throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

getSessionContext

public HttpSessionContext getSessionContext()
This method is not supported.


getValue

public java.lang.Object getValue(java.lang.String s)
                          throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

getValueNames

public java.lang.String[] getValueNames()
                                 throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

invalidate

public void invalidate()
                throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

isNew

public boolean isNew()
              throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

putValue

public void putValue(java.lang.String s,
                     java.lang.Object obj)
              throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

removeAttribute

public void removeAttribute(java.lang.String s)
                     throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

removeValue

public void removeValue(java.lang.String s)
                 throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

setAttribute

public void setAttribute(java.lang.String s,
                         java.lang.Object obj)
                  throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

setMaxInactiveInterval

public void setMaxInactiveInterval(int i)

getServletContext

public ServletContext getServletContext()

isValid

protected boolean isValid()


Copyright Deryl Seale All Rights Reserved.