use of org.apache.directory.fortress.core.model.PermObj in project directory-fortress-core by apache.
the class Options method getPermObj.
/**
*/
public PermObj getPermObj() {
PermObj permObj = new PermObj();
permObj.setObjName(getName());
permObj.setDescription(getDescription());
permObj.setOu(getOu());
permObj.setType(getType());
updateProperties(permObj);
return permObj;
}
use of org.apache.directory.fortress.core.model.PermObj in project directory-fortress-core by apache.
the class AdminMgrImplTest method delPermObjs.
/**
* @param objArray
*/
public static void delPermObjs(String msg, String[][] objArray, boolean isAdmin) {
LogUtil.logIt(msg);
PermObj pObj = new PermObj();
try {
AdminMgr adminMgr;
if (isAdmin) {
adminMgr = getManagedAdminMgr();
} else {
adminMgr = AdminMgrFactory.createInstance(TestUtils.getContext());
}
for (String[] obj : objArray) {
pObj = PermTestData.getObj(obj);
adminMgr.deletePermObj(pObj);
LOG.debug("delPermObjs objName [" + pObj.getObjName() + "] successful");
}
} catch (SecurityException ex) {
LOG.error("delPermObjs objName [" + pObj.getObjName() + "] caught SecurityException rc=" + ex.getErrorId() + ", msg=" + ex.getMessage(), ex);
fail(ex.getMessage());
}
}
use of org.apache.directory.fortress.core.model.PermObj in project directory-fortress-core by apache.
the class FortressAntLoadTest method readPermissionObjs.
private static void readPermissionObjs(String msg, List<PermObj> permObjs) {
LogUtil.logIt(msg);
try {
ReviewMgr reviewMgr = ReviewMgrImplTest.getManagedReviewMgr();
for (PermObj permObj : permObjs) {
PermObj entity = reviewMgr.readPermObj(permObj);
assertNotNull(entity);
assertTrue("Failed objName value compare", entity.getObjName().equals(permObj.getObjName()));
}
} catch (SecurityException ex) {
LOG.error("readPermissionOps caught SecurityException rc=" + ex.getErrorId() + ", " + "msg=" + ex.getMessage() + ex);
fail(ex.getMessage());
}
}
use of org.apache.directory.fortress.core.model.PermObj in project directory-fortress-core by apache.
the class ReviewMgrImplTest method searchPermissionObjs.
/**
* @param msg
* @param srchValue
* @param pArray
*/
public static void searchPermissionObjs(String msg, String srchValue, String[][] pArray) {
LogUtil.logIt(msg);
try {
ReviewMgr reviewMgr = getManagedReviewMgr();
List<PermObj> objs = reviewMgr.findPermObjs(new PermObj(srchValue));
assertNotNull(objs);
assertTrue(CLS_NM + "searchPermissionObjs srchValue [" + srchValue + "] list size check", pArray.length == objs.size());
for (String[] obj : pArray) {
int indx = objs.indexOf(new PermObj(PermTestData.getName(obj)));
if (indx != -1) {
PermObj entity = objs.get(indx);
assertNotNull(entity);
PermTestData.assertEquals(entity, obj);
LOG.debug("searchPermissionObjs [" + entity.getObjName() + "] successful");
} else {
msg = "searchPermissionObjs srchValue [" + srchValue + "] failed list search";
LogUtil.logIt(msg);
fail(msg);
}
}
} catch (SecurityException ex) {
LOG.error("searchPermissionObjs srchValue [" + srchValue + "] caught SecurityException rc=" + ex.getErrorId() + ", msg=" + ex.getMessage(), ex);
fail(ex.getMessage());
}
}
use of org.apache.directory.fortress.core.model.PermObj in project directory-fortress-core by apache.
the class PermTestData method getObj.
/**
* @param obj
* @return
*/
public static PermObj getObj(String[] obj) {
PermObj pObj = new PermObj();
pObj.setObjName(getName(obj));
pObj.setDescription(getDescription(obj));
pObj.setType(getType(obj));
pObj.setOu(getOu(obj));
pObj.setAdmin(isAdmin(obj));
return pObj;
}
Aggregations