Search in sources :

Example 11 with SessionFactory

use of org.springframework.extensions.jcr.SessionFactory in project pentaho-platform by pentaho.

the class UserRoleDaoIT method setApplicationContext.

public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException {
    manager = (IBackingRepositoryLifecycleManager) applicationContext.getBean("backingRepositoryLifecycleManager");
    SessionFactory jcrSessionFactory = (SessionFactory) applicationContext.getBean("jcrSessionFactory");
    testJcrTemplate = new JcrTemplate(jcrSessionFactory);
    testJcrTemplate.setAllowCreate(true);
    testJcrTemplate.setExposeNativeSession(true);
    repositoryAdminUsername = (String) applicationContext.getBean("repositoryAdminUsername");
    authenticatedRoleName = (String) applicationContext.getBean("singleTenantAuthenticatedAuthorityName");
    adminRoleName = (String) applicationContext.getBean("singleTenantAdminAuthorityName");
    roleBindingDaoTarget = (IRoleAuthorizationPolicyRoleBindingDao) applicationContext.getBean("roleAuthorizationPolicyRoleBindingDaoTarget");
    sysAdminRoleName = (String) applicationContext.getBean("superAdminAuthorityName");
    sysAdminUserName = (String) applicationContext.getBean("superAdminUserName");
    authorizationPolicy = (IAuthorizationPolicy) applicationContext.getBean("authorizationPolicy");
    tenantManager = (ITenantManager) applicationContext.getBean("tenantMgrProxy");
    repositoryFileDao = (IRepositoryFileDao) applicationContext.getBean("repositoryFileDao");
    userRoleDaoProxy = (IUserRoleDao) applicationContext.getBean("userRoleDaoTxn");
    userRoleDaoTestProxy = (IUserRoleDao) applicationContext.getBean("userRoleDaoTxn");
    tenantedUserNameUtils = (ITenantedPrincipleNameResolver) applicationContext.getBean("tenantedUserNameUtils");
    tenantedRoleNameUtils = (ITenantedPrincipleNameResolver) applicationContext.getBean("tenantedRoleNameUtils");
    TestPrincipalProvider.userRoleDao = (IUserRoleDao) applicationContext.getBean("userRoleDaoTxn");
    TestPrincipalProvider.adminCredentialsStrategy = (CredentialsStrategy) applicationContext.getBean("jcrAdminCredentialsStrategy");
    TestPrincipalProvider.repository = (Repository) applicationContext.getBean("jcrRepository");
    jcrTemplate = (JcrTemplate) applicationContext.getBean("jcrTemplate");
}
Also used : SessionFactory(org.springframework.extensions.jcr.SessionFactory) JcrTemplate(org.springframework.extensions.jcr.JcrTemplate)

Aggregations

SessionFactory (org.springframework.extensions.jcr.SessionFactory)11 JcrTemplate (org.springframework.extensions.jcr.JcrTemplate)9 XAResource (javax.transaction.xa.XAResource)2 XASession (org.apache.jackrabbit.api.XASession)2 Test (org.junit.Test)2 TransactionDefinition (org.springframework.transaction.TransactionDefinition)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Matchers.anyString (org.mockito.Matchers.anyString)1 IAuthorizationPolicy (org.pentaho.platform.api.engine.IAuthorizationPolicy)1 IUserRoleDao (org.pentaho.platform.api.engine.security.userroledao.IUserRoleDao)1 ITenantManager (org.pentaho.platform.api.mt.ITenantManager)1 IUnifiedRepository (org.pentaho.platform.api.repository2.unified.IUnifiedRepository)1 TransactionTemplate (org.springframework.transaction.support.TransactionTemplate)1