> injector = Guice.createInjector(new
> TemplateModule.Builder().withSession(new Session()).buildModule(),
>   new AbstractModule() {
>       �...@override
>        public void configure() {
>                requestInjection(this);
>    }});

This doesn't work because requestInjection(this) requests injection of
your anonymous module
and because @BeforeClass can only be used on a static method, so there
is no 'this' for your unit test.

I think adding a method with @Before and then
requestInjection(YourTest.this) should work. Or you could use
requestStaticInjection instead. Or, what I would do frankly, don't
bother and just get your instance from the injector when you need it.

Eelco

-- 
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