Re: how to test session/request scopes ?

2009-06-13 Thread naaka
thanks dhanji. but what other ways do i have for testing ? i wanted to do some integration testing and i need to have everything injected by the container. nicola On Jun 12, 6:32 pm, Dhanji R. Prasanna dha...@gmail.com wrote: You should bind @RequestScoped and @SessionScoped to your own

Re: how to test session/request scopes ?

2009-06-13 Thread Dhanji R. Prasanna
You can simulate a request by instantiating GuiceFilter() and passing it a mock request and response. If you have previously installed a configured ServletModule, it will execute the servlets + filters registered in the GS2 pipeline. Dhanji. On Sat, Jun 13, 2009 at 5:12 AM, naaka

how to test session/request scopes ?

2009-06-12 Thread naaka
hi, i tried out google guice and it looks great. i have tdd-ed a small spike with persistence and singleton/no scopes and every worked fine. now i have added the servlet-guice extension, and changed a class to session scope, but my test complaint: com.google.inject.ProvisionException: Guice

Re: how to test session/request scopes ?

2009-06-12 Thread Dhanji R. Prasanna
You should bind @RequestScoped and @SessionScoped to your own mock Scope implementation. Then Guice will use this instead of its default HTTP scopes. In this case you want to omit the ServletModule in your test. MockRequestScope myMockScope = new MockRequestScope(); bindScope(RequestScoped.class,