From f4e387be7b505d7f772e2ffc32b70bc7879760a7 Mon Sep 17 00:00:00 2001 From: Angela Schreiber Date: Tue, 7 Aug 2012 15:54:40 +0000 Subject: [PATCH] Improvements for UserManagement implementation: - move configuration code to UserManagerConfig - rename public method getGroupMembershipSplitSize to getMemberSplitSize - add method hasMemberSplitSize and replace usage of getGroupMembershipSplitSize() > 0 - remove old class name from javadoc in NodeCreationTest git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/trunk@1370326 13f79535-47bb-0310-9956-ffa450edef68 --- .../core/DefaultSecurityManager.java | 13 +- .../core/UserPerWorkspaceSecurityManager.java | 6 +- .../core/security/user/GroupImpl.java | 6 +- .../user/UserAccessControlProvider.java | 2 +- .../core/security/user/UserImporter.java | 2 +- .../core/security/user/UserManagerConfig.java | 102 +++++++++++ .../core/security/user/UserManagerImpl.java | 168 ++++++------------ .../user/UserPerWorkspaceUserManager.java | 1 + .../core/security/user/NodeCreationTest.java | 2 +- .../core/security/user/UserImporterTest.java | 4 +- 10 files changed, 173 insertions(+), 133 deletions(-) create mode 100644 jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerConfig.java diff --git a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java index f5fcaa47ac2..fc0b4ecc99c 100644 --- a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java +++ b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java @@ -462,12 +462,6 @@ protected MembershipCache getMembershipCache(SessionImpl session) throws Reposit */ protected UserManagerImpl createUserManager(SessionImpl session) throws RepositoryException { UserManagerConfig umc = getConfig().getUserManagerConfig(); - Properties params = (umc == null) ? null : umc.getParameters(); - - // since users are stored in and retrieved from a dedicated workspace - // only the system session assigned with that workspace will get the - // system user manager (special implementation that asserts the existence - // of the admin user). UserManagerImpl um; if (umc != null) { Class[] paramTypes = new Class[] { @@ -476,12 +470,9 @@ protected UserManagerImpl createUserManager(SessionImpl session) throws Reposito Properties.class, MembershipCache.class}; um = (UserManagerImpl) umc.getUserManager(UserManagerImpl.class, - paramTypes, session, adminId, params, getMembershipCache(session)); - // TODO: should we make sure the implementation doesn't allow - // TODO: to change the autosave behavior? since the user manager - // TODO: writes to a separate workspace this would cause troubles. + paramTypes, session, adminId, umc.getParameters(), getMembershipCache(session)); } else { - um = new UserManagerImpl(session, adminId, params, getMembershipCache(session)); + um = new UserManagerImpl(session, adminId, null, getMembershipCache(session)); } if (umc != null && !(session instanceof SystemSession)) { diff --git a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/UserPerWorkspaceSecurityManager.java b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/UserPerWorkspaceSecurityManager.java index 1212e32df39..9cdf1dc3d43 100644 --- a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/UserPerWorkspaceSecurityManager.java +++ b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/UserPerWorkspaceSecurityManager.java @@ -219,8 +219,6 @@ protected UserManager getSystemUserManager(String workspaceName) throws Reposito @Override protected UserManagerImpl createUserManager(SessionImpl session) throws RepositoryException { UserManagerConfig umc = getConfig().getUserManagerConfig(); - Properties params = (umc == null) ? null : umc.getParameters(); - UserManagerImpl umgr; // in contrast to the DefaultSecurityManager users are not retrieved // from a dedicated workspace: the system session of each workspace must @@ -232,9 +230,9 @@ protected UserManagerImpl createUserManager(SessionImpl session) throws Reposito Properties.class, MembershipCache.class}; umgr = (UserPerWorkspaceUserManager) umc.getUserManager(UserPerWorkspaceUserManager.class, - paramTypes, session, adminId, params, getMembershipCache(session)); + paramTypes, session, adminId, umc.getParameters(), getMembershipCache(session)); } else { - umgr = new UserPerWorkspaceUserManager(session, adminId, params, getMembershipCache(session)); + umgr = new UserPerWorkspaceUserManager(session, adminId, null, getMembershipCache(session)); } if (umc != null && !(session instanceof SystemSession)) { diff --git a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/GroupImpl.java b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/GroupImpl.java index 85d81868ebc..4e835234265 100644 --- a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/GroupImpl.java +++ b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/GroupImpl.java @@ -202,7 +202,7 @@ public boolean removeMember(Authorizable authorizable) throws RepositoryExceptio */ private MembershipProvider getMembershipProvider(NodeImpl node) throws RepositoryException { MembershipProvider msp; - if (userManager.getGroupMembershipSplitSize() > 0) { + if (userManager.hasMemberSplitSize()) { if (node.hasNode(N_MEMBERS) || !node.hasProperty(P_MEMBERS)) { msp = new NodeBasedMembershipProvider(node); } else { @@ -214,7 +214,7 @@ private MembershipProvider getMembershipProvider(NodeImpl node) throws Repositor if (node.hasProperty(P_MEMBERS) && node.hasNode(N_MEMBERS)) { log.warn("Found members node and members property on node {}. Ignoring {} members", node, - userManager.getGroupMembershipSplitSize() > 0 ? "property" : "node"); + userManager.hasMemberSplitSize() ? "property" : "node"); } return msp; @@ -267,7 +267,7 @@ private String safeGetID() { static PropertySequence getPropertySequence(Node nMembers, UserManagerImpl userManager) throws RepositoryException { Comparator order = Rank.comparableComparator(); - int maxChildren = userManager.getGroupMembershipSplitSize(); + int maxChildren = userManager.getMemberSplitSize(); int minChildren = maxChildren / 2; TreeManager treeManager = new BTreeManager(nMembers, minChildren, maxChildren, order, diff --git a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserAccessControlProvider.java b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserAccessControlProvider.java index 96cc5fcc5d5..73223d9b3cd 100644 --- a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserAccessControlProvider.java +++ b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserAccessControlProvider.java @@ -182,7 +182,7 @@ public void init(Session systemSession, Map configuration) throws RepositoryExce usersPath = (uMgr instanceof UserManagerImpl) ? ((UserManagerImpl) uMgr).getUsersPath() : UserConstants.USERS_PATH; groupsPath = (uMgr instanceof UserManagerImpl) ? ((UserManagerImpl) uMgr).getGroupsPath() : UserConstants.GROUPS_PATH; - membersInProperty = (!(uMgr instanceof UserManagerImpl)) || ((UserManagerImpl) uMgr).getGroupMembershipSplitSize() <= 0; + membersInProperty = !(uMgr instanceof UserManagerImpl) || !((UserManagerImpl) uMgr).hasMemberSplitSize(); if (configuration.containsKey(PARAM_ANONYMOUS_ID)) { anonymousId = (String) configuration.get(PARAM_ANONYMOUS_ID); diff --git a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImporter.java b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImporter.java index a1caaa63782..016c389e8a6 100644 --- a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImporter.java +++ b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImporter.java @@ -440,7 +440,7 @@ public void processReferences() throws RepositoryException { log.info("ImportBehavior.BESTEFFORT: Found " + nonExisting.size() + " entries of rep:members pointing to non-existing authorizables. Adding to rep:members."); final NodeImpl groupNode = ((AuthorizableImpl) gr).getNode(); - if (userManager.getGroupMembershipSplitSize() > 0) { + if (userManager.hasMemberSplitSize()) { userManager.performProtectedOperation((SessionImpl) session, new SessionWriteOperation() { public Boolean perform(SessionContext context) throws RepositoryException { NodeImpl nMembers = (groupNode.hasNode(UserConstants.N_MEMBERS) diff --git a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerConfig.java b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerConfig.java new file mode 100644 index 00000000000..1cf0c723577 --- /dev/null +++ b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerConfig.java @@ -0,0 +1,102 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jackrabbit.core.security.user; + +import org.apache.jackrabbit.core.security.user.action.AuthorizableAction; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Properties; + +/** + * Utility to retrieve configuration parameters for UserManagerImpl + */ +class UserManagerConfig { + + private static final Logger log = LoggerFactory.getLogger(UserManagerImpl.class); + + private final Properties config; + private final String adminId; + /** + * Authorizable actions that will all be executed upon creation and removal + * of authorizables in the order they are contained in the array.

+ * Note, that if {@link #isAutoSave() autosave} is turned on, the configured + * actions are executed before persisting the creation or removal. + */ + private AuthorizableAction[] actions; + + UserManagerConfig(Properties config, String adminId, AuthorizableAction[] actions) { + this.config = config; + this.adminId = adminId; + this.actions = (actions == null) ? new AuthorizableAction[0] : actions; + } + + public T getConfigValue(String key, T defaultValue) { + if (config != null && config.containsKey(key)) { + return convert(config.get(key), defaultValue); + } else { + return defaultValue; + } + } + + public String getAdminId() { + return adminId; + } + + public AuthorizableAction[] getAuthorizableActions() { + return actions; + } + + public void setAuthorizableActions(AuthorizableAction[] actions) { + if (actions != null) { + this.actions = actions; + } + } + + //--------------------------------------------------------< private >--- + private T convert(Object v, T defaultValue) { + if (v == null) { + return null; + } + + T value; + String str = v.toString(); + Class targetClass = (defaultValue == null) ? String.class : defaultValue.getClass(); + try { + if (targetClass == String.class) { + value = (T) str; + } else if (targetClass == Integer.class) { + value = (T) Integer.valueOf(str); + } else if (targetClass == Long.class) { + value = (T) Long.valueOf(str); + } else if (targetClass == Double.class) { + value = (T) Double.valueOf(str); + } else if (targetClass == Boolean.class) { + value = (T) Boolean.valueOf(str); + } else { + // unsupported target type + log.warn("Unsupported target type {} for value {}", targetClass.getName(), v); + throw new IllegalArgumentException("Cannot convert config entry " + v + " to " + targetClass.getName()); + } + } catch (NumberFormatException e) { + log.warn("Invalid value {}; cannot be parsed into {}", v, targetClass.getName()); + value = defaultValue; + } + + return value; + } +} diff --git a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java index ad052b18013..61b4b3d900a 100644 --- a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java +++ b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java @@ -231,11 +231,13 @@ public class UserManagerImpl extends ProtectedItemModifier public static final String PARAM_AUTO_EXPAND_SIZE = "autoExpandSize"; /** - * If this parameter is present group memberships are collected in a node + * If this parameter is present group members are collected in a node * structure below {@link UserConstants#N_MEMBERS} instead of the default * multi valued property {@link UserConstants#P_MEMBERS}. Its value determines * the maximum number of member properties until additional intermediate nodes - * are inserted. Valid values are integers > 4. + * are inserted. Valid values are integers > 4. The default value is 0 and + * indicates that the {@link UserConstants#P_MEMBERS} property is used to + * record group members. */ public static final String PARAM_GROUP_MEMBERSHIP_SPLIT_SIZE = "groupMembershipSplitSize"; @@ -245,50 +247,12 @@ public class UserManagerImpl extends ProtectedItemModifier private final String adminId; private final NodeResolver authResolver; private final NodeCreator nodeCreator; + private final UserManagerConfig config; - /** - * Configuration value defining the node where User nodes will be created. - * Default value is {@link UserConstants#USERS_PATH}. - */ private final String usersPath; - - /** - * Configuration value defining the node where Group nodes will be created. - * Default value is {@link UserConstants#GROUPS_PATH}. - */ private final String groupsPath; - - /** - * Flag indicating if {@link #getAuthorizable(String)} should be able to deal - * with users or groups created with Jackrabbit < 2.0.
- * As of 2.0 authorizables are created using a defined logic that allows - * to retrieve them without searching/traversing. If this flag is - * true this method will try to find authorizables using the - * authResolver if not found otherwise. - */ - private final boolean compatibleJR16; - - /** - * Maximum number of properties on the group membership node structure under - * {@link UserConstants#N_MEMBERS} until additional intermediate nodes are inserted. - * If 0 (default), {@link UserConstants#P_MEMBERS} is used to record group - * memberships. - */ - private final int groupMembershipSplitSize; - - /** - * The membership cache. - */ private final MembershipCache membershipCache; - /** - * Authorizable actions that will all be executed upon creation and removal - * of authorizables in the order they are contained in the array.

- * Note, that if {@link #isAutoSave() autosave} is turned on, the configured - * actions are executed before persisting the creation or removal. - */ - private AuthorizableAction[] authorizableActions = new AuthorizableAction[0]; - /** * Create a new UserManager with the default configuration. * @@ -336,27 +300,31 @@ public UserManagerImpl(SessionImpl session, String adminId, Properties config) t */ public UserManagerImpl(SessionImpl session, String adminId, Properties config, MembershipCache mCache) throws RepositoryException { + this(session, new UserManagerConfig(config, adminId, null), mCache); + } + + /** + * Create a new UserManager for the given session. + * + * @param session The editing/reading session. + * @param config The user manager configuration. + * @param mCache The shared membership cache. + * @throws RepositoryException If an error occurs. + */ + private UserManagerImpl(SessionImpl session, UserManagerConfig config, MembershipCache mCache) throws RepositoryException { this.session = session; - this.adminId = adminId; + this.adminId = config.getAdminId(); + this.config = config; nodeCreator = new NodeCreator(config); - Object param = (config != null) ? config.get(PARAM_USERS_PATH) : null; - usersPath = (param != null) ? param.toString() : USERS_PATH; - - param = (config != null) ? config.get(PARAM_GROUPS_PATH) : null; - groupsPath = (param != null) ? param.toString() : GROUPS_PATH; - - param = (config != null) ? config.get(PARAM_COMPATIBLE_JR16) : null; - compatibleJR16 = (param != null) && Boolean.parseBoolean(param.toString()); - - param = (config != null) ? config.get(PARAM_GROUP_MEMBERSHIP_SPLIT_SIZE) : null; - groupMembershipSplitSize = parseMembershipSplitSize(param); + this.usersPath = config.getConfigValue(PARAM_USERS_PATH, USERS_PATH); + this.groupsPath = config.getConfigValue(PARAM_GROUPS_PATH, GROUPS_PATH); if (mCache != null) { membershipCache = mCache; } else { - membershipCache = new MembershipCache(session, groupsPath, groupMembershipSplitSize > 0); + membershipCache = new MembershipCache(session, groupsPath, hasMemberSplitSize()); } NodeResolver nr; @@ -407,8 +375,25 @@ public MembershipCache getMembershipCache() { * * @return The maximum number of group members before splitting up the structure. */ - public int getGroupMembershipSplitSize() { - return groupMembershipSplitSize; + public int getMemberSplitSize() { + int splitSize = config.getConfigValue(PARAM_GROUP_MEMBERSHIP_SPLIT_SIZE, 0); + if (splitSize < 4) { + log.warn("Invalid value {} for {}. Expected integer >= 4", splitSize, PARAM_GROUP_MEMBERSHIP_SPLIT_SIZE); + splitSize = 0; + } + return splitSize; + } + + /** + * Returns true if the split-member configuration parameter + * is greater or equal than 4 indicating that group members should be stored + * in a tree instead of a single multivalued property. + * + * @return true if group members are being stored in a tree instead of a + * single multivalued property. + */ + public boolean hasMemberSplitSize() { + return getMemberSplitSize() >= 4; } /** @@ -418,9 +403,7 @@ public int getGroupMembershipSplitSize() { * @param authorizableActions An array of authorizable actions. */ public void setAuthorizableActions(AuthorizableAction[] authorizableActions) { - if (authorizableActions != null) { - this.authorizableActions = authorizableActions; - } + config.setAuthorizableActions(authorizableActions); } //--------------------------------------------------------< UserManager >--- @@ -596,8 +579,7 @@ public User createUser(String userID, String password, /** * @see UserManager#createGroup(String) */ - public Group createGroup(String groupID) - throws AuthorizableExistsException, RepositoryException { + public Group createGroup(String groupID) throws AuthorizableExistsException, RepositoryException { return createGroup(groupID, new PrincipalImpl(groupID), null); } @@ -850,6 +832,7 @@ private Authorizable internalGetAuthorizable(String id) throws RepositoryExcepti try { n = session.getNodeById(nodeId); } catch (ItemNotFoundException e) { + boolean compatibleJR16 = config.getConfigValue(PARAM_COMPATIBLE_JR16, false); if (compatibleJR16) { // backwards-compatibility with JR < 2.0 user/group structure that doesn't // allow to determine existence of an authorizable from the id directly. @@ -1037,27 +1020,6 @@ private static void checkValidPrincipal(Principal principal, boolean isGroup) { } } - private static int parseMembershipSplitSize(Object param) { - int n = 0; - if (param != null) { - try { - n = Integer.parseInt(param.toString()); - if (n < 4) { - n = 0; - } - } - catch (NumberFormatException e) { - n = 0; - } - if (n == 0) { - log.warn("Invalid value {} for {}. Expected integer >= 4", - param.toString(), PARAM_GROUP_MEMBERSHIP_SPLIT_SIZE); - } - } - - return n; - } - //-------------------------------------------------------------------------- /** * Let the configured AuthorizableActions perform additional @@ -1069,7 +1031,7 @@ private static int parseMembershipSplitSize(Object param) { * @throws RepositoryException If an exception occurs. */ void onCreate(User user, String pw) throws RepositoryException { - for (AuthorizableAction action : authorizableActions) { + for (AuthorizableAction action : config.getAuthorizableActions()) { action.onCreate(user, pw, session); } } @@ -1083,7 +1045,7 @@ void onCreate(User user, String pw) throws RepositoryException { * @throws RepositoryException If an exception occurs. */ void onCreate(Group group) throws RepositoryException { - for (AuthorizableAction action : authorizableActions) { + for (AuthorizableAction action : config.getAuthorizableActions()) { action.onCreate(group, session); } } @@ -1097,7 +1059,7 @@ void onCreate(Group group) throws RepositoryException { * @throws RepositoryException If an exception occurs. */ void onRemove(Authorizable authorizable) throws RepositoryException { - for (AuthorizableAction action : authorizableActions) { + for (AuthorizableAction action : config.getAuthorizableActions()) { action.onRemove(authorizable, session); } } @@ -1112,7 +1074,7 @@ void onRemove(Authorizable authorizable) throws RepositoryException { * @throws RepositoryException If an exception occurs. */ void onPasswordChange(User user, String password) throws RepositoryException { - for (AuthorizableAction action : authorizableActions) { + for (AuthorizableAction action : config.getAuthorizableActions()) { action.onPasswordChange(user, password, session); } } @@ -1350,36 +1312,22 @@ private class NodeCreator { // all child nodes. private final long autoExpandSize; - private NodeCreator(Properties config) { + private NodeCreator(UserManagerConfig config) { int d = DEFAULT_DEPTH; boolean expand = false; long size = DEFAULT_SIZE; if (config != null) { - if (config.containsKey(PARAM_DEFAULT_DEPTH)) { - try { - d = Integer.parseInt(config.get(PARAM_DEFAULT_DEPTH).toString()); - if (d <= 0) { - log.warn("Invalid defaultDepth '" + d + "' -> using default."); - d = DEFAULT_DEPTH; - } - } catch (NumberFormatException e) { - log.warn("Unable to parse defaultDepth config parameter -> using default.", e); - } + d = config.getConfigValue(PARAM_DEFAULT_DEPTH, DEFAULT_DEPTH); + if (d <= 0) { + log.warn("Invalid defaultDepth '" + d + "' -> using default."); + d = DEFAULT_DEPTH; } - if (config.containsKey(PARAM_AUTO_EXPAND_TREE)) { - expand = Boolean.parseBoolean(config.get(PARAM_AUTO_EXPAND_TREE).toString()); - } - if (config.containsKey(PARAM_AUTO_EXPAND_SIZE)) { - try { - size = Integer.parseInt(config.get(PARAM_AUTO_EXPAND_SIZE).toString()); - if (expand && size <= 0) { - log.warn("Invalid autoExpandSize '" + size + "' -> using default."); - size = DEFAULT_SIZE; - } - } catch (NumberFormatException e) { - log.warn("Unable to parse autoExpandSize config parameter -> using default.", e); - } + expand = config.getConfigValue(PARAM_AUTO_EXPAND_TREE, false); + size = config.getConfigValue(PARAM_AUTO_EXPAND_SIZE, DEFAULT_SIZE); + if (expand && size <= 0) { + log.warn("Invalid autoExpandSize '" + size + "' -> using default."); + size = DEFAULT_SIZE; } } diff --git a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserPerWorkspaceUserManager.java b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserPerWorkspaceUserManager.java index 2f64d06ca64..b7d0971f52a 100644 --- a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserPerWorkspaceUserManager.java +++ b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserPerWorkspaceUserManager.java @@ -117,6 +117,7 @@ public void autoSave(boolean enable) throws UnsupportedRepositoryOperationExcept * @return The path of the node. * @throws RepositoryException If an error occurs while retrieving the path. */ + @Override String getPath(Node authorizableNode) throws RepositoryException { return authorizableNode.getPath(); } diff --git a/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/NodeCreationTest.java b/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/NodeCreationTest.java index f64a66b2a2f..8773eb67e05 100644 --- a/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/NodeCreationTest.java +++ b/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/NodeCreationTest.java @@ -38,7 +38,7 @@ import java.util.Properties; /** - * IdResolverTest... + * NodeCreationTest... */ public class NodeCreationTest extends AbstractUserTest { diff --git a/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserImporterTest.java b/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserImporterTest.java index a5c975275fa..0d5208aed05 100644 --- a/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserImporterTest.java +++ b/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserImporterTest.java @@ -860,7 +860,7 @@ public void testImportNonExistingMemberAbort() throws IOException, RepositoryExc } public void testImportNonExistingMemberBestEffort() throws IOException, RepositoryException, SAXException, NotExecutableException { - if (umgr.getGroupMembershipSplitSize() > 0) { + if (umgr.hasMemberSplitSize()) { throw new NotExecutableException(); } @@ -914,7 +914,7 @@ public void testImportNonExistingMemberBestEffort2() throws IOException, Reposit String g1Id = "0120a4f9-196a-3f9e-b9f5-23f31f914da7"; String nonExistingId = "b2f5ff47-4366-31b6-a533-d8dc3614845d"; // groupId of 'g' group. - if (umgr.getAuthorizable("g") != null || umgr.getGroupMembershipSplitSize() > 0) { + if (umgr.getAuthorizable("g") != null || umgr.hasMemberSplitSize()) { throw new NotExecutableException(); }