You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jean-Baptiste Quenot <jb...@apache.org> on 2007/09/03 16:12:52 UTC

Re: WicketTester, testing Form and SubmitLink

* wicket user:
> 
> 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");
> <snip/>
> - 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

This is a bug in WicketTester (BaseWicketTester actually).  Like
Igor suggests, please create a JIRA issue at
https://issues.apache.org/jira/browse/WICKET

If you could provide a "quickstart" project, that would be great
too.

Thanks,
-- 
     Jean-Baptiste Quenot
aka  John Banana   Qwerty
http://caraldi.com/jbq/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: WicketTester, testing Form and SubmitLink

Posted by Jean-Baptiste Quenot <jb...@apache.org>.
You may want to paste the exception BTW, it is missing.
-- 
     Jean-Baptiste Quenot
aka  John Banana   Qwerty
http://caraldi.com/jbq/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: WicketTester, testing Form and SubmitLink

Posted by wicket user <wi...@comley.org>.
Done, I've just included a small project with a form and a submit link as
well as a unit testcase to highlight the problem. They are not unit test
cases for WicketTester as such, I would have to spend a bit more time poking
around the code to know how to write a proper test for the tester...


Thanks again,
Simon

On 05/09/07, Jean-Baptiste Quenot <jb...@apache.org> wrote:
>
> * wicket user:
>
> > I've raised the issue, https://issues.apache.org/jira/browse/WICKET-932
>
> Thanks!
>
> > Jean, please excuse my ignorance but when you request a quickstart
> project
> > do you mean you want the whole quickstart project with the problem
> > illustrated zipped into my file.
>
> Anything that helps us to go straight to the problem can be
> helpful.
>
> This can be:
>
> * A Java project with pom.xml, jetty launcher and relevant
>   sources.  This is probably not really the best thing to do for the
>   problem at hand
> * Unit tests, this is especially useful if the problem is about
>   WicketTester itself
>
> It is preferrable to submit the unit tests as a patch to the
> existing Wicket test classes, but if you file whole classes, that
> will do it as well.
> --
>      Jean-Baptiste Quenot
> aka  John Banana   Qwerty
> http://caraldi.com/jbq/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: WicketTester, testing Form and SubmitLink

Posted by Jean-Baptiste Quenot <jb...@apache.org>.
* wicket user:

> I've raised the issue, https://issues.apache.org/jira/browse/WICKET-932

Thanks!

> Jean, please excuse my ignorance but when you request a quickstart project
> do you mean you want the whole quickstart project with the problem
> illustrated zipped into my file.

Anything that helps us to go straight to the problem can be
helpful.

This can be:

* A Java project with pom.xml, jetty launcher and relevant
  sources.  This is probably not really the best thing to do for the
  problem at hand
* Unit tests, this is especially useful if the problem is about
  WicketTester itself

It is preferrable to submit the unit tests as a patch to the
existing Wicket test classes, but if you file whole classes, that
will do it as well.
-- 
     Jean-Baptiste Quenot
aka  John Banana   Qwerty
http://caraldi.com/jbq/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: WicketTester, testing Form and SubmitLink

Posted by wicket user <wi...@comley.org>.
Sorry I've been so slack in responding.....

I've raised the issue, https://issues.apache.org/jira/browse/WICKET-932

Jean, please excuse my ignorance but when you request a quickstart project
do you mean you want the whole quickstart project with the problem
illustrated zipped into my file.

Any improvements required for the issue description, first JIRA issue
raised.

Thanks
Simon

On 03/09/07, Jean-Baptiste Quenot <jb...@apache.org> wrote:
>
> * wicket user:
> >
> > 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");
> > <snip/>
> > - 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
>
> This is a bug in WicketTester (BaseWicketTester actually).  Like
> Igor suggests, please create a JIRA issue at
> https://issues.apache.org/jira/browse/WICKET
>
> If you could provide a "quickstart" project, that would be great
> too.
>
> Thanks,
> --
>      Jean-Baptiste Quenot
> aka  John Banana   Qwerty
> http://caraldi.com/jbq/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>