You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by kamiseq <ka...@gmail.com> on 2011/06/22 14:28:21 UTC

how to setup guice in unit test

hej,
I ve found something something like this
http://blog.yanivkessler.com/2010/06/writing-unit-tests-for-guicey-wicket.htmlbut
I think there should be some easier way to setup guice DI. I tried to
use AtUnit but it doesnt work with webpages( I get
*org.apache.wicket.WicketRuntimeException:
There is no application attached to current thread main *or object are not
simply injected)

can you explain how to configure it?*
*
pozdrawiam
Paweł Kamiński

kamiseq@gmail.com
pkaminski.prv@gmail.com
______________________

Re: how to setup guice in unit test

Posted by kamiseq <ka...@gmail.com>.
ok, then I think I just took the wrong turn ;] I dont know why they bother
themselves with custom testRunner

pozdrawiam
Paweł Kamiński

kamiseq@gmail.com
pkaminski.prv@gmail.com
______________________

Re: how to setup guice in unit test

Posted by Martin Grigorov <mg...@apache.org>.
If you talk about wickettester test then I setup it the same way I do
it for running in web container - thru
IComponentInstantiationListener.
I just pass different Giuce module which setups mock services.

You can see it in www.jweekend.com/dev/LegUp guice quickstart.

On Wed, Jun 22, 2011 at 3:28 PM, kamiseq <ka...@gmail.com> wrote:
> hej,
> I ve found something something like this
> http://blog.yanivkessler.com/2010/06/writing-unit-tests-for-guicey-wicket.htmlbut
> I think there should be some easier way to setup guice DI. I tried to
> use AtUnit but it doesnt work with webpages( I get
> *org.apache.wicket.WicketRuntimeException:
> There is no application attached to current thread main *or object are not
> simply injected)
>
> can you explain how to configure it?*
> *
> pozdrawiam
> Paweł Kamiński
>
> kamiseq@gmail.com
> pkaminski.prv@gmail.com
> ______________________
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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