RM: Modificaiton to unit test to see if issue seen only on Bamboo can be worked around.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@49383 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2013-04-18 01:31:50 +00:00
parent 7cdb83dbd8
commit 484cbe9331
2 changed files with 15 additions and 4 deletions

View File

@@ -65,8 +65,11 @@ public class CreateRecordActionTest extends BaseRMTestCase
{ {
// Testing // Testing
AuthorityDAO authDao = (AuthorityDAO)applicationContext.getBean("authorityDAO"); AuthorityDAO authDao = (AuthorityDAO)applicationContext.getBean("authorityDAO");
assertTrue(authDao.authorityExists(AuthenticationUtil.getSystemUserName())); if (authDao.authorityExists(AuthenticationUtil.getSystemUserName()) == false)
assertFalse(true); {
createPerson(AuthenticationUtil.getSystemUserName(), false);
}
assertTrue("No person object for System available.", authDao.authorityExists(AuthenticationUtil.getSystemUserName()));
super.setupTestDataImpl(); super.setupTestDataImpl();
} }

View File

@@ -582,14 +582,22 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
* @param userName user name * @param userName user name
* @return NodeRef user node reference * @return NodeRef user node reference
*/ */
protected NodeRef createPerson(String userName) protected NodeRef createPerson(String userName, boolean createAuth)
{
if (createAuth == true)
{ {
authenticationService.createAuthentication(userName, "password".toCharArray()); authenticationService.createAuthentication(userName, "password".toCharArray());
}
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(); Map<QName, Serializable> properties = new HashMap<QName, Serializable>();
properties.put(ContentModel.PROP_USERNAME, userName); properties.put(ContentModel.PROP_USERNAME, userName);
return personService.createPerson(properties); return personService.createPerson(properties);
} }
protected NodeRef createPerson(String userName)
{
return createPerson(userName, true);
}
/** /**
* Setup multi hierarchy test data * Setup multi hierarchy test data
*/ */