use of com.evolveum.icf.dummy.resource.DummyObjectClass in project midpoint by Evolveum.
the class TestVillage method initSystem.
@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
super.initSystem(initTask, initResult);
// Resources
dummyResourceCtlSrc = DummyResourceContoller.create(RESOURCE_DUMMY_SOURCE_ID, resourceDummySrc);
DummyObjectClass dummyAdAccountObjectClass = dummyResourceCtlSrc.getDummyResource().getAccountObjectClass();
dummyResourceCtlSrc.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_SRC_FIRST_NAME, String.class, false, false);
dummyResourceCtlSrc.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_SRC_LAST_NAME, String.class, false, false);
dummyResourceCtlSrc.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_SRC_TYPE, String.class, false, false);
dummyResourceCtlSrc.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_SRC_LOC, String.class, false, false);
dummyResourceCtlSrc.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_SRC_ORG, String.class, false, false);
dummyResourceSrc = dummyResourceCtlSrc.getDummyResource();
resourceDummySrc = importAndGetObjectFromFile(ResourceType.class, RESOURCE_DUMMY_SOURCE_FILE, RESOURCE_DUMMY_SOURCE_OID, initTask, initResult);
resourceDummySrcType = resourceDummySrc.asObjectable();
dummyResourceCtlSrc.setResource(resourceDummySrc);
dummyResourceSrc.setSyncStyle(DummySyncStyle.SMART);
resourceOpenDj = importAndGetObjectFromFile(ResourceType.class, RESOURCE_OPENDJ_FILE, RESOURCE_OPENDJ_OID, initTask, initResult);
resourceOpenDjType = resourceOpenDj.asObjectable();
openDJController.setResource(resourceOpenDj);
// Object Templates
importObjectFromFile(OBJECT_TEMPLATE_USER_FILE, initResult);
setDefaultUserTemplate(OBJECT_TEMPLATE_USER_OID);
// Role
importObjectFromFile(ROLE_BASIC_FILE, initResult);
importObjectFromFile(ROLE_SIMPLE_FILE, initResult);
importObjectFromFile(ROLE_META_FUNCTIONAL_ORG_FILE, initResult);
importObjectFromFile(ROLE_META_PROJECT_ORG_FILE, initResult);
// Org
repoAddObjectsFromFile(ORGS_FILE, OrgType.class, initResult);
// LDAP content
openDJController.addEntryFromLdifFile(GROUP_GOV_MONKEY_ISLAND_LDIF_FILE);
openDJController.addEntryFromLdifFile(GROUP_EXEC_MONKEY_ISLAND_LDIF_FILE);
// Tasks
importObjectFromFile(TASK_LIVE_SYNC_DUMMY_SOURCE_FILE, initResult);
InternalMonitor.setTracePrismObjectClone(true);
}
use of com.evolveum.icf.dummy.resource.DummyObjectClass in project midpoint by Evolveum.
the class DummyResourceContoller method extendSchemaAd.
/**
* Extend dummy schema to look like AD
*/
public void extendSchemaAd() throws ConnectException, FileNotFoundException, SchemaViolationException, ConflictException {
DummyObjectClass accountObjectClass = dummyResource.getAccountObjectClass();
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_GIVEN_NAME_NAME, String.class, false, false);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_SN_NAME, String.class, false, false);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_SAM_ACCOUNT_NAME_NAME, String.class, false, false);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_USER_PRINCIPAL_NAME_NAME, String.class, false, false);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_USER_SHARED_FOLDER_OTHER_NAME, String.class, false, true);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_MAIL_NAME, String.class, false, false);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_DEPARTMENT_NAME, String.class, false, false);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_FACSIMILE_TELEPHONE_NUMBER_NAME, String.class, false, false);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_TELEPHONE_NUMBER_NAME, String.class, false, false);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_MOBILE_NAME, String.class, false, false);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_IP_PHONE_NAME, String.class, false, false);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_PHYSICAL_DELIVERY_OFFICE_NAME_NAME, String.class, false, false);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_DESCRIPTION_NAME, String.class, false, false);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_ACCOUNT_EXPIRES_NAME, Long.class, false, false);
// This should in fact be icfs:groups but this is OK for now
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_GROUPS_NAME, String.class, false, true);
isExtendedSchema = true;
}
use of com.evolveum.icf.dummy.resource.DummyObjectClass in project midpoint by Evolveum.
the class DummyResourceContoller method extendSchemaPosix.
/**
* Extend dummy schema to have an auxiliary OC.
*/
public void extendSchemaPosix() throws ConnectException, FileNotFoundException, SchemaViolationException {
DummyObjectClass posixAccount = new DummyObjectClass();
// uid and gid are temporarily not required
addAttrDef(posixAccount, DUMMY_ACCOUNT_ATTRIBUTE_POSIX_UID_NUMBER, Integer.class, false, false);
addAttrDef(posixAccount, DUMMY_ACCOUNT_ATTRIBUTE_POSIX_GID_NUMBER, Integer.class, false, false);
dummyResource.addAuxiliaryObjectClass(DUMMY_POSIX_ACCOUNT_OBJECT_CLASS_NAME, posixAccount);
isExtendedSchema = true;
}
use of com.evolveum.icf.dummy.resource.DummyObjectClass in project midpoint by Evolveum.
the class DummyResourceContoller method extendSchemaPirate.
/**
* Extend schema in piratey fashion. Arr! This is used in many tests. Lots of attributes, various combination of types, etc.
*/
public void extendSchemaPirate() throws ConnectException, FileNotFoundException, SchemaViolationException, ConflictException {
populateWithDefaultSchema();
DummyObjectClass accountObjectClass = dummyResource.getAccountObjectClass();
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME, String.class, false, true);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_SHIP_NAME, String.class, false, false);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, String.class, false, false);
DummyAttributeDefinition lootAttrDef = addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_LOOT_NAME, Integer.class, false, false);
lootAttrDef.setReturnedByDefault(false);
DummyAttributeDefinition treasureAttrDef = addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_TREASURE_NAME, String.class, false, false);
treasureAttrDef.setReturnedByDefault(false);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_WEAPON_NAME, String.class, false, true);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_DRINK_NAME, String.class, false, true);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_QUOTE_NAME, String.class, false, true);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME, String.class, false, true);
addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_WATER_NAME, String.class, false, false);
DummyObjectClass groupObjectClass = dummyResource.getGroupObjectClass();
addAttrDef(groupObjectClass, DUMMY_GROUP_ATTRIBUTE_DESCRIPTION, String.class, false, false);
addAttrDef(groupObjectClass, DUMMY_GROUP_ATTRIBUTE_CC, String.class, false, false);
DummyObjectClass privilegeObjectClass = dummyResource.getPrivilegeObjectClass();
addAttrDef(privilegeObjectClass, DUMMY_PRIVILEGE_ATTRIBUTE_POWER, Integer.class, false, false);
isExtendedSchema = true;
}
use of com.evolveum.icf.dummy.resource.DummyObjectClass in project midpoint by Evolveum.
the class TestOrgSync method initSystem.
@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
super.initSystem(initTask, initResult);
reconciliationTaskResultListener = new DebugReconciliationTaskResultListener();
reconciliationTaskHandler.setReconciliationTaskResultListener(reconciliationTaskResultListener);
// Resources
dummyResourceCtlHr = DummyResourceContoller.create(RESOURCE_DUMMY_HR_ID, resourceDummyHr);
DummyObjectClass dummyAdAccountObjectClass = dummyResourceCtlHr.getDummyResource().getAccountObjectClass();
dummyResourceCtlHr.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_HR_FIRST_NAME, String.class, false, false);
dummyResourceCtlHr.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_HR_LAST_NAME, String.class, false, false);
dummyResourceCtlHr.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_HR_ORGPATH, String.class, false, false);
dummyResourceCtlHr.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_HR_RESPONSIBILITIES, String.class, false, true);
dummyResourceHr = dummyResourceCtlHr.getDummyResource();
resourceDummyHr = importAndGetObjectFromFile(ResourceType.class, RESOURCE_DUMMY_HR_FILE, RESOURCE_DUMMY_HR_OID, initTask, initResult);
resourceDummyHrType = resourceDummyHr.asObjectable();
dummyResourceCtlHr.setResource(resourceDummyHr);
dummyResourceHr.setSyncStyle(DummySyncStyle.SMART);
resourceOpenDj = importAndGetObjectFromFile(ResourceType.class, RESOURCE_OPENDJ_FILE, RESOURCE_OPENDJ_OID, initTask, initResult);
resourceOpenDjType = resourceOpenDj.asObjectable();
openDJController.setResource(resourceOpenDj);
// LDAP content
openDJController.addEntryFromLdifFile(SCABB_OU_LDIF_FILE);
openDJController.addEntryFromLdifFile(BOOTY_OU_LDIF_FILE);
openDJController.addEntryFromLdifFile(BOOTY_LOOKOUT_OU_LDIF_FILE);
// Object Templates
importObjectFromFile(OBJECT_TEMPLATE_USER_FILE, initResult);
setDefaultUserTemplate(OBJECT_TEMPLATE_USER_OID);
importObjectFromFile(OBJECT_TEMPLATE_ORG_FILE, initResult);
setDefaultObjectTemplate(OrgType.COMPLEX_TYPE, OBJECT_TEMPLATE_ORG_OID);
importObjectFromFile(OBJECT_TEMPLATE_ROLE_FILE, initResult);
setDefaultObjectTemplate(RoleType.COMPLEX_TYPE, OBJECT_TEMPLATE_ROLE_OID);
// Org
importObjectFromFile(ORG_TOP_FILE, initResult);
// Role
importObjectFromFile(ROLE_BASIC_FILE, initResult);
importObjectFromFile(ROLE_META_REPLICATED_ORG_FILE, initResult);
importObjectFromFile(ROLE_META_RESPONSIBILITY_FILE, initResult);
// Tasks
importObjectFromFile(TASK_LIVE_SYNC_DUMMY_HR_FILE, initResult);
}
Aggregations