Search in sources :

Example 1 with DefaultChildApplicationContextManager

use of org.alfresco.repo.management.subsystems.DefaultChildApplicationContextManager in project alfresco-remote-api by Alfresco.

the class RemoteAuthenticatorFactoryTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception {
    ApplicationContext ctx = ApplicationContextHelper.getApplicationContext(contextLocations);
    DefaultChildApplicationContextManager childApplicationContextManager = (DefaultChildApplicationContextManager) ctx.getBean("Authentication");
    remoteUserAuthenticatorFactory = (RemoteUserAuthenticatorFactory) ctx.getBean("webscripts.authenticator.remoteuser");
    personService = (PersonService) ctx.getBean("PersonService");
    transactionService = (TransactionService) ctx.getBean("TransactionService");
    authenticationDAO = (MutableAuthenticationDao) ctx.getBean("authenticationDao");
    childApplicationContextManager.stop();
    childApplicationContextManager.setProperty("chain", "external1:external");
    ChildApplicationContextFactory childApplicationContextFactory = childApplicationContextManager.getChildApplicationContextFactory("external1");
    childApplicationContextFactory.stop();
    childApplicationContextFactory.setProperty("external.authentication.proxyUserName", "");
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) DefaultChildApplicationContextManager(org.alfresco.repo.management.subsystems.DefaultChildApplicationContextManager) ChildApplicationContextFactory(org.alfresco.repo.management.subsystems.ChildApplicationContextFactory) BeforeClass(org.junit.BeforeClass)

Aggregations

ChildApplicationContextFactory (org.alfresco.repo.management.subsystems.ChildApplicationContextFactory)1 DefaultChildApplicationContextManager (org.alfresco.repo.management.subsystems.DefaultChildApplicationContextManager)1 BeforeClass (org.junit.BeforeClass)1 ApplicationContext (org.springframework.context.ApplicationContext)1