1 package test.guice;
2 
3 import org.testng.Assert;
4 import org.testng.ITestContext;
5 import org.testng.annotations.Guice;
6 import org.testng.annotations.Test;
7 
8 import com.google.inject.Inject;
9 
10 @Test
11 @Guice(modules = GuiceTestModule.class)
12 public class GuiceParentModuleTest {
13   @Inject
14   MySession mySession;
15   @Inject
16   MyService myService;
17   @Inject
18   ITestContext context;
19 
testService()20   public void testService() {
21     Assert.assertNotNull(myService);
22     Assert.assertNotNull(mySession);
23     myService.serve(mySession);
24     Assert.assertNotNull(context);
25     Assert.assertEquals(context.getName(), "Guice");
26     Assert.assertEquals(context.getSuite().getName(), "parent-module-suite");
27   }
28 }
29