I have some model classes with JSR 303 validation annotations, and I have some 
FormComponentPanels for each. Some of these will be nested. To test that the 
Wicket validation is correct, I'm creating a ValidationForm, which contains one 
of my panels, which contains another of my panels, and I am tying my form to a 
local minimal test object without the other fields I will be using later. I am 
using a CompoundPropertyModel. When I have the WicketTester initialize the 
ValidationForm, it looks for the 'parent' field in the minimal test object, 
which does exist.  Then, I get at line 302 of AbstractPropertyModel,

      return PropertyResolver.getPropertyGetter(expression, target);

I get a call with expression being "child", and target being the local test 
object.  Were expression "parent.child", this would succeed, as it would call 
getParent().getChild(). However, I'm not sure whether this is my bug or the 
wicket-validation-bean library's.

Incidentally, I'm getting an interesting misfeature from the validation; the 
order in which the validations are performed seems to be nondeterministic. This 
means that the test below fails sometimes.

                tester.assertFeedback("path:to:panel", new String[] {messageA, 
messageB});

Often, when I reverse the order of messageA and messageB, the next test fails 
too! Perhaps Wicket 1.5.3 can have WicketTester.assertFeedback(String path, 
Set<String> messages).

Finally, I might need to avoid FormComponentPanels in the future, as some of 
the inner ones will be swapped in and out of the page depending on the user's 
choices.  I realize that the only panels that will be instrumented are the ones 
in the Form when it is originally configured.

Thanks in advance.

Respectfully,
Eric Jablow

This communication, along with any attachments, is covered by federal and state 
law governing electronic communications and may contain company proprietary and 
legally privileged information.  If the reader of this message is not the 
intended recipient, you are hereby notified that any dissemination, 
distribution, use or copying of this message is strictly prohibited.  If you 
have received this in error, please reply immediately to the sender and delete 
this message.  Thank you.

Reply via email to