Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4017

Support multiple Action executions and Session values

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.12
    • Fix Version/s: 2.3.14
    • Component/s: Plugin - JUnit
    • Labels:
      None

      Description

      Assuming the following scenario:

      String output = executeAction("/sessiontest/sessionSet.action");
      Assert.assertEquals("sessionValue", output);
      String output2 = executeAction("/sessiontest/sessionGet.action");
      Assert.assertEquals("sessionValue", output2);

      where the first action would set "sessionValue" into the http session and the template would only output this value, output2 equals "sessionValuesessionValue".

      The solution is to finish the execution and clean up the necessary mock resources. Besides, the new mock session need to get the session attributes.

      This test case should then work:

      String output = executeAction("/sessiontest/sessionSet.action");
      Assert.assertEquals("sessionValue", output);

      this.finishExecution();

      String output2 = executeAction("/sessiontest/sessionGet.action");
      Assert.assertEquals("sessionValue", output2);

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cgrobmeier Christian Grobmeier
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: