Examples of TestPrincipal


Examples of org.apache.jackrabbit.core.security.TestPrincipal

        Principal p = getTestPrincipal();
        String uid = p.getName();

        Map<String, Principal> fail = new HashMap<String, Principal>();
        fail.put(uid, null);
        fail.put(uid, new TestPrincipal(""));
        fail.put(null, p);
        fail.put("", p);     

        for (String id : fail.keySet()) {
            Group g = null;
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

        User u = null;
        Group gr = null;
        try {
            u = userMgr.createUser(uid, buildPassword(uid), p, null);
            save(superuser);
            gr = userMgr.createGroup(new TestPrincipal(uid));
            save(superuser);

            String msg = "Creating a Group with a principal-name that exists as UserID -> must create new GroupID but keep PrincipalName.";
            assertFalse(msg, gr.getID().equals(gr.getPrincipal().getName()));
            assertFalse(msg, gr.getID().equals(uid));
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

        public void testMultipleGroupPermissionsOnNode() throws NotExecutableException, RepositoryException {
        Group testGroup = getTestGroup();

        /* create a second group the test user is member of */
        Principal principal = new TestPrincipal("testGroup" + UUID.randomUUID());
        UserManager umgr = getUserManager(superuser);
        Group group2 = umgr.createGroup(principal);
        try {
            group2.addMember(testUser);
            if (!umgr.isAutoSave() && superuser.hasPendingChanges()) {
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

    public void testMultipleGroupPermissionsOnNode2() throws NotExecutableException, RepositoryException {
        Group testGroup = getTestGroup();

        /* create a second group the test user is member of */
        Principal principal = new TestPrincipal("testGroup" + UUID.randomUUID());
        UserManager umgr = getUserManager(superuser);
        Group group2 = umgr.createGroup(principal);

        try {
            group2.addMember(testUser);
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

    }

    protected Group getTestGroup() throws RepositoryException, NotExecutableException {
        if (testGroup == null) {
            // create the testGroup
            Principal principal = new TestPrincipal("testGroup" + UUID.randomUUID());
            testGroup = getUserManager(superuser).createGroup(principal);
            testGroup.addMember(testUser);
        }
        return testGroup;
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

    }

    public void testAddInvalidEntry() throws RepositoryException, NotExecutableException {
        Principal unknownPrincipal;
        if (!pMgr.hasPrincipal("an unknown principal")) {
            unknownPrincipal = new TestPrincipal("an unknown principal");
        } else {
            throw new NotExecutableException();
        }
        JackrabbitAccessControlList pt = createEmptyTemplate(getTestPath());
        try {
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

    }

    protected Group getTestGroup() throws RepositoryException, NotExecutableException {
        if (testGroup == null) {
            // create the testGroup
            Principal principal = new TestPrincipal("testGroup" + UUID.randomUUID());
            testGroup = getUserManager(superuser).createGroup(principal);
            testGroup.addMember(testUser);
        }
        return testGroup;
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

        siblingPath = n2.getPath();

        // create the testGroup
        UserManager umgr = getUserManager(superuser);

        Principal groupPrincipal = new TestPrincipal("testGroup" + UUID.randomUUID());
        testGroup = umgr.createGroup(groupPrincipal);
        testUser = umgr.createUser("testUser" + UUID.randomUUID(), "pw");
        if (!umgr.isAutoSave() && superuser.hasPendingChanges()) {
            superuser.save();
        }
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

     * @throws Exception
     */
    public void testCacheDoesntContainTestPrincipalImpl() throws Exception {
        Set<Principal> principals = getPrincipalSetFromSession(superuser);
        for (Principal p : principals) {
            Principal testPrinc = new TestPrincipal(p.getName());
            principalProvider.getGroupMembership(testPrinc);
            Principal fromProvider = principalProvider.getPrincipal(p.getName());

            assertNotSame(testPrinc, fromProvider);
            assertFalse(fromProvider instanceof TestPrincipal);
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

        @Override
        protected Principal getPrincipal(Credentials credentials) {
            if (ignore) {
                return null;
            } else {
                return new TestPrincipal(((SimpleCredentials) credentials).getUserID());
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.