Examples of ListOrderedMap


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

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

        // 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
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.