public void testUpdateUser() throws NotExecutableException, RepositoryException {
// create the same use in 2 different workspace must make the 'corresponding'
// and updating must succeed
String altWsp = getAlternativeWorkspaceName();
if (altWsp == null) {
throw new NotExecutableException();
}
UserManager uMgr = ((JackrabbitSession) superuser).getUserManager();
Session s = getHelper().getSuperuserSession(altWsp);
User u = null;
try {
// other users created in the default workspace...
u = uMgr.createUser("testUser", "testUser");
superuser.save();
String userPath = null;
if (u.getPrincipal() instanceof ItemBasedPrincipal) {
userPath = ((ItemBasedPrincipal) u.getPrincipal()).getPath();
assertTrue(superuser.nodeExists(userPath));
} else {
throw new NotExecutableException();
}
// ... must not be present in the alternate-workspace
UserManager umgr = ((JackrabbitSession) s).getUserManager();
assertNull(umgr.getAuthorizable("testUser"));