}
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"));
assertFalse(s.nodeExists(userPath));
User u2 = umgr.createUser("testUser", "testUser");
s.save();
assertTrue(s.nodeExists(userPath));
Value value = superuser.getValueFactory().createValue("anyValue");
u.setProperty(propertyName1, value);
superuser.save();
// no automatic sync.
assertFalse(u2.hasProperty(propertyName1));
// update nodes
Node n2 = s.getNode(userPath);
n2.update(superuser.getWorkspace().getName());
// now the value must be visible
assertTrue(u2.hasProperty(propertyName1));
assertEquals(value.getString(), u2.getProperty(propertyName1)[0].getString());
} finally {
// remove the test user in the destination workspace
Authorizable dest = ((JackrabbitSession) s).getUserManager().getAuthorizable("testUser");
if (dest != null) {