use of org.apache.directory.fortress.core.AuditMgr in project directory-fortress-core by apache.
the class AuditMgrImplTest method searchAdminMods.
/**
* @param msg
* @param uArray
*/
private static void searchAdminMods(String msg, String[][] uArray, String[][] oArray, String[][] opArray) {
LogUtil.logIt(msg);
try {
AuditMgr auditMgr = getManagedAuditMgr();
for (String[] usr : uArray) {
User user = UserTestData.getUser(usr);
// now search for successful session creation events:
UserAudit uAudit = new UserAudit();
uAudit.setUserId(user.getUserId());
for (String[] obj : oArray) {
String objName = AdminUtil.getObjName(PermTestData.getName(obj));
uAudit.setObjName(objName);
for (String[] op : opArray) {
uAudit.setOpName(PermTestData.getName(op));
List<Mod> mods = auditMgr.searchAdminMods(uAudit);
assertNotNull(mods);
assertTrue(CLS_NM + "searchAdminMods failed search for successful authentication user [" + user.getUserId() + "] object [" + objName + "] operation [" + PermTestData.getName(op) + "]", mods.size() > 0 || !isAudit(objName, PermTestData.getName(op)));
boolean result = mods.size() > 0 || !isAudit(objName, PermTestData.getName(op));
LOG.debug("searchAdminMods search user [" + user.getUserId() + "] object [" + objName + "] operation [" + PermTestData.getName(op) + "] result: " + result);
// System.out.println("searchAdminMods search user [" + user.getUserId() + "] object [" + objName + "] operation [" + PermTestData.getName(op) + "] result: " + result);
}
}
}
LOG.debug("searchAdminMods successful");
} catch (SecurityException ex) {
LOG.error("searchAdminMods: failed with SecurityException rc=" + ex.getErrorId() + ", msg=" + ex.getMessage(), ex);
fail(ex.getMessage());
}
}
Aggregations