org.apache.myfaces.test.mock
Class MockHttpSessionProxy

java.lang.Object
  extended by org.apache.myfaces.test.mock.MockHttpSession
      extended by org.apache.myfaces.test.mock.MockHttpSessionProxy
All Implemented Interfaces:
javax.servlet.http.HttpSession

public class MockHttpSessionProxy
extends MockHttpSession

Proxy used to trigger session creation when it is accessed


Constructor Summary
MockHttpSessionProxy(MockServletContext servletContext, MockHttpServletRequest request)
           
 
Method Summary
 void addAttributeListener(javax.servlet.http.HttpSessionAttributeListener listener)
          Add a new listener instance that should be notified about attribute changes.
 Object getAttribute(String name)
          
 Enumeration getAttributeNames()
          
 long getCreationTime()
          
 String getId()
          
 long getLastAccessedTime()
          
 int getMaxInactiveInterval()
          
 MockHttpServletRequest getRequest()
           
 javax.servlet.ServletContext getServletContext()
          
 javax.servlet.http.HttpSessionContext getSessionContext()
          
 Object getValue(String name)
          
 String[] getValueNames()
          
 MockHttpSession getWrapped()
           
 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)
          Set the session identifier of this session.
 void setMaxInactiveInterval(int interval)
          
 void setRequest(MockHttpServletRequest request)
           
 void setServletContext(javax.servlet.ServletContext servletContext)
          Set the ServletContext associated with this session.
 
Methods inherited from class org.apache.myfaces.test.mock.MockHttpSession
getWebContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockHttpSessionProxy

public MockHttpSessionProxy(MockServletContext servletContext,
                            MockHttpServletRequest request)
Method Detail

addAttributeListener

public void addAttributeListener(javax.servlet.http.HttpSessionAttributeListener listener)
Description copied from class: MockHttpSession

Add a new listener instance that should be notified about attribute changes.

Overrides:
addAttributeListener in class MockHttpSession
Parameters:
listener - The new listener to be added

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Description copied from class: MockHttpSession

Set the ServletContext associated with this session.

Overrides:
setServletContext in class MockHttpSession
Parameters:
servletContext - The associated servlet context

setId

public void setId(String id)
Description copied from class: MockHttpSession

Set the session identifier of this session.

Overrides:
setId in class MockHttpSession
Parameters:
id - The new session identifier

getAttribute

public Object getAttribute(String name)
Description copied from class: MockHttpSession

Specified by:
getAttribute in interface javax.servlet.http.HttpSession
Overrides:
getAttribute in class MockHttpSession

getAttributeNames

public Enumeration getAttributeNames()
Description copied from class: MockHttpSession

Specified by:
getAttributeNames in interface javax.servlet.http.HttpSession
Overrides:
getAttributeNames in class MockHttpSession

getCreationTime

public long getCreationTime()
Description copied from class: MockHttpSession

Specified by:
getCreationTime in interface javax.servlet.http.HttpSession
Overrides:
getCreationTime in class MockHttpSession

getId

public String getId()
Description copied from class: MockHttpSession

Specified by:
getId in interface javax.servlet.http.HttpSession
Overrides:
getId in class MockHttpSession

getLastAccessedTime

public long getLastAccessedTime()
Description copied from class: MockHttpSession

Specified by:
getLastAccessedTime in interface javax.servlet.http.HttpSession
Overrides:
getLastAccessedTime in class MockHttpSession

getMaxInactiveInterval

public int getMaxInactiveInterval()
Description copied from class: MockHttpSession

Specified by:
getMaxInactiveInterval in interface javax.servlet.http.HttpSession
Overrides:
getMaxInactiveInterval in class MockHttpSession

getServletContext

public javax.servlet.ServletContext getServletContext()
Description copied from class: MockHttpSession

Specified by:
getServletContext in interface javax.servlet.http.HttpSession
Overrides:
getServletContext in class MockHttpSession

getSessionContext

public javax.servlet.http.HttpSessionContext getSessionContext()
Description copied from class: MockHttpSession

Specified by:
getSessionContext in interface javax.servlet.http.HttpSession
Overrides:
getSessionContext in class MockHttpSession

getValue

public Object getValue(String name)
Description copied from class: MockHttpSession

Specified by:
getValue in interface javax.servlet.http.HttpSession
Overrides:
getValue in class MockHttpSession

getValueNames

public String[] getValueNames()
Description copied from class: MockHttpSession

Specified by:
getValueNames in interface javax.servlet.http.HttpSession
Overrides:
getValueNames in class MockHttpSession

invalidate

public void invalidate()
Description copied from class: MockHttpSession

Specified by:
invalidate in interface javax.servlet.http.HttpSession
Overrides:
invalidate in class MockHttpSession

isNew

public boolean isNew()
Description copied from class: MockHttpSession

Specified by:
isNew in interface javax.servlet.http.HttpSession
Overrides:
isNew in class MockHttpSession

putValue

public void putValue(String name,
                     Object value)
Description copied from class: MockHttpSession

Specified by:
putValue in interface javax.servlet.http.HttpSession
Overrides:
putValue in class MockHttpSession

removeAttribute

public void removeAttribute(String name)
Description copied from class: MockHttpSession

Specified by:
removeAttribute in interface javax.servlet.http.HttpSession
Overrides:
removeAttribute in class MockHttpSession

removeValue

public void removeValue(String name)
Description copied from class: MockHttpSession

Specified by:
removeValue in interface javax.servlet.http.HttpSession
Overrides:
removeValue in class MockHttpSession

setAttribute

public void setAttribute(String name,
                         Object value)
Description copied from class: MockHttpSession

Specified by:
setAttribute in interface javax.servlet.http.HttpSession
Overrides:
setAttribute in class MockHttpSession

setMaxInactiveInterval

public void setMaxInactiveInterval(int interval)
Description copied from class: MockHttpSession

Specified by:
setMaxInactiveInterval in interface javax.servlet.http.HttpSession
Overrides:
setMaxInactiveInterval in class MockHttpSession

getWrapped

public MockHttpSession getWrapped()

getRequest

public MockHttpServletRequest getRequest()
Returns:
the request

setRequest

public void setRequest(MockHttpServletRequest request)
Parameters:
request - the request to set


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.