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
AuthorityDAO authDao = (AuthorityDAO)applicationContext.getBean("authorityDAO");
assertTrue(authDao.authorityExists(AuthenticationUtil.getSystemUserName()));
assertFalse(true);
if (authDao.authorityExists(AuthenticationUtil.getSystemUserName()) == false)
{
createPerson(AuthenticationUtil.getSystemUserName(), false);
}
assertTrue("No person object for System available.", authDao.authorityExists(AuthenticationUtil.getSystemUserName()));
super.setupTestDataImpl();
}

View File

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