Exemplo n.º 1
0
  @Test
  public void createDynamicModule() {
    StartupModule startup =
        StartupModule.create(
            ASMClasspathScanner.class, PackageFilter.create(DirectFileConfigTests.class));
    startup.addFeature(ConfigurationFeature.class);

    Injector injector = Guice.createInjector(startup);
    assertNotNull(injector);
  }
Exemplo n.º 2
0
  @Test
  public void createPListConfiguration() {
    StartupModule startup =
        StartupModule.create(
            ASMClasspathScanner.class, PackageFilter.create(DirectFileConfigTests.class));
    startup.addFeature(ConfigurationFeature.class);

    Injector injector = Guice.createInjector(startup);
    assertNotNull(injector);

    TestInterface instance = injector.getInstance(TestInterface.class);
    Assert.assertTrue(instance.sayHello(), "sayHello() - yeahh!!".equals(instance.sayHello()));
  }