hmm, dont know if wickettester has support for submitlink because that has
to both submit the form/process it and invoke onsubmit on it. please add an
rfe into jira.
-igor
On 8/30/07, wicket user <[EMAIL PROTECTED]> wrote:
>
> Hi Folks,
>
> I'm trying to test a form submission with SubmitLink, test code below:
>
> tester.setParameterForNextRequest
> ("numberChangeForm:numberToChangeTo",
> numberToChangeTo);
>
> reset(smsServiceMock);
> smsServiceMock.sendActivationSms(isA(Subscriber.class));
> replay(smsServiceMock);
>
> // submit the form
> //tester.clickLink("numberChangeForm:numberChangeSubmitLink");
> tester.submitForm("numberChangeForm");
>
> // check that the mock was called
> verify(smsServiceMock);
>
> tester.processRequestCycle();
>
> // Verify that the message is displayed, this just checks the
> expected components have rendered
> checkRender(numberToChangeTo);
>
> Now my SubmitLink has overridden the onSubmit() but when I step through
> the
> debug of the test that's actually not getting called. All my validators on
> the text field are getting called as expected and in fact the form works
> as
> expected when deployed so I'm thinking that it might be a WicketTester
> issue
> or the more likely scenario that I'm doing something wrong?
>
> Things I've tried:
> - debugging as mentioned, but this just shows me it's not getting called
> - trying to call the link directly but I just get the below exception
> which
> I'm not really surpised about....
>
> java.lang.IllegalArgumentException: The component class doesn't seem to
> implement any of the known *Listener interfaces: class
> com.yeigo.view.wicket.register.RegistrationCheckPage$2
> ..
>
> - Googled.........
>
> Many thanks
> Simon
>