Search in sources :

Example 1 with GuiceModuleLoader

use of org.forgerock.guice.core.GuiceModuleLoader in project OpenAM by OpenRock.

the class JavaScriptValidatorTest method setupGuiceModules.

@BeforeMethod
@Override
public void setupGuiceModules() throws Exception {
    //This ensures that the other Guice modules on the classpath don't get
    //loaded as Guice will balk.
    InjectorConfiguration.setGuiceModuleLoader(new GuiceModuleLoader() {

        @Override
        public Set<Class<? extends Module>> getGuiceModules(Class<? extends Annotation> aClass) {
            return new HashSet<>();
        }
    });
    super.setupGuiceModules();
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) GuiceModuleLoader(org.forgerock.guice.core.GuiceModuleLoader) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with GuiceModuleLoader

use of org.forgerock.guice.core.GuiceModuleLoader in project OpenAM by OpenRock.

the class RestRouterIT method setupGuiceModules.

@BeforeMethod(dependsOnMethods = "setupMocks")
@Override
public void setupGuiceModules() throws Exception {
    InjectorConfiguration.setGuiceModuleLoader(new GuiceModuleLoader() {

        @Override
        public Set<Class<? extends Module>> getGuiceModules(Class<? extends Annotation> clazz) {
            return new HashSet<>();
        }
    });
    super.setupGuiceModules();
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) GuiceModuleLoader(org.forgerock.guice.core.GuiceModuleLoader) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 3 with GuiceModuleLoader

use of org.forgerock.guice.core.GuiceModuleLoader in project OpenAM by OpenRock.

the class IdRepoTestBase method setUpSuite.

@BeforeClass
public void setUpSuite() throws Exception {
    InjectorConfiguration.setGuiceModuleLoader(new GuiceModuleLoader() {

        @Override
        public Set<Class<? extends Module>> getGuiceModules(Class<? extends Annotation> aClass) {
            return Collections.<Class<? extends Module>>singleton(TestGuiceModule.class);
        }
    });
    PowerMockito.mockStatic(WebtopNaming.class);
    idRepoListener = PowerMockito.mock(IdRepoListener.class);
    when(WebtopNaming.getAMServerID()).thenReturn("01");
    when(WebtopNaming.getSiteID(eq("01"))).thenReturn("02");
    memoryBackend = decorateBackend(new MemoryBackend(new LDIFEntryReader(getClass().getResourceAsStream(getLDIFPath()))));
}
Also used : IdRepoListener(com.sun.identity.idm.IdRepoListener) Set(java.util.Set) LDIFEntryReader(org.forgerock.opendj.ldif.LDIFEntryReader) GuiceModuleLoader(org.forgerock.guice.core.GuiceModuleLoader) MemoryBackend(org.forgerock.opendj.ldap.MemoryBackend) BeforeClass(org.testng.annotations.BeforeClass)

Example 4 with GuiceModuleLoader

use of org.forgerock.guice.core.GuiceModuleLoader in project OpenAM by OpenRock.

the class GroovyValidatorTest method setupGuiceModules.

@BeforeMethod
@Override
public void setupGuiceModules() throws Exception {
    //This ensures that the other Guice modules on the classpath don't get
    //loaded as Guice will balk.
    InjectorConfiguration.setGuiceModuleLoader(new GuiceModuleLoader() {

        @Override
        public Set<Class<? extends Module>> getGuiceModules(Class<? extends Annotation> aClass) {
            return new HashSet<>();
        }
    });
    super.setupGuiceModules();
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) GuiceModuleLoader(org.forgerock.guice.core.GuiceModuleLoader) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

Set (java.util.Set)4 GuiceModuleLoader (org.forgerock.guice.core.GuiceModuleLoader)4 HashSet (java.util.HashSet)3 BeforeMethod (org.testng.annotations.BeforeMethod)3 IdRepoListener (com.sun.identity.idm.IdRepoListener)1 MemoryBackend (org.forgerock.opendj.ldap.MemoryBackend)1 LDIFEntryReader (org.forgerock.opendj.ldif.LDIFEntryReader)1 BeforeClass (org.testng.annotations.BeforeClass)1