You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2004/09/16 16:21:14 UTC
svn commit: rev 46181 - in incubator/lenya/trunk/src/test/org/apache/lenya/ac: file impl
Author: andreas
Date: Thu Sep 16 07:21:14 2004
New Revision: 46181
Modified:
incubator/lenya/trunk/src/test/org/apache/lenya/ac/file/FileGroupTest.java
incubator/lenya/trunk/src/test/org/apache/lenya/ac/file/FileRoleTest.java
incubator/lenya/trunk/src/test/org/apache/lenya/ac/file/FileUserTest.java
incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/AccessControlTest.java
incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/GroupManagerTest.java
incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/LDAPUserTest.java
incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/RoleManagerTest.java
incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/UserManagerTest.java
Log:
get rid of log4j
Modified: incubator/lenya/trunk/src/test/org/apache/lenya/ac/file/FileGroupTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/ac/file/FileGroupTest.java (original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/ac/file/FileGroupTest.java Thu Sep 16 07:21:14 2004
@@ -15,7 +15,7 @@
*
*/
-/* $Id: FileGroupTest.java,v 1.4 2004/03/20 11:46:20 gregor Exp $ */
+/* $Id$ */
package org.apache.lenya.ac.file;
Modified: incubator/lenya/trunk/src/test/org/apache/lenya/ac/file/FileRoleTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/ac/file/FileRoleTest.java (original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/ac/file/FileRoleTest.java Thu Sep 16 07:21:14 2004
@@ -1,22 +1,18 @@
/*
- * Copyright 1999-2004 The Apache Software Foundation
- *
- * Licensed 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.
- *
+ * Copyright 1999-2004 The Apache Software Foundation
+ *
+ * Licensed 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.
+ *
*/
-/* $Id: FileRoleTest.java,v 1.3 2004/03/04 15:37:59 egli Exp $ */
-
package org.apache.lenya.ac.file;
import java.io.File;
@@ -25,6 +21,11 @@
import org.apache.lenya.ac.impl.AccessControlTest;
import org.apache.lenya.cms.PublicationHelper;
+/**
+ * File role test.
+ *
+ * @version $Id:$
+ */
public class FileRoleTest extends AccessControlTest {
/**
* Constructor for FileRoleTest.
@@ -36,7 +37,7 @@
/**
* DOCUMENT ME!
- *
+ *
* @param args DOCUMENT ME!
*/
public static void main(String[] args) {
@@ -46,7 +47,7 @@
/**
* DOCUMENT ME!
- *
+ *
* @throws AccessControlException DOCUMENT ME!
*/
final public void testFileRole() throws AccessControlException {
@@ -56,7 +57,8 @@
role.save();
File path = null;
- path = FileRoleManager.instance(configDir).getConfigurationDirectory();
+ path = FileRoleManager.instance(configDir, getLogEnabledLogger())
+ .getConfigurationDirectory();
File roleFile = new File(path, name + FileRoleManager.SUFFIX);
assertNotNull(roleFile);
@@ -65,7 +67,7 @@
/**
* DOCUMENT ME!
- *
+ *
* @throws AccessControlException DOCUMENT ME!
*/
final public void testSave() throws AccessControlException {
@@ -75,7 +77,8 @@
role.save();
File path = null;
- path = FileRoleManager.instance(configDir).getConfigurationDirectory();
+ path = FileRoleManager.instance(configDir, getLogEnabledLogger())
+ .getConfigurationDirectory();
File roleFile = new File(path, name + FileRoleManager.SUFFIX);
assertNotNull(roleFile);
@@ -102,4 +105,4 @@
FileRole role2 = new FileRole(configDir, name);
assertEquals(role1, role2);
}
-}
+}
\ No newline at end of file
Modified: incubator/lenya/trunk/src/test/org/apache/lenya/ac/file/FileUserTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/ac/file/FileUserTest.java (original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/ac/file/FileUserTest.java Thu Sep 16 07:21:14 2004
@@ -49,7 +49,7 @@
/**
* DOCUMENT ME!
- *
+ *
* @param args DOCUMENT ME!
*/
public static void main(String[] args) {
@@ -57,17 +57,17 @@
junit.textui.TestRunner.run(FileUserTest.class);
}
- /**
- * (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
+ /**
+ * (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
protected void setUp() throws Exception {
super.setUp();
}
/**
* DOCUMENT ME!
- *
+ *
* @return DOCUMENT ME!
*/
final public Map getGroups() {
@@ -76,18 +76,18 @@
/**
* Create and save a user
- *
+ *
* @param userName DOCUMENT ME!
* @param fullName DOCUMENT ME!
* @param email DOCUMENT ME!
* @param password DOCUMENT ME!
- *
+ *
* @return a <code>FileUser</code>
- *
+ *
* @throws AccessControlException if an error occurs
*/
final public FileUser createAndSaveUser(String userName, String fullName, String email,
- String password) throws AccessControlException {
+ String password) throws AccessControlException {
File configDir = getAccreditablesDirectory();
String editorGroupName = "editorGroup";
@@ -106,34 +106,42 @@
editorGroup.save();
adminGroup.save();
user.save();
-
- UserType[] userTypes = { FileAccreditableManager.getDefaultUserType() };
- FileUserManager manager = FileUserManager.instance(configDir, userTypes);
+
+ FileUserManager manager = getUserManager();
manager.add(user);
return user;
}
/**
+ * Returns the file user manager.
+ * @return A file user manager.
+ * @throws AccessControlException if an error occurs.
+ */
+ protected FileUserManager getUserManager() throws AccessControlException {
+ UserType[] userTypes = { FileAccreditableManager.getDefaultUserType() };
+ FileUserManager manager = FileUserManager.instance(getAccreditablesDirectory(), userTypes,
+ getLogEnabledLogger());
+ return manager;
+ }
+
+ /**
* Load a user.
- *
+ *
* @param userName the name of the user
- *
+ *
* @return a <code>FileUser</code>
- *
+ *
* @throws AccessControlException if an error occurs
*/
final public FileUser loadUser(String userName) throws AccessControlException {
- File configDir = getAccreditablesDirectory();
- UserType[] userTypes = { FileAccreditableManager.getDefaultUserType() };
- FileUserManager manager = FileUserManager.instance(configDir, userTypes);
-
+ FileUserManager manager = getUserManager();
return (FileUser) manager.getUser(userName);
}
/**
* Test save
- *
+ *
* @throws AccessControlException if an error occurs
*/
final public void testSave() throws AccessControlException {
@@ -147,7 +155,7 @@
/**
* Test getEmail
- *
+ *
* @throws AccessControlException if an error occurs
*/
final public void testGetEmail() throws AccessControlException {
@@ -161,7 +169,7 @@
/**
* Test getFullName
- *
+ *
* @throws AccessControlException if an error occurs
*/
final public void testGetFullName() throws AccessControlException {
@@ -175,14 +183,14 @@
/**
* Test getGroups
- *
+ *
* @throws AccessControlException if an error occurs
*/
final public void testGetGroups() throws AccessControlException {
FileUser user = createAndSaveUser("alice", "Alice Wonderland", "alice@wonderland.org",
"secret");
-
- for (Iterator i = getGroups().values().iterator(); i.hasNext(); ) {
+
+ for (Iterator i = getGroups().values().iterator(); i.hasNext();) {
Group group = (Group) i.next();
assertTrue(group.contains(user));
}
@@ -190,7 +198,7 @@
/**
* Test getId
- *
+ *
* @throws AccessControlException if an error occurs
*/
final public void testGetId() throws AccessControlException {
@@ -201,15 +209,13 @@
/**
* Test delete
- *
+ *
* @throws AccessControlException if an error occurs
*/
final public void testDelete() throws AccessControlException {
String id = "albert";
FileUser user = createAndSaveUser(id, "Albert Einstein", "albert@physics.org", "secret");
- File configDir = getAccreditablesDirectory();
- UserType[] userTypes = { FileAccreditableManager.getDefaultUserType() };
- FileUserManager manager = FileUserManager.instance(configDir, userTypes);
+ FileUserManager manager = getUserManager();
assertNotNull(manager);
assertNotNull(manager.getUser(id));
@@ -220,7 +226,7 @@
/**
* Test authenticate
- *
+ *
* @throws AccessControlException if an error occurs
*/
final public void testAuthenticate() throws AccessControlException {
@@ -228,13 +234,11 @@
FileUser user = createAndSaveUser("mickey", "Mickey Mouse", "mickey@mouse.com", password);
assertTrue(user.authenticate(password));
- File configDir = getAccreditablesDirectory();
- UserType[] userTypes = { FileAccreditableManager.getDefaultUserType() };
- FileUserManager manager = FileUserManager.instance(configDir, userTypes);
+ FileUserManager manager = getUserManager();
assertNotNull(manager);
User lenya = manager.getUser("lenya");
assertNotNull(lenya);
assertTrue(lenya.authenticate("levi"));
}
-}
+}
\ No newline at end of file
Modified: incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/AccessControlTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/AccessControlTest.java (original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/AccessControlTest.java Thu Sep 16 07:21:14 2004
@@ -15,7 +15,7 @@
*
*/
-/* $Id: AccessControlTest.java,v 1.3 2004/03/04 15:40:19 egli Exp $ */
+/* $Id$ */
package org.apache.lenya.ac.impl;
@@ -34,15 +34,15 @@
import org.apache.lenya.cms.ac.PublicationAccessControllerResolver;
/**
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
+ * To change the template for this generated type comment go to Window>Preferences>Java>Code
+ * Generation>Code and Comments
*/
public class AccessControlTest extends ExcaliburTest {
private ComponentSelector accessControllerResolverSelector;
private AccessControllerResolver accessControllerResolver;
private DefaultAccessController accessController;
-
+
private File accreditablesDirectory;
/**
@@ -72,49 +72,38 @@
super.setUp();
- accessControllerResolverSelector =
- (ComponentSelector) manager.lookup(AccessControllerResolver.ROLE + "Selector");
+ accessControllerResolverSelector = (ComponentSelector) manager
+ .lookup(AccessControllerResolver.ROLE + "Selector");
assertNotNull(accessControllerResolverSelector);
- accessControllerResolver =
- (AccessControllerResolver) accessControllerResolverSelector.select(
- AccessControllerResolver.DEFAULT_RESOLVER);
+ accessControllerResolver = (AccessControllerResolver) accessControllerResolverSelector
+ .select(AccessControllerResolver.DEFAULT_RESOLVER);
assertNotNull(accessControllerResolver);
getLogger().info(
- "Using access controller resolver: [" + accessControllerResolver.getClass() + "]");
+ "Using access controller resolver: [" + accessControllerResolver.getClass() + "]");
- accessController =
- (DefaultAccessController)
- (
- (
- PublicationAccessControllerResolver) accessControllerResolver)
- .resolveAccessController(
- URL);
+ accessController = (DefaultAccessController) ((PublicationAccessControllerResolver) accessControllerResolver)
+ .resolveAccessController(URL);
assertNotNull(accessController);
getLogger().info("Resolved access controller: [" + accessController.getClass() + "]");
File servletContext = PublicationHelper.getPublication().getServletContext();
- ((FilePolicyManager) accessController.getPolicyManager()).setPoliciesDirectory(
- servletContext);
+ ((FilePolicyManager) accessController.getPolicyManager())
+ .setPoliciesDirectory(servletContext);
- accreditablesDirectory =
- new File(
- PublicationHelper.getPublication().getDirectory(),
+ accreditablesDirectory = new File(PublicationHelper.getPublication().getDirectory(),
"config/ac/passwd".replace('/', File.separatorChar));
- (
- (FileAccreditableManager) accessController
- .getAccreditableManager())
- .setConfigurationDirectory(
- accreditablesDirectory);
+ ((FileAccreditableManager) accessController.getAccreditableManager())
+ .setConfigurationDirectory(accreditablesDirectory);
}
/**
* The teardown method for JUnit
- *
- * @exception Exception Description of Exception
+ *
+ * @exception Exception Description of Exception
* @since
*/
public void tearDown() throws Exception {
@@ -144,6 +133,7 @@
assertNotNull(user);
Identity identity = new Identity();
+ identity.enableLogging(getLogEnabledLogger());
identity.addIdentifiable(user);
return identity;
@@ -173,4 +163,4 @@
return accreditablesDirectory;
}
-}
+}
\ No newline at end of file
Modified: incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/GroupManagerTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/GroupManagerTest.java (original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/GroupManagerTest.java Thu Sep 16 07:21:14 2004
@@ -15,8 +15,6 @@
*
*/
-/* $Id: GroupManagerTest.java,v 1.3 2004/03/04 15:40:19 egli Exp $ */
-
package org.apache.lenya.ac.impl;
import java.io.File;
@@ -25,6 +23,11 @@
import org.apache.lenya.ac.file.FileGroupManager;
import org.apache.lenya.cms.PublicationHelper;
+/**
+ * Group manager test.
+ *
+ * @version $Id:$
+ */
public class GroupManagerTest extends AccessControlTest {
/**
@@ -53,11 +56,11 @@
public final void testInstance() throws AccessControlException {
FileGroupManager manager = null;
File configDir = getAccreditablesDirectory();
- manager = FileGroupManager.instance(configDir);
+ manager = FileGroupManager.instance(configDir, getLogEnabledLogger());
assertNotNull(manager);
FileGroupManager anotherManager = null;
- anotherManager = FileGroupManager.instance(configDir);
+ anotherManager = FileGroupManager.instance(configDir, getLogEnabledLogger());
assertNotNull(anotherManager);
assertEquals(manager, anotherManager);
}
Modified: incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/LDAPUserTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/LDAPUserTest.java (original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/LDAPUserTest.java Thu Sep 16 07:21:14 2004
@@ -48,7 +48,7 @@
}
/**
- *
+ *
* @param args an array of <code>String</code>
*/
public static void main(String[] args) {
@@ -72,35 +72,29 @@
/**
* get a publication
- *
+ *
* @return a <code>Publication</code>
*
* @throws PublicationException if an error occurs
*/
final public Publication getPublication() throws PublicationException {
String publicationId = "default";
- String servletContextPath =
- "/home/egli/build/jakarta-tomcat-4.1.21-LE-jdk14/webapps/lenya/";
+ String servletContextPath = "/home/egli/build/jakarta-tomcat-4.1.21-LE-jdk14/webapps/lenya/";
- return PublicationFactory.getPublication(
- publicationId,
- servletContextPath);
+ return PublicationFactory.getPublication(publicationId, servletContextPath);
}
/**
* Create and save an ldap user
- *
+ *
* @param userName name of the user
* @param email of the user
* @param ldapId ldap id of the user
* @throws AccessControlException if the creating or the saving fails
- * @throws ConfigurationException if the creating or the saving fails
+ * @throws ConfigurationException if the creating or the saving fails
*/
- final public void createAndSaveUser(
- String userName,
- String email,
- String ldapId)
- throws AccessControlException, ConfigurationException {
+ final public void createAndSaveUser(String userName, String email, String ldapId)
+ throws AccessControlException, ConfigurationException {
String editorGroupName = "editorGroup";
String adminGroupName = "adminGroup";
String editorRoleName = "editorRole";
@@ -124,11 +118,9 @@
adminRole.save();
/*
- editorGroup.addRole(editorRole);
- user.addGroup(editorGroup);
- adminGroup.addRole(editorRole);
- adminGroup.addRole(adminRole);
- */
+ * editorGroup.addRole(editorRole); user.addGroup(editorGroup);
+ * adminGroup.addRole(editorRole); adminGroup.addRole(adminRole);
+ */
editorGroup.save();
adminGroup.save();
@@ -138,17 +130,17 @@
/**
* Test loading an LDAPUser
- *
+ *
* @param userName the name of the user
* @return an <code>LDAPUser</code>
* @throws AccessControlException of the loading fails
*/
- final public LDAPUser loadUser(String userName)
- throws AccessControlException {
+ final public LDAPUser loadUser(String userName) throws AccessControlException {
UserType[] userTypes = { FileAccreditableManager.getDefaultUserType() };
- FileUserManager manager = FileUserManager.instance(getAccreditablesDirectory(), userTypes);
+ FileUserManager manager = FileUserManager.instance(getAccreditablesDirectory(), userTypes,
+ getLogEnabledLogger());
- return (LDAPUser)manager.getUser(userName);
+ return (LDAPUser) manager.getUser(userName);
}
// final public void testGetFullName() throws AccessControlException {
@@ -179,12 +171,11 @@
/**
* Test the ldap id getter
- *
+ *
* @throws AccessControlException if the test fails
- * @throws ConfigurationException if the creating or the saving fails
+ * @throws ConfigurationException if the creating or the saving fails
*/
- final public void testGetLdapId()
- throws ConfigurationException, AccessControlException {
+ final public void testGetLdapId() throws ConfigurationException, AccessControlException {
String userName = "felix";
String ldapId = "m400032";
createAndSaveUser(userName, "felix@wyona.com", ldapId);
@@ -197,12 +188,11 @@
/**
* Test settinf the ldap id
- *
+ *
* @throws AccessControlException if the test fails
- * @throws ConfigurationException if the creating or the saving fails
+ * @throws ConfigurationException if the creating or the saving fails
*/
- final public void testSetLdapId()
- throws ConfigurationException, AccessControlException {
+ final public void testSetLdapId() throws ConfigurationException, AccessControlException {
String userName = "felix";
String newLdapId = "foo";
createAndSaveUser(userName, "felix@wyona.com", "bar");
@@ -220,12 +210,11 @@
/**
* Test save
- *
+ *
* @throws AccessControlException if the test fails
- * @throws ConfigurationException if the creating or the saving fails
+ * @throws ConfigurationException if the creating or the saving fails
*/
- final public void testSave()
- throws ConfigurationException, AccessControlException {
+ final public void testSave() throws ConfigurationException, AccessControlException {
String userName = "felix";
createAndSaveUser(userName, "felix@wyona.com", "m400032");
@@ -236,9 +225,9 @@
/**
* Test the deletion of a ldap user
- *
+ *
*/
final public void testDelete() {
//TODO Implement delete().
}
-}
+}
\ No newline at end of file
Modified: incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/RoleManagerTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/RoleManagerTest.java (original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/RoleManagerTest.java Thu Sep 16 07:21:14 2004
@@ -1,22 +1,18 @@
/*
- * Copyright 1999-2004 The Apache Software Foundation
- *
- * Licensed 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.
- *
+ * Copyright 1999-2004 The Apache Software Foundation
+ *
+ * Licensed 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.
+ *
*/
-/* $Id: RoleManagerTest.java,v 1.3 2004/03/04 15:40:19 egli Exp $ */
-
package org.apache.lenya.ac.impl;
import java.io.File;
@@ -27,6 +23,11 @@
import org.apache.lenya.ac.file.FileRoleManager;
import org.apache.lenya.cms.PublicationHelper;
+/**
+ * Role manager test.
+ *
+ * @version $Id:$
+ */
public class RoleManagerTest extends AccessControlTest {
/**
* Constructor for RoleManagerTest.
@@ -38,7 +39,7 @@
/**
* DOCUMENT ME!
- *
+ *
* @param args DOCUMENT ME!
*/
public static void main(String[] args) {
@@ -48,15 +49,15 @@
/**
* DOCUMENT ME!
- *
+ *
* @throws AccessControlException DOCUMENT ME!
*/
final public void testInstance() throws AccessControlException {
File configDir = getAccreditablesDirectory();
- FileRoleManager manager = FileRoleManager.instance(configDir);
+ FileRoleManager manager = FileRoleManager.instance(configDir, getLogEnabledLogger());
assertNotNull(manager);
- FileRoleManager anotherManager = FileRoleManager.instance(configDir);
+ FileRoleManager anotherManager = FileRoleManager.instance(configDir, getLogEnabledLogger());
assertNotNull(anotherManager);
assertEquals(manager, anotherManager);
}
@@ -67,16 +68,16 @@
final public void testGetRoles() {
}
- /**
- * Test add(Role)
- *
- * @throws AccessControlException if an error occurs
- */
+ /**
+ * Test add(Role)
+ *
+ * @throws AccessControlException if an error occurs
+ */
final public void testAddRole() throws AccessControlException {
File configDir = getAccreditablesDirectory();
String name = "test";
FileRoleManager manager = null;
- manager = FileRoleManager.instance(configDir);
+ manager = FileRoleManager.instance(configDir, getLogEnabledLogger());
assertNotNull(manager);
Role role = new FileRole(manager.getConfigurationDirectory(), name);
manager.add(role);
@@ -84,10 +85,11 @@
assertTrue(manager.getRoles().length > 0);
}
- /**
+ /**
* Test for void remove(Role)
- *
- */
+ * @throws AccessControlException if an error occurs.
+ *
+ */
final public void testRemoveRole() throws AccessControlException {
File configDir = getAccreditablesDirectory();
String name = "test2";
@@ -95,7 +97,7 @@
FileRoleManager manager = null;
try {
- manager = FileRoleManager.instance(configDir);
+ manager = FileRoleManager.instance(configDir, getLogEnabledLogger());
} catch (AccessControlException e) {
e.printStackTrace();
}
@@ -113,4 +115,4 @@
assertEquals(roleCountBefore, roleCountAfter);
}
-}
+}
\ No newline at end of file
Modified: incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/UserManagerTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/UserManagerTest.java (original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/ac/impl/UserManagerTest.java Thu Sep 16 07:21:14 2004
@@ -48,7 +48,7 @@
/**
* DOCUMENT ME!
- *
+ *
* @param args DOCUMENT ME!
*/
public static void main(String[] args) {
@@ -57,7 +57,7 @@
}
/**
- * (non-Javadoc)
+ * (non-Javadoc)
* @see junit.framework.TestCase#setUp()
*/
protected void setUp() throws Exception {
@@ -66,19 +66,20 @@
/**
* DOCUMENT ME!
- *
+ *
* @throws AccessControlException DOCUMENT ME!
*/
final public void testInstance() throws AccessControlException {
File configDir = getAccreditablesDirectory();
UserType[] userTypes = { FileAccreditableManager.getDefaultUserType() };
- FileUserManager manager = FileUserManager.instance(configDir, userTypes);
+ FileUserManager manager = FileUserManager.instance(configDir, userTypes,
+ getLogEnabledLogger());
assertNotNull(manager);
}
/**
* DOCUMENT ME!
- *
+ *
* @throws AccessControlException DOCUMENT ME!
*/
final public void testLoadConfig() throws AccessControlException {
@@ -93,8 +94,8 @@
FileRole editorRole = new FileRole(configDir, editorRoleId);
FileRole adminRole = new FileRole(configDir, adminRoleId);
- User user =
- new FileUser(configDir, userName, "Alice in Wonderland", "alice@test.com", "secret");
+ User user = new FileUser(configDir, userName, "Alice in Wonderland", "alice@test.com",
+ "secret");
editorRole.save();
adminRole.save();
@@ -115,10 +116,11 @@
FileGroupManager groupManager = null;
UserType[] userTypes = { FileAccreditableManager.getDefaultUserType() };
- FileUserManager userManager = FileUserManager.instance(configDir, userTypes);
+ FileUserManager userManager = FileUserManager.instance(configDir, userTypes,
+ getLogEnabledLogger());
assertNotNull(userManager);
- groupManager = FileGroupManager.instance(configDir);
+ groupManager = FileGroupManager.instance(configDir, getLogEnabledLogger());
assertNotNull(groupManager);
Group fetchedGroup = groupManager.getGroup(editorGroupId);
@@ -130,21 +132,17 @@
/**
* DOCUMENT ME!
- *
+ *
* @throws AccessControlException DOCUMENT ME!
*/
final public void testGetUser() throws AccessControlException {
File configDir = getAccreditablesDirectory();
String userName = "testuser";
- FileUser user =
- new FileUser(
- configDir,
- userName,
- "Alice in Wonderland",
- "alice@wonderland.com",
- "secret");
+ FileUser user = new FileUser(configDir, userName, "Alice in Wonderland",
+ "alice@wonderland.com", "secret");
UserType[] userTypes = { FileAccreditableManager.getDefaultUserType() };
- FileUserManager manager = FileUserManager.instance(configDir, userTypes);
+ FileUserManager manager = FileUserManager.instance(configDir, userTypes,
+ getLogEnabledLogger());
assertNotNull(manager);
manager.add(user);
@@ -154,4 +152,4 @@
assertEquals(user.getEmail(), otherUser.getEmail());
assertEquals(user.getEncryptedPassword(), ((AbstractUser) otherUser).getEncryptedPassword());
}
-}
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org