org.apache.struts2.junit

## Class StrutsPortletTestCase

- java.lang.Object
- - junit.framework.Assert
  - - junit.framework.TestCase
    - - com.opensymphony.xwork2.XWorkTestCase
      - - org.apache.struts2.junit.StrutsTestCase
        - - org.apache.struts2.junit.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.junit.MockContext` | `portletContext`
    `protected MockPortletRequest` | `portletRequest`
    `protected MockPortletResponse` | `portletResponse`
    `protected MockPortletSession` | `portletSession`

    - ### Fields inherited from class org.apache.struts2.junit.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

    All Methods Instance Methods Concrete 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.junit.StrutsTestCase

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

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

      `createContextWithLocale, 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 MockPortletSession portletSession

    - #### portletRequest

          protected MockPortletRequest portletRequest

    - #### portletResponse

          protected MockPortletResponse portletResponse

    - #### portletContext

          protected org.apache.struts2.junit.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–2022 Apache Software Foundation. All rights reserved.