Skip to content

Commit

Permalink
fixed many test in model-intest, some still failing
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Feb 19, 2018
1 parent bb534cf commit 46bc44a
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 91 deletions.
Expand Up @@ -275,7 +275,8 @@ public void test100ModifyUserAddAccount() throws Exception {
assertNull("Unexpected object in accountRefValue", accountRefValue.getObject());

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");
assertEnableTimestampShadow(accountShadow, startTime, endTime);

Expand Down Expand Up @@ -833,7 +834,8 @@ public void test120AddAccount() throws Exception {
assertEquals("Unexpected number of accountRefs", 0, userJackType.getLinkRef().size());

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");
assertEnableTimestampShadow(accountShadow, startTime, endTime);

Expand Down Expand Up @@ -903,7 +905,8 @@ public void test121ModifyUserAddAccountRef() throws Exception {
accountJackOid = getSingleLinkOid(userJack);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");

// Check account
Expand Down Expand Up @@ -971,7 +974,8 @@ public void test128ModifyUserDeleteAccountRef() throws Exception {
assertUserNoAccountRefs(userJack);

// Check shadow (if it is unchanged)
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");

// Check account (if it is unchanged)
Expand Down Expand Up @@ -1132,7 +1136,7 @@ public void test131ModifyUserJackAssignAccount() throws Exception {
TestUtil.assertSuccess("executeChanges result", result);
XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar();
assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 0);
assertCounterIncrement(InternalCounters.PRISM_OBJECT_CLONE_COUNT, 72);
assertCounterIncrement(InternalCounters.PRISM_OBJECT_CLONE_COUNT, 67);

PrismObject<UserType> userAfter = getUser(USER_JACK_OID);
display("User after change execution", userAfter);
Expand All @@ -1146,7 +1150,8 @@ public void test131ModifyUserJackAssignAccount() throws Exception {
accountJackOid = getSingleLinkOid(userAfter);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");
assertEnableTimestampShadow(accountShadow, startTime, endTime);

Expand Down Expand Up @@ -1226,7 +1231,8 @@ public void test132ModifyAccountJackDummy() throws Exception {
accountJackOid = getSingleLinkOid(userJack);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");

// Check account
Expand Down Expand Up @@ -1309,7 +1315,8 @@ public void test135ModifyUserJackAssignAccountAgain() throws Exception {


// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");

// Check account
Expand Down Expand Up @@ -1376,7 +1383,8 @@ public void test136JackRecomputeNoChange() throws Exception {
assertEquals("Account OID changed", accountJackOid, accountJackOidAfter);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");

// Check account
Expand Down Expand Up @@ -1508,7 +1516,8 @@ public void test141ModifyUserJackAssignAccountPositiveEnforcement() throws Excep
accountJackOid = getSingleLinkOid(userJack);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");
assertEnableTimestampShadow(accountShadow, startTime, endTime);

Expand Down Expand Up @@ -1599,7 +1608,8 @@ public void test148ModifyUserJackUnassignAccountPositiveEnforcement() throws Exc
assertLinked(userJack, accountJackOid);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");

// Check account
Expand Down Expand Up @@ -1752,7 +1762,8 @@ public void test151ModifyUserJackAssignAccountRelativeEnforcement() throws Excep
accountJackOid = getSingleLinkOid(userJack);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");
assertEnableTimestampShadow(accountShadow, startTime, endTime);

Expand Down Expand Up @@ -1962,7 +1973,8 @@ public void test163ModifyUserJackAddAccountNoneEnforcement() throws Exception {
accountJackOid = getSingleLinkOid(userJack);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");
assertEnableTimestampShadow(accountShadow, startTime, endTime);

Expand Down Expand Up @@ -2032,7 +2044,8 @@ public void test164ModifyUserJackUnassignAccountNoneEnforcement() throws Excepti
accountJackOid = getSingleLinkOid(userJack);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");

// Check account
Expand Down Expand Up @@ -2236,7 +2249,8 @@ public void test182ModifyUserAddAndAssignAccountPositiveEnforcement() throws Exc
assertNull("Unexpected object in accountRefValue", accountRefValue.getObject());

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");
assertEnableTimestampShadow(accountShadow, startTime, endTime);

Expand Down Expand Up @@ -2365,7 +2379,8 @@ public void test190ModifyUserJackAssignAccountAndModify() throws Exception {
accountJackOid = getSingleLinkOid(userJack);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, USER_JACK_USERNAME);
assertEnableTimestampShadow(accountShadow, startTime, endTime);

Expand Down Expand Up @@ -2494,7 +2509,8 @@ public void test191ModifyUserJackModifyAssignment() throws Exception {
accountJackOid = getSingleLinkOid(userJack);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, USER_JACK_USERNAME);

// Check account
Expand Down Expand Up @@ -2553,7 +2569,8 @@ public void test192ModifyUserJack() throws Exception {
accountJackOid = getSingleLinkOid(userAfter);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");

// Check account
Expand Down Expand Up @@ -2622,7 +2639,8 @@ public void test193ModifyUserJackLocationEmpty() throws Exception {
accountJackOid = getSingleLinkOid(userAfter);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");

// Check account
Expand Down Expand Up @@ -2724,7 +2742,8 @@ public void test195ModifyUserJackLocationSea() throws Exception {
accountJackOid = getSingleLinkOid(userAfter);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");

// Check account
Expand Down Expand Up @@ -2792,7 +2811,8 @@ public void test198ModifyUserJackRaw() throws Exception {
accountJackOid = getSingleLinkOid(userJack);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountJackOid, "jack");

// Check account - the original fullName should not be changed
Expand Down Expand Up @@ -2918,7 +2938,8 @@ public void test200AddUserBlackbeardWithAccount() throws Exception {
assertPasswordMetadata(userBlackbeard, true, startTime, endTime, USER_ADMINISTRATOR_OID, "http://pirates.net/avast");

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountOid, "blackbeard");
assertEnableTimestampShadow(accountShadow, startTime, endTime);

Expand Down Expand Up @@ -3008,7 +3029,8 @@ public void test210AddUserMorganWithAssignment() throws Exception {
assertPasswordMetadata(userMorgan, true, startTime, endTime);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertDummyAccountShadowRepo(accountShadow, accountOid, "morgan");
assertEnableTimestampShadow(accountShadow, startTime, endTime);

Expand Down Expand Up @@ -3078,7 +3100,8 @@ public void test212RenameUserMorgan() throws Exception {
assertFalse("No accountRef oid", StringUtils.isBlank(accountOid));

// Check shadow
PrismObject<ShadowType> accountShadowRepo = repositoryService.getObject(ShadowType.class, accountOid, null, result);
PrismObject<ShadowType> accountShadowRepo = repositoryService.getObject(ShadowType.class, accountOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
display("Shadow repo", accountShadowRepo);
assertDummyAccountShadowRepo(accountShadowRepo, accountOid, "sirhenry");

Expand Down Expand Up @@ -3255,7 +3278,8 @@ public void test300AddUserJackWithAssignmentBlue() throws Exception {
accountJackBlueOid = getSingleLinkOid(userJackAfter);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackBlueOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackBlueOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertAccountShadowRepo(accountShadow, accountJackBlueOid, USER_JACK_USERNAME, getDummyResourceType(RESOURCE_DUMMY_BLUE_NAME));
assertEnableTimestampShadow(accountShadow, startTime, endTime);

Expand Down Expand Up @@ -3322,7 +3346,8 @@ accountJackBlueOid, getDummyResourceController(RESOURCE_DUMMY_BLUE_NAME).getAttr
String accountJackOid = getSingleLinkOid(userJack);

// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid, null, result);
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountJackOid,
SelectorOptions.createCollection(GetOperationOptions.createRaw()), result);
assertAccountShadowRepo(accountShadow, accountJackBlueOid, USER_JACK_USERNAME, getDummyResourceType(RESOURCE_DUMMY_BLUE_NAME));

// Check account
Expand Down

0 comments on commit 46bc44a

Please sign in to comment.