Search in sources :

Example 1 with GroupMgr

use of org.apache.directory.fortress.core.GroupMgr in project directory-fortress-core by apache.

the class GroupAntTest method findGroups.

private void findGroups(String msg, List<Group> inGroups) {
    LogUtil.logIt(msg);
    try {
        GroupMgr groupMgr = GroupMgrFactory.createInstance();
        List<Group> outGroups = groupMgr.find(new Group("t"));
        assertNotNull(outGroups);
        assertTrue("findGroups result set wrong size", outGroups.size() == inGroups.size());
        for (Group inGroupAnt : inGroups) {
            Group inGroup = inGroupAnt;
            int index = outGroups.indexOf(inGroup);
            assertTrue("findGroups input data error ", index != -1);
            Group outGroup = outGroups.get(index);
            assertNotNull(outGroup);
            assertEqual(inGroup, outGroup);
        }
    } catch (SecurityException ex) {
        LOG.error("findGroups caught SecurityException=" + ex.getMessage(), ex);
        fail(ex.getMessage());
    }
}
Also used : GroupMgr(org.apache.directory.fortress.core.GroupMgr) Group(org.apache.directory.fortress.core.model.Group) SecurityException(org.apache.directory.fortress.core.SecurityException)

Example 2 with GroupMgr

use of org.apache.directory.fortress.core.GroupMgr in project directory-fortress-core by apache.

the class GroupAntTest method readGroups.

private void readGroups(String msg, List<Group> groups) {
    LogUtil.logIt(msg);
    try {
        GroupMgr groupMgr = GroupMgrFactory.createInstance();
        for (Group inGroup : groups) {
            Group outGroup = groupMgr.read(inGroup);
            assertNotNull(outGroup);
            assertEqual(inGroup, outGroup);
        }
    } catch (SecurityException ex) {
        LOG.error("readGroups caught SecurityException=" + ex.getMessage(), ex);
        fail(ex.getMessage());
    }
}
Also used : GroupMgr(org.apache.directory.fortress.core.GroupMgr) Group(org.apache.directory.fortress.core.model.Group) SecurityException(org.apache.directory.fortress.core.SecurityException)

Aggregations

GroupMgr (org.apache.directory.fortress.core.GroupMgr)2 SecurityException (org.apache.directory.fortress.core.SecurityException)2 Group (org.apache.directory.fortress.core.model.Group)2