本文整理汇总了Java中org.alfresco.repo.security.person.UserNameMatcherImpl类的典型用法代码示例。如果您正苦于以下问题:Java UserNameMatcherImpl类的具体用法?Java UserNameMatcherImpl怎么用?Java UserNameMatcherImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UserNameMatcherImpl类属于org.alfresco.repo.security.person包,在下文中一共展示了UserNameMatcherImpl类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.alfresco.repo.security.person.UserNameMatcherImpl; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
super.setUp();
this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService");
this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent");
this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService");
this.userNameMatcherImpl = (UserNameMatcherImpl)getServer().getApplicationContext().getBean("userNameMatcher");
this.authenticationComponent.setSystemUserAsCurrentUser();
// Create users
createUser(USER_ONE);
createUser(USER_TWO);
createUser(USER_THREE);
// Do tests as user one
this.authenticationComponent.setCurrentUser(USER_ONE);
}
示例2: setUp
import org.alfresco.repo.security.person.UserNameMatcherImpl; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
super.setUp();
MockitoAnnotations.initMocks(this);
ApplicationContext ctx = getServer().getApplicationContext();
this.authenticationService = (MutableAuthenticationService)ctx.getBean("AuthenticationService");
this.authenticationComponent = (AuthenticationComponent)ctx.getBean("authenticationComponent");
this.personService = (PersonService)ctx.getBean("PersonService");
this.userNameMatcherImpl = (UserNameMatcherImpl)ctx.getBean("userNameMatcher");
this.nodeService = (NodeService)ctx.getBean("NodeService");
this.contentService = (ContentService)ctx.getBean("contentService");
this.userUsageTrackingComponent = (UserUsageTrackingComponent)ctx.getBean("userUsageTrackingComponent");
this.contentUsage = (ContentUsageImpl)ctx.getBean("contentUsageImpl");
this.transactionService = (TransactionService) ctx.getBean("TransactionService");
serviceRegistry = (ServiceDescriptorRegistry) ctx.getBean("ServiceRegistry");
serviceRegistry.setMockSearchService(mockSearchService);
when(mockSearchService.query(any())).thenReturn(mockSearchServiceQueryResultSet);
when(mockSearchServiceQueryResultSet.getNodeRefs()).thenReturn(dummySearchServiceQueryNodeRefs);
// enable usages
contentUsage.setEnabled(true);
contentUsage.init();
userUsageTrackingComponent.setEnabled(true);
userUsageTrackingComponent.init();
userUsageTrackingComponent.bootstrapInternal();
this.authenticationComponent.setSystemUserAsCurrentUser();
// Create users
createUser(USER_ONE);
createUser(USER_TWO);
createUser(USER_THREE);
// Do tests as user one
this.authenticationComponent.setCurrentUser(USER_ONE);
}