Search in sources :

Example 16 with OperationResultType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType in project midpoint by Evolveum.

the class AbstractTestForExchangeConnector method getConfiguration.

protected SystemConfigurationType getConfiguration() throws FaultMessage {
    Holder<ObjectType> objectHolder = new Holder<ObjectType>();
    Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
    SelectorQualifiedGetOptionsType options = new SelectorQualifiedGetOptionsType();
    modelPort.getObject(ModelClientUtil.getTypeQName(SystemConfigurationType.class), SystemObjectsType.SYSTEM_CONFIGURATION.value(), options, objectHolder, resultHolder);
    return (SystemConfigurationType) objectHolder.value;
}
Also used : ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) Holder(javax.xml.ws.Holder) SystemConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType) SelectorQualifiedGetOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionsType)

Example 17 with OperationResultType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType in project midpoint by Evolveum.

the class TestExchangeAlreadyExistsHandling method test140CreateWilburWrightConflictOnUserPrincipalName.

@Test
public void test140CreateWilburWrightConflictOnUserPrincipalName() throws Exception {
    System.out.println("Creating account for Wilbur Wright, should create a conflict on userPrincipalName...");
    String oid = createAccount("Wilbur", "Wright", dn("Wilbur", "Wright"), "User", null, "wright1", "wright@test.uniba.local", false);
    System.out.println("Done; OID = " + oid);
    OperationResultType result = lastOdo.getExecutionResult();
    String message = result.getMessage();
    assertTrue("Result should not be SUCCESS", result.getStatus() != OperationResultStatusType.SUCCESS);
    assertTrue("Message should contain AlreadyExistsException; it is " + message + " instead", message.contains("AlreadyExistsException"));
}
Also used : OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) Test(org.testng.annotations.Test)

Example 18 with OperationResultType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType in project midpoint by Evolveum.

the class TestExchangeAlreadyExistsHandling method test120CreateWilburWrightConflictOnSamAccountName.

@Test
public void test120CreateWilburWrightConflictOnSamAccountName() throws Exception {
    System.out.println("Creating account for Wilbur Wright, should create a conflict on samAccountName...");
    wilburOid = createAccount("Wilbur", "Wright", dn("Wilbur", "Wright"), "User", null, "wright", null, false);
    System.out.println("Done; OID = " + wilburOid);
    OperationResultType result = lastOdo.getExecutionResult();
    String message = result.getMessage();
    assertTrue("Result should not be SUCCESS", result.getStatus() != OperationResultStatusType.SUCCESS);
    assertTrue("Message should contain AlreadyExistsException; it is " + message + " instead", message.contains("AlreadyExistsException"));
}
Also used : OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) Test(org.testng.annotations.Test)

Example 19 with OperationResultType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType in project midpoint by Evolveum.

the class TestExchangeConnectorLow method test150CreateHuygensConflicting.

@Test
public void test150CreateHuygensConflicting() throws Exception {
    String mail = "pascal@clermont-ferrand.fr";
    System.out.println("Creating account for Huygens...");
    ObjectDeltaOperationType odo = createAccountOdo(HUYGENS_GIVEN_NAME, HUYGENS_SN, dn(HUYGENS_GIVEN_NAME, HUYGENS_SN), "UserMailbox", mail);
    OperationResultType result = odo.getExecutionResult();
    System.out.println("Done; status = " + result.getStatus() + ":" + result.getMessage());
//        ShadowType huygens = checkAccount(HUYGENS_GIVEN_NAME, HUYGENS_SN, dn(HUYGENS_GIVEN_NAME, HUYGENS_SN), getContainer());
//        Map<String,Object> attrs = getAttributesAsMap(pascal);
//        assertAttributeEquals(attrs, "RecipientType", "UserMailbox");
//        assertAttributeExists(attrs, "homeMDB");
//        assertAttributeEquals(attrs, "PrimarySmtpAddress", mail);
//        assertAttributeEquals(attrs, "mail", mail);
//        assertAttributeEquals(attrs, "Alias", PASCAL_SN.toLowerCase());
//        assertAttributeContains(attrs, "EmailAddresses", "SMTP:" + mail);               // FIXME
//        assertAttributeEquals(attrs, "EmailAddressPolicyEnabled", "true");
//        assertAttributeEquals(attrs, "msExchRecipientDisplayType", "1073741824");
//        assertAttributeEquals(attrs, "msExchRecipientTypeDetails", "1");
//        assertAttributeEquals(attrs, "displayName", PASCAL_GIVEN_NAME + " " + PASCAL_SN);
}
Also used : ObjectDeltaOperationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaOperationType) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) Test(org.testng.annotations.Test)

Example 20 with OperationResultType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType in project midpoint by Evolveum.

the class TestSanityLegacy method test015AccountOwner.

@Test
public void test015AccountOwner() throws FaultMessage, ObjectNotFoundException, SchemaException, JAXBException {
    TestUtil.displayTestTile("test015AccountOwner");
    // GIVEN
    checkRepoOpenDjResource();
    assertNoRepoCache();
    Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
    Holder<UserType> userHolder = new Holder<UserType>();
    // WHEN
    modelWeb.findShadowOwner(accountShadowOidOpendj, userHolder, resultHolder);
    // THEN
    display("listAccountShadowOwner result", resultHolder.value);
    TestUtil.assertSuccess("listAccountShadowOwner has failed (result)", resultHolder.value);
    UserType user = userHolder.value;
    assertNotNull("No owner", user);
    assertEquals(USER_JACK_OID, user.getOid());
    System.out.println("Account " + accountShadowOidOpendj + " has owner " + ObjectTypeUtil.toShortString(user));
}
Also used : OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) Holder(javax.xml.ws.Holder) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType) Test(org.testng.annotations.Test) AbstractModelIntegrationTest(com.evolveum.midpoint.model.test.AbstractModelIntegrationTest)

Aggregations

OperationResultType (com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType)172 Test (org.testng.annotations.Test)106 Holder (javax.xml.ws.Holder)78 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)75 AbstractModelIntegrationTest (com.evolveum.midpoint.model.test.AbstractModelIntegrationTest)63 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)57 PrismAsserts.assertEqualsPolyString (com.evolveum.midpoint.prism.util.PrismAsserts.assertEqualsPolyString)56 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)53 ObjectDeltaType (com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType)49 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)47 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)34 SelectorQualifiedGetOptionsType (com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionsType)34 ChangeRecordEntry (org.opends.server.util.ChangeRecordEntry)32 ObjectListType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectListType)26 SystemConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType)23 LogfileTestTailer (com.evolveum.midpoint.test.util.LogfileTestTailer)21 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)18 FaultMessage (com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage)18 QName (javax.xml.namespace.QName)18 GenericObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.GenericObjectType)17