Package org.apache.lenya.ac

Examples of org.apache.lenya.ac.Group


    /**
     * Tests the removeAllMembers() method.
     */
    public void testRemoveAllMembers() {
        Group group = getGroup();
        Groupable members[] = group.getMembers();
        group.removeAllMembers();
        for (int i = 0; i < members.length; i++) {
            assertFalse(group.contains(members[i]));
        }
    }
View Full Code Here


                    configurationDirectory + "]", e);
            }

            for (int i = 0; i < groups.length; i++) {
                String groupId = groups[i].getValue();
                Group group = manager.getGroup(groupId);

                if (group == null) {
                    throw new ConfigurationException("Couldn't find Group for group name [" + groupId + "]");
                }
               
                if (!group.contains(this)) {
                    group.add(this);
                }

            }
        } else {
            // strange, it should have groups
View Full Code Here

                    configurationDirectory + "]", e);
            }

            for (int i = 0; i < groups.length; i++) {
                String groupId = groups[i].getValue();
                Group group = manager.getGroup(groupId);

                if (group == null) {
                    throw new ConfigurationException("Couldn't find Group for group name [" + groupId + "]");
                }
               
                if (!group.contains(this)) {
                    group.add(this);
                }

            }
        } else {
            // strange, it should have groups
View Full Code Here

                    configurationDirectory + "]", e);
            }

            for (int i = 0; i < groups.length; i++) {
                String groupId = groups[i].getValue();
                Group group = manager.getGroup(groupId);

                if (group == null) {
                    throw new ConfigurationException("Couldn't find Group for group name [" + groupId + "]");
                }
               
                if (!group.contains(this)) {
                    group.add(this);
                }

            }
        } else {
            // strange, it should have groups
View Full Code Here

    final public void testGetGroups() throws AccessControlException {
        FileUser user = createAndSaveUser("alice", "Alice Wonderland", "alice@wonderland.org",
                "secret");
               
        for (Iterator i = getGroups().values().iterator(); i.hasNext(); ) {
            Group group = (Group) i.next();
            assertTrue(group.contains(user));
        }
    }
View Full Code Here

    /**
     * Tests the removeAllMembers() method.
     */
    public void testRemoveAllMembers() {
        Group group = getGroup();
        Groupable members[] = group.getMembers();
        group.removeAllMembers();
        for (int i = 0; i < members.length; i++) {
            assertFalse(group.contains(members[i]));
        }
    }
View Full Code Here

            new FileUser(configDir, userName, "Alice in Wonderland", "alice@test.com", "secret");

        editorRole.save();
        adminRole.save();

        Group editorGroup = new FileGroup(configDir, editorGroupId);

        //    editorGroup.addRole(editorRole);
        editorGroup.add(user);

        FileGroup adminGroup = new FileGroup(configDir, adminGroupId);

        //    adminGroup.addRole(editorRole);
        //    adminGroup.addRole(adminRole);
        editorGroup.save();
        adminGroup.save();
        adminGroup.add(user);
        user.save();

        FileGroupManager groupManager = null;
        UserType[] userTypes = { FileAccreditableManager.getDefaultUserType() };
        FileUserManager userManager = FileUserManager.instance(configDir, userTypes);
        assertNotNull(userManager);

        groupManager = FileGroupManager.instance(configDir);
        assertNotNull(groupManager);

        Group fetchedGroup = groupManager.getGroup(editorGroupId);
        assertTrue(editorGroup.equals(fetchedGroup));

        fetchedGroup = groupManager.getGroup(adminGroupId);
        assertTrue(adminGroup.equals(fetchedGroup));
    }
View Full Code Here

TOP

Related Classes of org.apache.lenya.ac.Group

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.