Class TestActionServlet

java.lang.Object
org.apache.struts.action.TestActionServlet

public class TestActionServlet extends Object
Suite of unit tests for the ActionServlet class.
  • Field Details

    • moduleConfig

      protected org.apache.struts.config.ModuleConfig moduleConfig
      The ModuleConfig we'll use.
    • baseFormBean

      protected org.apache.struts.config.FormBeanConfig baseFormBean
      The common form bean we'll use.
    • baseException

      protected org.apache.struts.config.ExceptionConfig baseException
      The common exception config we'll use.
    • baseAction

      protected org.apache.struts.action.ActionMapping baseAction
      The common action config we'll use.
    • baseForward

      protected org.apache.struts.action.ActionForward baseForward
      The common action forward we'll use.
    • actionServlet

      protected org.apache.struts.action.ActionServlet actionServlet
      The ActionServlet we'll test.
  • Constructor Details

    • TestActionServlet

      public TestActionServlet()
  • Method Details

    • setUp

      @BeforeEach public void setUp() throws ServletException
      Set up instance variables required by this test case.
      Throws:
      ServletException - if we cannot initialize these resources
    • tearDown

      @AfterEach public void tearDown()
      Tear down instance variables required by this test case.
    • testInitDestroyInternal

      @Test public void testInitDestroyInternal()
      Verify that we can initialize and destroy our internal message resources object.
    • notestSplitAndResolvePaths

      @Test @Disabled public void notestSplitAndResolvePaths() throws ServletException
      Test class loader resolution and splitting.
      Throws:
      ServletException - if a servlet exception is thrown
    • testInitModuleFormBeansNoExtends

      @Test public void testInitModuleFormBeansNoExtends()
      Test that nothing fails if there are no extensions.
    • testInitModuleFormBeansNullFormType

      @Test public void testInitModuleFormBeansNullFormType()
      Test that initModuleFormBeans throws an exception when a form with a null type is present.
    • testInitModuleFormBeansNullPropType

      @Test public void testInitModuleFormBeansNullPropType()
      Test that initModuleFormBeans throws an exception when a form whose prop type is null is present.
    • testProcessFormBeanExtension

      @Test public void testProcessFormBeanExtension() throws ServletException
      Test that processFormBeanExtension() calls processExtends()
      Throws:
      ServletException
    • testProcessFormBeanConfigClass

      @Test public void testProcessFormBeanConfigClass() throws ServletException
      Make sure processFormBeanConfigClass() returns an instance of the correct class if the base config is using a custom class.
      Throws:
      ServletException - if a servlet exception is thrown
    • testProcessFormBeanConfigClassNoExtends

      @Test public void testProcessFormBeanConfigClassNoExtends() throws ServletException
      Make sure processFormBeanConfigClass() returns what it was given if the form passed to it doesn't extend anything.
      Throws:
      ServletException - if a servlet exception is thrown
    • testProcessFormBeanConfigClassSubFormCustomClass

      @Test public void testProcessFormBeanConfigClassSubFormCustomClass() throws ServletException
      Make sure processFormBeanConfigClass() returns the same class instance if the base config isn't using a custom class.
      Throws:
      ServletException - if a servlet exception is thrown
    • notestProcessFormBeanConfigClassError

      @Test @Disabled public void notestProcessFormBeanConfigClassError()
      Make sure the code throws the correct exception when it can't create an instance of the base config's custom class.
    • testProcessFormBeanConfigClassOverriddenSubFormClass

      @Test public void testProcessFormBeanConfigClassOverriddenSubFormClass()
      Test the case where the subform has already specified its own form bean config class. If the code still attempts to create a new instance, an error will be thrown.
    • testInitModuleExceptionConfigsNoExtends

      @Test public void testInitModuleExceptionConfigsNoExtends()
      Test that nothing fails if there are no extensions.
    • testInitModuleExceptionConfigsNullFormType

      @Test public void testInitModuleExceptionConfigsNullFormType()
      Test that initModuleExceptionConfigs does not throw an exception when a handler with a null key is present.
    • testProcessExceptionExtension

      @Test public void testProcessExceptionExtension() throws ServletException
      Test that processExceptionExtension() calls processExtends()
      Throws:
      ServletException - if initialization cannot be performed.
    • testProcessExceptionConfigClass

      @Test public void testProcessExceptionConfigClass() throws ServletException
      Make sure processExceptionConfigClass() returns an instance of the correct class if the base config is using a custom class.
      Throws:
      ServletException - if initialization cannot be performed.
    • testProcessExceptionConfigClassNoExtends

      @Test public void testProcessExceptionConfigClassNoExtends() throws ServletException
      Make sure processExceptionConfigClass() returns what it was given if the handler passed to it doesn't extend anything.
      Throws:
      ServletException - if initialization cannot be performed.
    • testProcessExceptionConfigClassSubConfigCustomClass

      @Test public void testProcessExceptionConfigClassSubConfigCustomClass() throws ServletException
      Make sure processExceptionConfigClass() returns the same class instance if the base config isn't using a custom class.
      Throws:
      ServletException - if initialization cannot be performed.
    • notestProcessExceptionConfigClassError

      @Test @Disabled public void notestProcessExceptionConfigClassError()
      Make sure the code throws the correct exception when it can't create an instance of the base config's custom class.
    • testProcessExceptionConfigClassOverriddenSubFormClass

      @Test public void testProcessExceptionConfigClassOverriddenSubFormClass()
      Test the case where the subconfig has already specified its own config class. If the code still attempts to create a new instance, an error will be thrown.
    • testInitModuleForwardConfigsNoExtends

      @Test public void testInitModuleForwardConfigsNoExtends()
      Test that nothing fails if there are no extensions.
    • testInitModuleForwardsNullFormType

      @Test public void testInitModuleForwardsNullFormType()
      Test that initModuleForwards throws an exception when a forward with a null path is present.
    • testProcessForwardExtension

      @Test public void testProcessForwardExtension() throws ServletException
      Test that processForwardExtension() calls processExtends()
      Throws:
      ServletException - if initialization cannot be performed.
    • testProcessForwardConfigClass

      @Test public void testProcessForwardConfigClass() throws ServletException
      Make sure processForwardConfigClass() returns an instance of the correct class if the base config is using a custom class.
      Throws:
      ServletException - if initialization cannot be performed.
    • testProcessForwardConfigClassNoExtends

      @Test public void testProcessForwardConfigClassNoExtends() throws ServletException
      Make sure processForwardConfigClass() returns what it was given if the forward passed to it doesn't extend anything.
      Throws:
      ServletException - if initialization cannot be performed.
    • testProcessForwardConfigClassSubConfigCustomClass

      @Test public void testProcessForwardConfigClassSubConfigCustomClass() throws ServletException
      Make sure processForwardConfigClass() returns the same class instance if the base config isn't using a custom class.
      Throws:
      ServletException - if initialization cannot be performed.
    • notestProcessForwardConfigClassError

      @Test @Disabled public void notestProcessForwardConfigClassError()
      Make sure the code throws the correct exception when it can't create an instance of the base config's custom class.
    • testProcessForwardConfigClassOverriddenSubConfigClass

      @Test public void testProcessForwardConfigClassOverriddenSubConfigClass()
      Test the case where the subconfig has already specified its own config class. If the code still attempts to create a new instance, an error will be thrown.
    • testInitModuleActionConfigsNoExtends

      @Test public void testInitModuleActionConfigsNoExtends()
      Test that nothing fails if there are no extensions.
    • testProcessActionExtension

      @Test public void testProcessActionExtension() throws ServletException
      Test that processActionConfigExtension() calls processExtends()
      Throws:
      ServletException - if initialization cannot be performed.
    • testProcessActionExtensionWithForwardConfig

      @Test public void testProcessActionExtensionWithForwardConfig() throws ServletException
      Test that an ActionConfig's ForwardConfig can inherit from a global ForwardConfig.
      Throws:
      ServletException - if initialization cannot be performed.
    • testProcessActionExtensionWithExceptionConfig

      @Test public void testProcessActionExtensionWithExceptionConfig() throws ServletException
      Test that an ActionConfig's ExceptionConfig can inherit from a global ExceptionConfig.
      Throws:
      ServletException - if initialization cannot be performed.
    • testProcessActionConfigClass

      @Test public void testProcessActionConfigClass() throws ServletException
      Make sure processActionConfigClass() returns an instance of the correct class if the base config is using a custom class.
      Throws:
      ServletException - if initialization cannot be performed.
    • testProcessActionConfigClassNoExtends

      @Test public void testProcessActionConfigClassNoExtends() throws ServletException
      Make sure processActionConfigClass() returns what it was given if the action passed to it doesn't extend anything.
      Throws:
      ServletException - if initialization cannot be performed.
    • testProcessActionConfigClassSubConfigCustomClass

      @Test public void testProcessActionConfigClassSubConfigCustomClass() throws ServletException
      Make sure processActionConfigClass() returns the same class instance if the base config isn't using a custom class.
      Throws:
      ServletException - if initialization cannot be performed.
    • notestProcessActionConfigClassError

      @Test @Disabled public void notestProcessActionConfigClassError()
      Make sure the code throws the correct exception when it can't create an instance of the base config's custom class.
    • testProcessActionConfigClassOverriddenSubConfigClass

      @Test public void testProcessActionConfigClassOverriddenSubConfigClass()
      Test the case where the subconfig has already specified its own config class. If the code still attempts to create a new instance, an error will be thrown.