Search in sources :

Example 6 with ChildApplicationContextFactory

use of org.alfresco.repo.management.subsystems.ChildApplicationContextFactory 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)6 ApplicationContext (org.springframework.context.ApplicationContext)5 SiteInfo (org.alfresco.service.cmr.site.SiteInfo)3 AlfrescoRuntimeException (org.alfresco.error.AlfrescoRuntimeException)1 MailActionExecuter (org.alfresco.repo.action.executer.MailActionExecuter)1 DefaultChildApplicationContextManager (org.alfresco.repo.management.subsystems.DefaultChildApplicationContextManager)1 NodeRef (org.alfresco.service.cmr.repository.NodeRef)1 BeforeClass (org.junit.BeforeClass)1