Package org.apache.commons.collections.map

Examples of org.apache.commons.collections.map.ListOrderedMap


        // remember the z-folder for later removal
        toRemove.add((NodeImpl) u.getNode().getParent().getParent());
        assertEquals(usersPath + "/z/zz/z", u.getNode().getPath());

        Map<String, String> m = new ListOrderedMap();
        m.put("zz", "/z/zz/zz");
        // zzz -> potential conflict: must be added to 3rd level
        m.put("zzz", "/z/zz/zzz/zzz");

        // more users -> added to 2nd level until max-size (5) is reached.
        m.put("zzABC", "/z/zz/zzABC");
        m.put("zzzh", "/z/zz/zzzh");

        // max-size on level 2 (zz) is reached -> added to 3rd level.
        m.put("zzzzZ", "/z/zz/zzz/zzzzZ");
        m.put("zzh", "/z/zz/zzh/zzh");
        m.put("zzXyzzz", "/z/zz/zzX/zzXyzzz");

        // zzzz, zzza -> potential conflicts on the 3rd level
        // -> must be added to 4th level
        m.put("zzzz", "/z/zz/zzz/zzzz/zzzz");
        m.put("zzza", "/z/zz/zzz/zzza/zzza");


        // zA -> to short for 3rd -> must be inserted at the 2nd level.
        m.put("zA", "/z/zA/zA");

        for (String uid : m.keySet()) {
            u = (UserImpl) uMgr.createUser(uid, uid);
            save(s);
            assertEquals(usersPath + m.get(uid), u.getNode().getPath());
        }
    }
View Full Code Here


        // now create a second user manager that has auto-expand-tree enabled
        createUserManager(2, true, 1);


        Map<String, String> m = new ListOrderedMap();
        // upon creation of any a new user 'zzzA' an additional intermediate
        // folder would be created if there wasn't the colliding authorizable
        // 'zzz' -> autoexpansion is aborted.
        m.put("zzzA", "/z/zz/zzzA");
        // this is also true for 'zzzzz' and zzzBsl
        m.put("zzzzz", "/z/zz/zzzzz");
        m.put("zzzBsl", "/z/zz/zzzBsl");

        // on other levels the expansion must still work as expected.
        // - zzBsl -> zz is completed -> create zzB -> insert zzBsl user
        // - zzBslrich -> zz, zzB are completed -> create zzBs -> insert zzBslrich user
        m.put("zzBsl", "/z/zz/zzB/zzBsl");
        m.put("zzBslrich", "/z/zz/zzB/zzBs/zzBslrich");

        for (String uid : m.keySet()) {
            u = (UserImpl) uMgr.createUser(uid, uid);
            save(s);

            assertEquals(usersPath + m.get(uid), u.getNode().getPath());
            assertNotNull(uMgr.getAuthorizable(uid));
        }
    }
View Full Code Here

        // remember the z-folder for later removal
        toRemove.add((NodeImpl) u.getNode().getParent().getParent());
        assertEquals(usersPath + "/z/zz/z", u.getNode().getPath());

        Map<String, String> m = new ListOrderedMap();
        // potential conflicting uid
        m.put("zzz", "/z/zz/zzz/zzz");
        // max-size (2) is reached
        m.put("zzzuerich", "/z/zz/zzz/zzzuerich");
        m.put("zzuerich", "/z/zz/zzu/zzuerich");
        // too short for expanded folders
        m.put("zz", "/z/zz/zz");

        for (String uid : m.keySet()) {
            u = (UserImpl) uMgr.createUser(uid, uid);
            save(s);

            assertEquals(usersPath + m.get(uid), u.getNode().getPath());

            User us = (User) uMgr.getAuthorizable(uid);
            assertNotNull(us);
            assertEquals(uid, us.getID());
        }
View Full Code Here

        // remember the z-folder for later removal
        toRemove.add((NodeImpl) u.getNode().getParent().getParent());
        assertEquals(usersPath + "/z/zz/z", u.getNode().getPath());

        Map<String, String> m = new ListOrderedMap();
        m.put("zz",     "/z/zz/zz");
        m.put("zzz",    "/z/zz/zzz");
        m.put("zzzz",   "/z/zz/zzzz");
        m.put("zh",     "/z/zh/zh");
        m.put("zHzh",   "/z/zH/zHzh");
        m.put("z_Hz",   "/z/z_/z_Hz");
        m.put("z�rich", "/z/z�/z�rich");

        for (String uid : m.keySet()) {
            u = (UserImpl) uMgr.createUser(uid, uid);
            save(s);
            assertEquals(usersPath + m.get(uid), u.getNode().getPath());
        }
    }
View Full Code Here

        // remember the z-folder for later removal
        toRemove.add((NodeImpl) u.getNode().getParent().getParent().getParent());
        assertEquals(usersPath + "/z/zz/zzz/z", u.getNode().getPath());

        Map<String, String> m = new ListOrderedMap();
        m.put("zz",     "/z/zz/zzz/zz");
        m.put("zzz",    "/z/zz/zzz/zzz");
        m.put("zzzz",   "/z/zz/zzz/zzzz");
        m.put("zH",     "/z/zH/zHH/zH");
        m.put("zHzh",   "/z/zH/zHz/zHzh");
        m.put("z_Hz",   "/z/z_/z_H/z_Hz");
        m.put("z�rich", "/z/z�/z�r/z�rich");

        for (String uid : m.keySet()) {
            u = (UserImpl) uMgr.createUser(uid, uid);
            save(s);

            assertEquals(usersPath + m.get(uid), u.getNode().getPath());

            Authorizable az = uMgr.getAuthorizable(uid);
            assertNotNull(az);
        }
    }
