Merged 5.0.2-CLOUD42 (Cloud ) to 5.1.N (5.1.1)

117248 adavis: Merged 5.0.2-CLOUD (Cloud ) to 5.0.2-CLOUD42 (Cloud )
      114517 adavis: Merged BCRYPT to 5.0.2-CLOUD
         114012 gcornwell: MNT-14892: Updates to upgrade password hash job and test.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@117340 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-11-11 17:52:16 +00:00
parent 1c1a381c2c
commit d048e04218
6 changed files with 97 additions and 98 deletions

View File

@@ -108,6 +108,8 @@ public class UpgradePasswordHashTest extends TestCase
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName());
createTestUsers("md4");
userTransaction.commit();
}
protected void createTestUsers(String encoding) throws Exception
@@ -183,6 +185,9 @@ public class UpgradePasswordHashTest extends TestCase
public void testWorkerWithDefaultConfiguration() throws Exception
{
userTransaction = serviceRegistry.getTransactionService().getUserTransaction();
userTransaction.begin();
for (NodeRef testUser : testUsers)
{
assertNull("The hash indicator should not be set",nodeService.getProperty(testUser, ContentModel.PROP_HASH_INDICATOR));
@@ -191,6 +196,10 @@ public class UpgradePasswordHashTest extends TestCase
// execute the worker to upgrade all users
this.upgradePasswordHashWorker.execute();
userTransaction.commit();
userTransaction = serviceRegistry.getTransactionService().getUserTransaction();
userTransaction.begin();
// ensure all the test users have been upgraded to use the preferred encoding
List<String> doubleHashed = Arrays.asList("md4", "bcrypt10");
for (NodeRef testUser : testUsers)
@@ -200,7 +209,6 @@ public class UpgradePasswordHashTest extends TestCase
assertNull("The md4 password should not be set", nodeService.getProperty(testUser, ContentModel.PROP_PASSWORD));
assertNull("The sh256 password should not be set",nodeService.getProperty(testUser, ContentModel.PROP_PASSWORD_SHA256));
}
}
public void xxxtestWorkerWithLegacyConfiguration() throws Exception