[ 
https://issues.apache.org/jira/browse/WICKET-2015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666999#action_12666999
 ] 

Juergen Donnerstag commented on WICKET-2015:
--------------------------------------------

I run your latest tests on the current trunk. All tests except 1 were executed 
successfully. The only test that failed was 

        public void testSubmit_ValidTextField_NoFile() {
                formTester.setValue(textFieldId, 
                                
FileUploadError.THIS_VALUE_SHOULD_THROW_EXCEPTION);
                try {
                        formTester.submit();
                        fail("Value not succesfully submitted.");
                } catch (RuntimeException rex) {
                        assertEquals("Special value: " + 
                                        
FileUploadError.THIS_VALUE_SHOULD_THROW_EXCEPTION, 
                                        rex.getMessage());
                }
        }

Here FileUploadError.THIS_VALUE_SHOULD_THROW_EXCEPTION == "this value should 
throw exception". And this is the constraint: 
inputField.add(StringValidator.lengthBetween(3, 10)); Obviously the text is 
longer than 10 chars. Hence you get a validation error and not your expected 
exception. I'm sorry, but your test is wrong which means that all test pass 
successfully.



> Empty File Upload field breaks validation of other fields in WicketTester.
> --------------------------------------------------------------------------
>
>                 Key: WICKET-2015
>                 URL: https://issues.apache.org/jira/browse/WICKET-2015
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-RC1
>         Environment: Windows XP SP3, Eclipse IDE, Wicket 1.4-rc1.
>            Reporter: Kari Maja
>         Attachments: Wicket-Quickstart-Update.zip, Wicket-Quickstart.zip
>
>
> Submitting form with empty FileUpload -field break validations of other 
> fields in WicketTester:
> - TextField mandatority (field.setRequired(true)).
> - TextField input length validation 
> (field.add(StringValidator(lengthBetween(...)))).
> - DropDownChoice validation does not "see" selection.
> If File Upload -field is filled, then validations above work.
> Form submits manually without a problem in web browser.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to