View Full Code Here

    private class Entries {

        private final ListOrderedMap principalNamesToEntries;

        private Entries(NodeImpl node, Collection principalNames) throws RepositoryException {
            principalNamesToEntries = new ListOrderedMap();
            for (Iterator it = principalNames.iterator(); it.hasNext();) {
                principalNamesToEntries.put(it.next(), new ArrayList());
            }
            collectEntries(node);
        }
View Full Code Here

        // remember the z-folder for later removal
        toRemove.add((NodeImpl) u.getNode().getParent().getParent());
        assertEquals(usersPath + "/z/zz/z", u.getNode().getPath());

        Map<String, String> m = new ListOrderedMap();
        m.put("zz",     "/z/zz/zz");
        m.put("zzz",    "/z/zz/zzz");
        m.put("zzzz",   "/z/zz/zzzz");
        m.put("zh",     "/z/zh/zh");
        m.put("zHzh",   "/z/zH/zHzh");
        m.put("z_Hz",   "/z/z_/z_Hz");
        m.put("z\u00cfrich", "/z/z\u00cf/z\u00cfrich");

        for (String uid : m.keySet()) {
            u = (UserImpl) uMgr.createUser(uid, uid);
            save(s);
            assertEquals(usersPath + m.get(uid), u.getNode().getPath());
        }
    }
View Full Code Here

        // remember the z-folder for later removal
        toRemove.add((NodeImpl) u.getNode().getParent().getParent().getParent());
        assertEquals(usersPath + "/z/zz/zzz/z", u.getNode().getPath());

        Map<String, String> m = new ListOrderedMap();
        m.put("zz",     "/z/zz/zzz/zz");
        m.put("zzz",    "/z/zz/zzz/zzz");
        m.put("zzzz",   "/z/zz/zzz/zzzz");
        m.put("zH",     "/z/zH/zHH/zH");
        m.put("zHzh",   "/z/zH/zHz/zHzh");
        m.put("z_Hz",   "/z/z_/z_H/z_Hz");
        m.put("z\u00cfrich", "/z/z\u00cf/z\u00cfr/z\u00cfrich");

        for (String uid : m.keySet()) {
            u = (UserImpl) uMgr.createUser(uid, uid);
            save(s);

            assertEquals(usersPath + m.get(uid), u.getNode().getPath());

            Authorizable az = uMgr.getAuthorizable(uid);
            assertNotNull(az);
        }
    }
View Full Code Here

        toRemove.add((NodeImpl) u.getNode().getParent().getParent());

        String zu = Text.escapeIllegalJcrChars("z*");
        String zur = Text.escapeIllegalJcrChars("z*r");

        Map<String, String> m = new ListOrderedMap();
        // test illegal JCR chars in uid
        // on level 2
        m.put("z*rich", "/z/" + zu + "/" + Text.escapeIllegalJcrChars("z*rich"));
        m.put("z*riq""/z/" + zu + "/" + Text.escapeIllegalJcrChars("z*riq"));
        m.put("z*",     "/z/" + zu + "/" + zu)// still on level 2 (too short for 3)
        // on level 3
        m.put("z*rik""/z/" + zu + "/" + zur + "/" + Text.escapeIllegalJcrChars("z*rik"));
        m.put("z*.ri""/z/" + zu + "/" + Text.escapeIllegalJcrChars("z*.") + "/" + Text.escapeIllegalJcrChars("z*.ri"));

        for (String uid : m.keySet()) {
            u = (UserImpl) uMgr.createUser(uid, uid);
            save(s);
            assertEquals(usersPath + m.get(uid), u.getNode().getPath());

            Authorizable ath = uMgr.getAuthorizable(uid);
            assertNotNull("User with id " + uid + " must exist.", ath);
            assertFalse("User with id " + uid + " must not be a group.", ath.isGroup());
        }
View Full Code Here

        // remember the z-folder for later removal
        toRemove.add((NodeImpl) u.getNode().getParent().getParent());
        assertEquals(usersPath + "/z/zz/z", u.getNode().getPath());

        Map<String, String> m = new ListOrderedMap();
        m.put("zz", "/z/zz/zz");
        // zzz -> potential conflict: must be added to 3rd level
        m.put("zzz", "/z/zz/zzz/zzz");

        // more users -> added to 2nd level until max-size (5) is reached.
        m.put("zzABC", "/z/zz/zzABC");
        m.put("zzzh", "/z/zz/zzzh");

        // max-size on level 2 (zz) is reached -> added to 3rd level.
        m.put("zzzzZ", "/z/zz/zzz/zzzzZ");
        m.put("zzh", "/z/zz/zzh/zzh");
        m.put("zzXyzzz", "/z/zz/zzX/zzXyzzz");

        // zzzz, zzza -> potential conflicts on the 3rd level
        // -> must be added to 4th level
        m.put("zzzz", "/z/zz/zzz/zzzz/zzzz");
        m.put("zzza", "/z/zz/zzz/zzza/zzza");


        // zA -> to short for 3rd -> must be inserted at the 2nd level.
        m.put("zA", "/z/zA/zA");

        for (String uid : m.keySet()) {
            u = (UserImpl) uMgr.createUser(uid, uid);
            save(s);
            assertEquals(usersPath + m.get(uid), u.getNode().getPath());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.map.ListOrderedMap

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.