use of com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method createOfflineAddressBook.
protected String createOfflineAddressBook(String name, String addressList, String tenantName) throws FaultMessage {
Document doc = ModelClientUtil.getDocumnent();
ShadowType shadow = new ShadowType();
shadow.setName(ModelClientUtil.createPolyStringType(name, doc));
shadow.setResourceRef(createObjectReferenceType(ResourceType.class, getResourceOid()));
shadow.setObjectClass(OC_OFFLINE_ADDRESS_BOOK);
shadow.setKind(ShadowKindType.GENERIC);
shadow.setIntent("offline-address-book");
ShadowAttributesType attributes = new ShadowAttributesType();
attributes.getAny().add(ModelClientUtil.createTextElement(new QName(NS_ICFS, "name"), name, doc));
attributes.getAny().add(ModelClientUtil.createTextElement(new QName(NS_RI, "AddressLists"), addressList, doc));
//attributes.getAny().add(ModelClientUtil.createTextElement(new QName(NS_RI, "_TenantName"), tenantName, doc));
shadow.setAttributes(attributes);
return createShadow(shadow);
}
use of com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method createObject.
protected String createObject(Class clazz, ObjectType objectType, ModelExecuteOptionsType options, boolean assertSuccess) throws FaultMessage {
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(clazz));
deltaType.setChangeType(ChangeTypeType.ADD);
deltaType.setObjectToAdd(objectType);
ObjectDeltaListType deltaListType = new ObjectDeltaListType();
deltaListType.getDelta().add(deltaType);
ObjectDeltaOperationListType operationListType = modelPort.executeChanges(deltaListType, options);
lastOdo = assertExecuteChangesSuccess(operationListType, null, assertSuccess);
// }
return ModelClientUtil.getOidFromDeltaOperationList(operationListType, deltaType);
}
use of com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method listRequestableRoles.
protected Collection<RoleType> listRequestableRoles() throws SAXException, IOException, FaultMessage, JAXBException {
SearchFilterType filter = ModelClientUtil.parseSearchFilterType("<equal xmlns='http://prism.evolveum.com/xml/ns/public/query-3' xmlns:c='http://midpoint.evolveum.com/xml/ns/public/common/common-3' >" + "<path>c:requestable</path>" + "<value>true</value>" + "</equal>");
QueryType query = new QueryType();
query.setFilter(filter);
SelectorQualifiedGetOptionsType options = new SelectorQualifiedGetOptionsType();
Holder<ObjectListType> objectListHolder = new Holder<ObjectListType>();
Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
modelPort.searchObjects(ModelClientUtil.getTypeQName(RoleType.class), query, options, objectListHolder, resultHolder);
ObjectListType objectList = objectListHolder.value;
return (Collection) objectList.getObject();
}
use of com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method createOrg.
protected String createOrg(OrgType orgType) throws FaultMessage {
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(OrgType.class));
deltaType.setChangeType(ChangeTypeType.ADD);
deltaType.setObjectToAdd(orgType);
ObjectDeltaListType deltaListType = new ObjectDeltaListType();
deltaListType.getDelta().add(deltaType);
ObjectDeltaOperationListType operationListType = modelPort.executeChanges(deltaListType, null);
return ModelClientUtil.getOidFromDeltaOperationList(operationListType, deltaType);
}
use of com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage in project midpoint by Evolveum.
the class TestSanityLegacy method test049DeleteUser.
/**
* The user should have an account now. Let's try to delete the user. The
* account should be gone as well.
*
* @throws JAXBException
*/
@Test
public void test049DeleteUser() throws SchemaException, FaultMessage, DirectoryException, JAXBException {
TestUtil.displayTestTile("test049DeleteUser");
// GIVEN
assertNoRepoCache();
// WHEN
OperationResultType result = deleteObjectViaModelWS(ObjectTypes.USER.getTypeQName(), USER_JACK_OID);
// THEN
assertNoRepoCache();
displayJaxb("deleteObject result", result, SchemaConstants.C_RESULT);
TestUtil.assertSuccess("deleteObject has failed", result);
// User should be gone from the repository
OperationResult repoResult = new OperationResult("getObject");
try {
repositoryService.getObject(UserType.class, USER_JACK_OID, null, repoResult);
AssertJUnit.fail("User still exists in repo after delete");
} catch (ObjectNotFoundException e) {
// This is expected
}
// Account shadow should be gone from the repository
repoResult = new OperationResult("getObject");
try {
repositoryService.getObject(ShadowType.class, accountShadowOidOpendj, null, repoResult);
AssertJUnit.fail("Shadow still exists in repo after delete");
} catch (ObjectNotFoundException e) {
// This is expected, but check also the result
AssertJUnit.assertFalse("getObject failed as expected, but the result indicates success", repoResult.isSuccess());
}
// Account should be deleted from LDAP
InternalSearchOperation op = openDJController.getInternalConnection().processSearch("dc=example,dc=com", SearchScope.WHOLE_SUBTREE, DereferencePolicy.NEVER_DEREF_ALIASES, 100, 100, false, "(uid=" + USER_JACK_LDAP_UID + ")", null);
AssertJUnit.assertEquals(0, op.getEntriesSent());
}
Aggregations