本文整理汇总了Java中org.alfresco.repo.security.person.TestPersonManager类的典型用法代码示例。如果您正苦于以下问题:Java TestPersonManager类的具体用法?Java TestPersonManager怎么用?Java TestPersonManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TestPersonManager类属于org.alfresco.repo.security.person包,在下文中一共展示了TestPersonManager类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSetUpInTransaction
import org.alfresco.repo.security.person.TestPersonManager; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected void onSetUpInTransaction() throws Exception
{
ServiceRegistry registry = (ServiceRegistry) applicationContext.getBean(ServiceRegistry.SERVICE_REGISTRY);
this.workflowService = registry.getWorkflowService();
this.authenticationComponent = (AuthenticationComponent) applicationContext.getBean("authenticationComponent");
this.nodeService = registry.getNodeService();
this.transactionHelper = (RetryingTransactionHelper) this.applicationContext
.getBean("retryingTransactionHelper");
this.activitiProcessEngine = (ProcessEngine) this.applicationContext.getBean("activitiProcessEngine");
MutableAuthenticationService authenticationService = registry.getAuthenticationService();
PersonService personService = registry.getPersonService();
this.personManager = new TestPersonManager(authenticationService, personService, nodeService);
authenticationComponent.setSystemUserAsCurrentUser();
}
示例2: onSetUp
import org.alfresco.repo.security.person.TestPersonManager; //导入依赖的package包/类
@Override
@Before
public void onSetUp() throws Exception
{
super.onSetUp();
serviceRegistry = (ServiceRegistry) getApplicationContext().getBean(ServiceRegistry.SERVICE_REGISTRY);
AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser();
SiteService siteService = serviceRegistry.getSiteService();
FileFolderService fileFolderService = serviceRegistry.getFileFolderService();
PermissionService permissionService = serviceRegistry.getPermissionService();
this.nodeService = serviceRegistry.getNodeService();
ChannelService channelService = (ChannelService) getApplicationContext().getBean(ChannelServiceImpl.NAME);
PublishingService publishingService = (PublishingService) getApplicationContext().getBean(PublishServiceImpl.NAME);
MutableAuthenticationService authenticationService= (MutableAuthenticationService) getApplicationContext().getBean(ServiceRegistry.AUTHENTICATION_SERVICE.getLocalName());
PersonService personService= (PersonService) getApplicationContext().getBean(ServiceRegistry.PERSON_SERVICE.getLocalName());
this.personManager = new TestPersonManager(authenticationService, personService, nodeService);
this.testHelper = new PublishingTestHelper(channelService, publishingService, siteService, fileFolderService, permissionService);
this.username = GUID.generate();
personManager.createPerson(username);
}
示例3: setUp
import org.alfresco.repo.security.person.TestPersonManager; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
super.setUp();
ApplicationContext appContext = getServer().getApplicationContext();
nodeService = (NodeService)appContext.getBean("NodeService");
replicationService = (ReplicationService)appContext.getBean("ReplicationService");
actionTrackingService = (ActionTrackingService)appContext.getBean("actionTrackingService");
repositoryHelper = (Repository)appContext.getBean("repositoryHelper");
transactionService = (TransactionService)appContext.getBean("transactionService");
MutableAuthenticationService authenticationService = (MutableAuthenticationService)appContext.getBean("AuthenticationService");
PersonService personService = (PersonService)appContext.getBean("PersonService");
personManager = new TestPersonManager(authenticationService, personService, nodeService);
UserTransaction txn = transactionService.getUserTransaction();
txn.begin();
personManager.createPerson(USER_NORMAL);
// Ensure we start with no replication definitions
// (eg another test left them behind)
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
for(ReplicationDefinition rd : replicationService.loadReplicationDefinitions()) {
replicationService.deleteReplicationDefinition(rd);
}
txn.commit();
// Grab a reference to the data dictionary
dataDictionary = nodeService.getChildByName(
repositoryHelper.getCompanyHome(),
ContentModel.ASSOC_CONTAINS,
"Data Dictionary"
);
AuthenticationUtil.clearCurrentSecurityContext();
}
示例4: setUp
import org.alfresco.repo.security.person.TestPersonManager; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
super.setUp();
ApplicationContext appContext = getServer().getApplicationContext();
namespaceService = (NamespaceService) appContext.getBean("NamespaceService");
workflowService = (WorkflowService) appContext.getBean("WorkflowService");
MutableAuthenticationService authenticationService = (MutableAuthenticationService) appContext.getBean("AuthenticationService");
PersonService personService = (PersonService) appContext.getBean("PersonService");
SearchService searchService = (SearchService) appContext.getBean("SearchService");
FileFolderService fileFolderService = (FileFolderService) appContext.getBean("FileFolderService");
nodeService = (NodeService) appContext.getBean("NodeService");
// for the purposes of the tests make sure workflow engine is enabled/visible.
WorkflowAdminServiceImpl workflowAdminService = (WorkflowAdminServiceImpl) appContext.getBean("workflowAdminService");
this.wfTestHelper = new WorkflowTestHelper(workflowAdminService, getEngine(), true);
AuthorityService authorityService = (AuthorityService) appContext.getBean("AuthorityService");
personManager = new TestPersonManager(authenticationService, personService, nodeService);
groupManager = new TestGroupManager(authorityService);
authenticationComponent = (AuthenticationComponent) appContext.getBean("authenticationComponent");
dictionaryService = (DictionaryService) appContext.getBean("dictionaryService");
personManager.createPerson(USER1);
personManager.createPerson(USER2);
personManager.createPerson(USER3);
authenticationComponent.setSystemUserAsCurrentUser();
groupManager.addUserToGroup(GROUP, USER2);
packageRef = workflowService.createPackage(null);
NodeRef companyHome = searchService.selectNodes(nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE), COMPANY_HOME, null, namespaceService, false).get(0);
contentNodeRef = fileFolderService.create(companyHome, TEST_CONTENT + System.currentTimeMillis(), ContentModel.TYPE_CONTENT).getNodeRef();
authenticationComponent.clearCurrentSecurityContext();
}
示例5: setUp
import org.alfresco.repo.security.person.TestPersonManager; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
super.setUp();
ApplicationContext ctx = getServer().getApplicationContext();
ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
SiteService siteService = serviceRegistry.getSiteService();
FileFolderService fileFolderService = serviceRegistry.getFileFolderService();
this.nodeService = serviceRegistry.getNodeService();
this.permissionService= serviceRegistry.getPermissionService();
this.channelService = (ChannelService) ctx.getBean(ChannelServiceImpl.NAME);
this.publishingService= (PublishingService) ctx.getBean(PublishServiceImpl.NAME);
this.channelHelper = (ChannelHelper) ctx.getBean(ChannelHelper.NAME);
this.testHelper = new PublishingTestHelper(channelService, publishingService, siteService, fileFolderService, permissionService);
MutableAuthenticationService authenticationService = serviceRegistry.getAuthenticationService();
PersonService personService = serviceRegistry.getPersonService();
this.personManager = new TestPersonManager(authenticationService, personService, nodeService);
personManager.createPerson(userName);
AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser();
ChannelType publishAny = testHelper.mockChannelType(publishAnyType);
when(publishAny.canPublish()).thenReturn(true);
when(publishAny.canUnpublish()).thenReturn(true);
ChannelType publishPdf= testHelper.mockChannelType(publishPdfType);
when(publishPdf.canPublish()).thenReturn(true);
when(publishPdf.getSupportedMimeTypes()).thenReturn(Collections.singleton(MimetypeMap.MIMETYPE_PDF));
ChannelType statusUpdate= testHelper.mockChannelType(statusUpdateType);
when(statusUpdate.canPublishStatusUpdates()).thenReturn(true);
when(statusUpdate.getMaximumStatusLength()).thenReturn(maxStatusLength);
}
示例6: onSetUpInTransaction
import org.alfresco.repo.security.person.TestPersonManager; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected void onSetUpInTransaction() throws Exception
{
super.onSetUpInTransaction();
serviceRegistry = (ServiceRegistry) applicationContext.getBean(ServiceRegistry.SERVICE_REGISTRY);
this.workflowService = serviceRegistry.getWorkflowService();
this.authenticationComponent = (AuthenticationComponent) applicationContext.getBean("authenticationComponent");
this.nodeService = serviceRegistry.getNodeService();
this.historyService = (HistoryService) applicationContext.getBean("activitiHistoryService");
Repository repositoryHelper = (Repository) applicationContext.getBean("repositoryHelper");
this.companyHome = repositoryHelper.getCompanyHome();
try
{
this.transactionService = (TransactionServiceImpl) serviceRegistry.getTransactionService();
}
catch (ClassCastException e)
{
throw new AlfrescoRuntimeException("The AbstractWorkflowServiceIntegrationTest needs direct access to the TransactionServiceImpl");
}
MutableAuthenticationService authenticationService = serviceRegistry.getAuthenticationService();
AuthorityService authorityService = serviceRegistry.getAuthorityService();
PersonService personService = serviceRegistry.getPersonService();
authenticationComponent.setSystemUserAsCurrentUser();
WorkflowAdminServiceImpl workflowAdminService = (WorkflowAdminServiceImpl) applicationContext.getBean(WorkflowAdminServiceImpl.NAME);
this.wfTestHelper = new WorkflowTestHelper(workflowAdminService, getEngine(), true);
// create test users
this.personManager = new TestPersonManager(authenticationService, personService, nodeService);
this.groupManager = new TestGroupManager(authorityService);
personManager.createPerson(USER1);
personManager.createPerson(USER2);
personManager.createPerson(USER3);
personManager.createPerson(USER4);
// create test groups
groupManager.addGroupToParent(GROUP, SUB_GROUP);
// add users to groups
groupManager.addUserToGroup(GROUP, USER1);
groupManager.addUserToGroup(SUB_GROUP, USER2);
personManager.setUser(USER1);
}
示例7: setUp
import org.alfresco.repo.security.person.TestPersonManager; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected void setUp() throws Exception
{
super.setUp();
ApplicationContext appContext = getServer().getApplicationContext();
nodeService = (NodeService)appContext.getBean("NodeService");
replicationService = (ReplicationService)appContext.getBean("ReplicationService");
actionTrackingService = (ActionTrackingService)appContext.getBean("actionTrackingService");
repositoryHelper = (Repository)appContext.getBean("repositoryHelper");
transactionService = (TransactionService)appContext.getBean("transactionService");
executingActionsCache = (SimpleCache<String, ExecutionDetails>)appContext.getBean("executingActionsCache");
MutableAuthenticationService authenticationService = (MutableAuthenticationService)appContext.getBean("AuthenticationService");
PersonService personService = (PersonService)appContext.getBean("PersonService");
personManager = new TestPersonManager(authenticationService, personService, nodeService);
UserTransaction txn = transactionService.getUserTransaction();
txn.begin();
personManager.createPerson(USER_NORMAL);
// Ensure we start with no replication definitions
// (eg another test left them behind)
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
for(ReplicationDefinition rd : replicationService.loadReplicationDefinitions())
{
replicationService.deleteReplicationDefinition(rd);
}
txn.commit();
// Grab a reference to the data dictionary
dataDictionary = nodeService.getChildByName(
repositoryHelper.getCompanyHome(),
ContentModel.ASSOC_CONTAINS,
"Data Dictionary"
);
AuthenticationUtil.clearCurrentSecurityContext();
}
示例8: setUp
import org.alfresco.repo.security.person.TestPersonManager; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
super.setUp();
ApplicationContext appContext = getServer().getApplicationContext();
namespaceService = (NamespaceService) appContext.getBean("NamespaceService");
workflowService = (WorkflowService) appContext.getBean("WorkflowService");
MutableAuthenticationService authenticationService = (MutableAuthenticationService) appContext.getBean("AuthenticationService");
PersonService personService = (PersonService) appContext.getBean("PersonService");
SearchService searchService = (SearchService) appContext.getBean("SearchService");
FileFolderService fileFolderService = (FileFolderService) appContext.getBean("FileFolderService");
nodeService = (NodeService) appContext.getBean("NodeService");
// for the purposes of the tests make sure workflow engine is enabled/visible.
WorkflowAdminServiceImpl workflowAdminService = (WorkflowAdminServiceImpl) appContext.getBean("workflowAdminService");
this.wfTestHelper = new WorkflowTestHelper(workflowAdminService, getEngine(), true);
AuthorityService authorityService = (AuthorityService) appContext.getBean("AuthorityService");
personManager = new TestPersonManager(authenticationService, personService, nodeService);
groupManager = new TestGroupManager(authorityService, searchService);
authenticationComponent = (AuthenticationComponent) appContext.getBean("authenticationComponent");
dictionaryService = (DictionaryService) appContext.getBean("dictionaryService");
personManager.createPerson(USER1);
personManager.createPerson(USER2);
personManager.createPerson(USER3);
authenticationComponent.setSystemUserAsCurrentUser();
groupManager.addUserToGroup(GROUP, USER2);
packageRef = workflowService.createPackage(null);
NodeRef companyHome = searchService.selectNodes(nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE), COMPANY_HOME, null, namespaceService, false).get(0);
contentNodeRef = fileFolderService.create(companyHome, TEST_CONTENT + System.currentTimeMillis(), ContentModel.TYPE_CONTENT).getNodeRef();
authenticationComponent.clearCurrentSecurityContext();
}
示例9: onSetUpInTransaction
import org.alfresco.repo.security.person.TestPersonManager; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected void onSetUpInTransaction() throws Exception
{
super.onSetUpInTransaction();
serviceRegistry = (ServiceRegistry) applicationContext.getBean(ServiceRegistry.SERVICE_REGISTRY);
this.workflowService = serviceRegistry.getWorkflowService();
this.authenticationComponent = (AuthenticationComponent) applicationContext.getBean("authenticationComponent");
this.nodeService = serviceRegistry.getNodeService();
this.historyService = (HistoryService) applicationContext.getBean("activitiHistoryService");
Repository repositoryHelper = (Repository) applicationContext.getBean("repositoryHelper");
this.companyHome = repositoryHelper.getCompanyHome();
try
{
this.transactionService = (TransactionServiceImpl) serviceRegistry.getTransactionService();
}
catch (ClassCastException e)
{
throw new AlfrescoRuntimeException("The AbstractWorkflowServiceIntegrationTest needs direct access to the TransactionServiceImpl");
}
MutableAuthenticationService authenticationService = serviceRegistry.getAuthenticationService();
AuthorityService authorityService = serviceRegistry.getAuthorityService();
PersonService personService = serviceRegistry.getPersonService();
SearchService searchService = serviceRegistry.getSearchService();
authenticationComponent.setSystemUserAsCurrentUser();
WorkflowAdminServiceImpl workflowAdminService = (WorkflowAdminServiceImpl) applicationContext.getBean(WorkflowAdminServiceImpl.NAME);
this.wfTestHelper = new WorkflowTestHelper(workflowAdminService, getEngine(), true);
// create test users
this.personManager = new TestPersonManager(authenticationService, personService, nodeService);
this.groupManager = new TestGroupManager(authorityService, searchService);
personManager.createPerson(USER1);
personManager.createPerson(USER2);
personManager.createPerson(USER3);
personManager.createPerson(USER4);
// create test groups
groupManager.addGroupToParent(GROUP, SUB_GROUP);
// add users to groups
groupManager.addUserToGroup(GROUP, USER1);
groupManager.addUserToGroup(SUB_GROUP, USER2);
personManager.setUser(USER1);
}