public abstract class AbstractPersonRule
extends org.junit.rules.ExternalResource
cm:person
nodes and authentication details for the transient users often required within test code.| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.context.ApplicationContext |
appContext |
protected ApplicationContextInit |
appContextRule |
protected static java.lang.String |
EMAIL |
protected static java.lang.String |
FIRST_NAME |
protected static java.lang.String |
JOB_TITLE |
protected static java.lang.String |
LAST_NAME |
protected static java.lang.String |
PASSWORD |
| Constructor and Description |
|---|
AbstractPersonRule(org.springframework.context.ApplicationContext appContext)
Constructs a person rule with the specified spring context, which will be necessary
to actually create and delete the users.
|
AbstractPersonRule(ApplicationContextInit appContextRule)
Constructs a person rule with a reference to an
rule. |
| Modifier and Type | Method and Description |
|---|---|
protected org.alfresco.service.cmr.repository.NodeRef |
createPerson(java.lang.String userName)
This method creates a user with the specified username.
|
protected void |
deletePerson(java.lang.String userName)
This method deletes the specified user's person and authentication details if they are
present in the system.
|
protected org.springframework.context.ApplicationContext |
getApplicationContext()
This method retrieves the spring application context given to this rule.
|
protected static final java.lang.String PASSWORD
protected static final java.lang.String FIRST_NAME
protected static final java.lang.String LAST_NAME
protected static final java.lang.String EMAIL
protected static final java.lang.String JOB_TITLE
protected final org.springframework.context.ApplicationContext appContext
protected final ApplicationContextInit appContextRule
public AbstractPersonRule(org.springframework.context.ApplicationContext appContext)
appContext - the spring app context (needed to get at Alfresco services).public AbstractPersonRule(ApplicationContextInit appContextRule)
rule. This other rule will
be used to access the application context and from there the necessary services for the creation and deletion of users.appContext - a rule which can provide the spring application context.protected org.springframework.context.ApplicationContext getApplicationContext()
java.lang.NullPointerException - if the application context has not been initialised when requested.protected org.alfresco.service.cmr.repository.NodeRef createPerson(java.lang.String userName)
userName - the username of the new user.protected void deletePerson(java.lang.String userName)
userName - the username of the user to be deleted.Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.