Package org.apache.jetspeed.security.impl

Examples of org.apache.jetspeed.security.impl.GroupPrincipalImpl


    /**
     * @throws Exception
     */
    public void testRemoveExistantUserPrincipal() throws Exception
    {
        GroupPrincipal gp = new GroupPrincipalImpl(gpUid1);
        grHandler.removeGroupPrincipal(gp);
        assertNull("Group was found and should have been removed.", grHandler.getGroupPrincipal(gp.getFullPath()));
    }
View Full Code Here


     * @throws Exception
     */
    public void testRemoveNonExistantUserPrincipal() throws Exception
    {
        String localUid = Integer.toString(rand.nextInt()).toString();
        GroupPrincipal localPrin = new GroupPrincipalImpl(localUid);

        grHandler.removeGroupPrincipal(localPrin);
    }
View Full Code Here

        {
            LdapDataHelper.seedGroupData(gpUid2);
            assertTrue("getUserPrincipals should have returned more than one user.", grHandler.getGroupPrincipals("*")
                    .size() > 1);

            String fullPath = (new GroupPrincipalImpl(gpUid1)).getFullPath();
            List groups = grHandler.getGroupPrincipals(fullPath);
            assertTrue("getGroupPrincipals should have returned one group.", groups.size() == 1);
            assertTrue("List should have consisted of GroupPrincipal objects.", groups.get(0) instanceof GroupPrincipal);

            String localUid = Integer.toString(rand.nextInt()).toString();
            assertTrue("getGroupPrincipals should not have found any groups with the specified filter.", grHandler
                    .getGroupPrincipals(new GroupPrincipalImpl(localUid).getFullPath()).isEmpty());
        }
        finally
        {
            LdapDataHelper.removeGroupData(gpUid2);
        }
View Full Code Here

     * @see org.apache.jetspeed.security.spi.ldap.AbstractLdapTest#setUp()
     */
    protected void setUp() throws Exception
    {
        super.setUp();
        gp1 = new GroupPrincipalImpl(gpUid1);
        gp2 = new GroupPrincipalImpl(gpUid2);
        LdapDataHelper.seedGroupData(gpUid1);
        LdapDataHelper.seedGroupData(gpUid2);
        LdapDataHelper.seedUserData(uid1, password);
        LdapDataHelper.seedUserData(uid2, password);
    }
View Full Code Here

    public void testGetUserPrincipalsInGroup() throws Exception
    {
        secHandler.setUserPrincipalInGroup(uid1, gp1.getFullPath());
        secHandler.setUserPrincipalInGroup(uid2, gp1.getFullPath());

        String fullPathName = new GroupPrincipalImpl(gpUid1).getFullPath();
        logger.debug("Group full path name from testGetUserPrincipalsInGroup()[" + fullPathName + "]");
        assertEquals("The user should have been in two groups.", 2, secHandler.getUserPrincipalsInGroup(fullPathName)
                .size());
    }
View Full Code Here

       
        // Group or User
        if (fullPath.indexOf("/group/") > -1 )
        {
            name = fullPath.substring(GROUP_PATH.length());
            principal = new GroupPrincipalImpl(name);
        }
        else
        {
            name = fullPath.substring(USER_PATH.length());
            principal = new UserPrincipalImpl(name);
View Full Code Here

       
        // Group or User
        if (fullPath.indexOf("/group/") > -1 )
        {
            name = fullPath.substring(GROUP_PATH.length());
            principal = new GroupPrincipalImpl(name);
        }
        else
        {
            name = fullPath.substring(USER_PATH.length());
            principal = new UserPrincipalImpl(name);
View Full Code Here

        {
            String dn = ldap.lookupByUid(groupUidWithoutSlashes);

            if (!StringUtils.isEmpty(dn))
            {
                return new GroupPrincipalImpl(groupPrincipalUid);
            }
        }
        catch (SecurityException e)
        {
            logSecurityException(e, groupPrincipalUid);
View Full Code Here

     * @param principalUid The principal uid.
     * @return A group principal object.
     */
    protected Principal makePrincipal(String principalUid)
    {
        return new GroupPrincipalImpl(principalUid);
    }
View Full Code Here

        crHandler.setPassword(uid, "", password);
    }
   
    public static void seedGroupData(String gpUid) throws Exception
    {
        GroupPrincipal gp = new GroupPrincipalImpl(gpUid);
        grHandler.setGroupPrincipal(gp);
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.security.impl.GroupPrincipalImpl

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.