On Wed, Mar 3, 2010 at 1:00 PM, bklough <[email protected]> wrote:
> Perhaps I missed something, but I believe all you need is:
>
>    injector.injectMembers(this);
>
> in your test class right after acquiring the injector instance (before
> the commented template = injector.getInstance(...) line).  This will
> fullfil the injection requests in the test itself.  I use a base test
> class that does the equivalent for injecting loggers, Sessions, etc..,
> so there shouldn't be a ton of boilerplate.
>

Is using an injector in tests common practice? I would have thought
that hand wiring would be more popular.

-- 
David
blog: http://www.traceback.org
twitter: http://twitter.com/dstanek

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to