org.apache.struts2

## Class StrutsPortletTestCase

- java.lang.Object
- - junit.framework.Assert
  - - junit.framework.TestCase
    - - com.opensymphony.xwork2.XWorkTestCase
      - - org.apache.struts2.StrutsTestCase
        - - org.apache.struts2.StrutsPortletTestCase

- All Implemented Interfaces:
    junit.framework.Test

      public abstract class StrutsPortletTestCase
      extends StrutsTestCase

  Base class used to test action in portlet environment

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected org.apache.struts2.MockContext` | `portletContext`
    `protected org.springframework.mock.web.portlet.MockPortletRequest` | `portletRequest`
    `protected org.springframework.mock.web.portlet.MockPortletResponse` | `portletResponse`
    `protected org.springframework.mock.web.portlet.MockPortletSession` | `portletSession`

    - ### Fields inherited from class org.apache.struts2.StrutsTestCase

      `dispatcher, dispatcherInitParams, pageContext, request, resourceLoader, response, servletContext`

    - ### Fields inherited from class com.opensymphony.xwork2.XWorkTestCase

      `actionProxyFactory, configuration, configurationManager, container`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StrutsPortletTestCase()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected int` | `getMajorVersion()` Override to define version of your portlet environment
    `protected void` | `initActionContext(ActionContext actionContext)`
    `protected void` | `initPortletContext(ActionContext actionContext)`

    - ### Methods inherited from class org.apache.struts2.StrutsTestCase

      `applyAdditionalParams, createAction, executeAction, findValueAfterExecute, getActionMapping, getActionMapping, getActionProxy, initDispatcher, initServletMockObjects, initSession, injectStrutsDependencies, setUp, setupAfterInitDispatcher, setupBeforeInitDispatcher, tearDown`

    - ### Methods inherited from class com.opensymphony.xwork2.XWorkTestCase

      `loadButAdd, loadButAdd, loadConfigurationProviders`

    - ### Methods inherited from class junit.framework.TestCase

      `assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### portletSession

          protected org.springframework.mock.web.portlet.MockPortletSession portletSession

    - #### portletRequest

          protected org.springframework.mock.web.portlet.MockPortletRequest portletRequest

    - #### portletResponse

          protected org.springframework.mock.web.portlet.MockPortletResponse portletResponse

    - #### portletContext

          protected org.apache.struts2.MockContext portletContext

  - ### Constructor Detail

    - #### StrutsPortletTestCase

          public StrutsPortletTestCase()

  - ### Method Detail

    - #### initActionContext

          protected void initActionContext(ActionContext actionContext)

      Overrides:
        `initActionContext` in class `StrutsTestCase`

    - #### initPortletContext

          protected void initPortletContext(ActionContext actionContext)

    - #### getMajorVersion

          protected int getMajorVersion()

      Override to define version of your portlet environment
      Returns:
        portlet version

Copyright © 2000–2021 Apache Software Foundation. All rights reserved.