JSF Test Framework: Mockito 1.1.2

org.jboss.test.faces.mockito
Class MockFacesEnvironment

java.lang.Object
  extended by org.jboss.test.faces.mockito.MockFacesEnvironment

public class MockFacesEnvironment
extends Object

Creates and holds the structure of mocks for mocked JSF environment.

When constructed, new mocked FacesContext is created and set to current context.

Author:
asmirnov@exadel.com, Lukas Fryc

Constructor Summary
MockFacesEnvironment()
          Instantiates a new mock faces environment and setup new mocked FacesContext.
 
Method Summary
 javax.faces.application.Application getApplication()
          Gets the application.
 javax.faces.application.ApplicationFactory getApplicationFactory()
          Gets the application factory.
 javax.el.ELContext getElContext()
          Gets the el context.
 javax.faces.context.ExceptionHandlerFactory getExceptionHandlerFactory()
          Gets the exception handler factory.
 javax.faces.context.ExternalContext getExternalContext()
          Gets the external context.
 javax.faces.context.ExternalContextFactory getExternalContextFactory()
          Gets the external context factory.
 javax.faces.context.FacesContext getFacesContext()
          Gets the faces context.
 javax.faces.context.FacesContextFactory getFacesContextFactory()
          Gets the faces context factory.
 javax.faces.lifecycle.LifecycleFactory getLifecycleFactory()
          Gets the lifecycle factory.
 javax.faces.context.PartialViewContextFactory getPartialViewContextFactory()
          Gets the partial view context factory.
 javax.faces.render.RenderKit getRenderKit()
          Gets the render kit.
 javax.faces.render.RenderKitFactory getRenderKitFactory()
          Gets the render kit factory.
 javax.servlet.http.HttpServletRequest getRequest()
          Gets the request.
 javax.servlet.http.HttpServletResponse getResponse()
          Gets the response.
 javax.faces.render.ResponseStateManager getResponseStateManager()
          Gets the response state manager.
 RecordingResponseWriter getResponseWriter()
          Gets the response writer.
 javax.servlet.ServletContext getServletContext()
          Gets the servlet context.
 javax.faces.view.facelets.TagHandlerDelegateFactory getTagHandlerDelegateFactory()
          Gets the tag handler delegate factory.
 javax.faces.application.ViewHandler getViewHandler()
          Gets the view handler.
 void release()
          Release.
 MockFacesEnvironment reset()
          Reset.
 MockFacesEnvironment withApplication()
          With application.
 MockFacesEnvironment withELContext()
          With el context.
 MockFacesEnvironment withExternalContext()
          With external context.
 MockFacesEnvironment withFactories()
          With factories.
 MockFacesEnvironment withRenderKit()
          With render kit.
 MockFacesEnvironment withResponseWriter()
          With response writer.
 MockFacesEnvironment withServletRequest()
          With servlet request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockFacesEnvironment

public MockFacesEnvironment()
Instantiates a new mock faces environment and setup new mocked FacesContext.

Method Detail

withExternalContext

public MockFacesEnvironment withExternalContext()
With external context.

Returns:
the mock faces environment

withELContext

public MockFacesEnvironment withELContext()
With el context.

Returns:
the mock faces environment

withServletRequest

public MockFacesEnvironment withServletRequest()
With servlet request.

Returns:
the mock faces environment

withFactories

public MockFacesEnvironment withFactories()
With factories.

Returns:
the mock faces environment

withApplication

public MockFacesEnvironment withApplication()
With application.

Returns:
the mock faces environment

withRenderKit

public MockFacesEnvironment withRenderKit()
With render kit.

Returns:
the mock faces environment

withResponseWriter

public MockFacesEnvironment withResponseWriter()
With response writer.

Returns:
the mock faces environment

reset

public MockFacesEnvironment reset()
Reset.

Returns:
the mock faces environment

release

public void release()
Release.


getFacesContext

public javax.faces.context.FacesContext getFacesContext()
Gets the faces context.

Returns:
the faces context

getExternalContext

public javax.faces.context.ExternalContext getExternalContext()
Gets the external context.

Returns:
the external context

getElContext

public javax.el.ELContext getElContext()
Gets the el context.

Returns:
the el context

getServletContext

public javax.servlet.ServletContext getServletContext()
Gets the servlet context.

Returns:
the servlet context

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
Gets the request.

Returns:
the request

getResponse

public javax.servlet.http.HttpServletResponse getResponse()
Gets the response.

Returns:
the response

getApplication

public javax.faces.application.Application getApplication()
Gets the application.

Returns:
the application

getViewHandler

public javax.faces.application.ViewHandler getViewHandler()
Gets the view handler.

Returns:
the view handler

getRenderKit

public javax.faces.render.RenderKit getRenderKit()
Gets the render kit.

Returns:
the render kit

getResponseStateManager

public javax.faces.render.ResponseStateManager getResponseStateManager()
Gets the response state manager.

Returns:
the response state manager

getResponseWriter

public RecordingResponseWriter getResponseWriter()
Gets the response writer.

Returns:
the response writer

getApplicationFactory

public javax.faces.application.ApplicationFactory getApplicationFactory()
Gets the application factory.

Returns:
the application factory

getFacesContextFactory

public javax.faces.context.FacesContextFactory getFacesContextFactory()
Gets the faces context factory.

Returns:
the faces context factory

getRenderKitFactory

public javax.faces.render.RenderKitFactory getRenderKitFactory()
Gets the render kit factory.

Returns:
the render kit factory

getLifecycleFactory

public javax.faces.lifecycle.LifecycleFactory getLifecycleFactory()
Gets the lifecycle factory.

Returns:
the lifecycle factory

getTagHandlerDelegateFactory

public javax.faces.view.facelets.TagHandlerDelegateFactory getTagHandlerDelegateFactory()
Gets the tag handler delegate factory.

Returns:
the tag handler delegate factory

getExceptionHandlerFactory

public javax.faces.context.ExceptionHandlerFactory getExceptionHandlerFactory()
Gets the exception handler factory.

Returns:
the exception handler factory

getPartialViewContextFactory

public javax.faces.context.PartialViewContextFactory getPartialViewContextFactory()
Gets the partial view context factory.

Returns:
the partial view context factory

getExternalContextFactory

public javax.faces.context.ExternalContextFactory getExternalContextFactory()
Gets the external context factory.

Returns:
the external context factory

JSF Test Framework: Mockito 1.1.2

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.