Wicket
  1. Wicket
  2. WICKET-1931

FormTester doesn't correctly submit a form when a FileUploadField was not set (which is not required)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4-M3
    • Fix Version/s: 1.4-RC2
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Windows XP PL SP 2, Java 1.6.0_10

      Description

      FormTester doesn't correctly submit a form when a FileUploadField was not set.
      This file is not required.

      So it is impossible to create a real test because I am forced to always set a File to check to whole form.

      There was discussion about this problem here: http://www.nabble.com/FormTester-and-FileUploadField-td18566869.html

      I will be very grateful if you can fix it
      Artur

      1. wicket-1931.patch
        5 kB
        Marco Rico-Gomez

        Activity

        Igor Vaynberg made changes -
        Resolution Fixed [ 1 ]
        Assignee Igor Vaynberg [ ivaynberg ]
        Fix Version/s 1.4-RC2 [ 12313495 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Marco Rico-Gomez made changes -
        Field Original Value New Value
        Attachment wicket-1931.patch [ 12394726 ]
        Hide
        Marco Rico-Gomez added a comment -

        I had the same problem and noticed that the class MockHttpServletRequest doesn't handle multipart form requests correct if no files are available (uploadedFiles == null || uploadedFiles.size() == 0).
        I created a patch which adds a new test case in FormTesterTest and a possible bugfix in
        MockHttpServletRequest.

        Show
        Marco Rico-Gomez added a comment - I had the same problem and noticed that the class MockHttpServletRequest doesn't handle multipart form requests correct if no files are available (uploadedFiles == null || uploadedFiles.size() == 0). I created a patch which adds a new test case in FormTesterTest and a possible bugfix in MockHttpServletRequest.
        Artur Wronski created issue -

          People

          • Assignee:
            Igor Vaynberg
            Reporter:
            Artur Wronski
          • Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development