From 73526afc961182becc9d0f14c63298d6ec4b5c8d Mon Sep 17 00:00:00 2001 From: Radovan Semancik Date: Fri, 10 Mar 2017 19:56:40 +0100 Subject: [PATCH] Test cleanup (possible fix for test deadlock) --- ...bstractConfiguredModelIntegrationTest.java | 4 +-- ...stractInitializedModelIntegrationTest.java | 30 ++++--------------- .../midpoint/model/intest/TestActivation.java | 6 ++-- .../intest/TestConnectorMultiInstance.java | 30 +++++-------------- .../model/intest/TestMultiResource.java | 2 +- .../model/intest/TestPreviewChanges.java | 22 ++++++-------- .../model/intest/TestTolerantAttributes.java | 24 +++++++-------- ...my-yellow.xml => resource-dummy-lemon.xml} | 6 ++-- .../test/AbstractModelIntegrationTest.java | 6 ++++ .../model/test/DummyResourceCollection.java | 11 +++++++ .../test/AbstractIntegrationTest.java | 10 +++++++ .../midpoint/test/DummyResourceContoller.java | 12 +++++++- 12 files changed, 82 insertions(+), 81 deletions(-) rename model/model-intest/src/test/resources/preview/{resource-dummy-yellow.xml => resource-dummy-lemon.xml} (98%) diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractConfiguredModelIntegrationTest.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractConfiguredModelIntegrationTest.java index eb9ad5a92fa..d956357bb4e 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractConfiguredModelIntegrationTest.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractConfiguredModelIntegrationTest.java @@ -138,7 +138,7 @@ public class AbstractConfiguredModelIntegrationTest extends AbstractModelIntegra protected static final String RESOURCE_DUMMY_WHITE_NAMESPACE = MidPointConstants.NS_RI; // YELLOW dummy resource is the same as default one but with strong asIs administrativeStatus mapping - protected static final String RESOURCE_DUMMY_YELLOW_FILENAME = COMMON_DIR + "/resource-dummy-yellow.xml"; + protected static final File RESOURCE_DUMMY_YELLOW_FILE = new File(COMMON_DIR, "resource-dummy-yellow.xml"); protected static final String RESOURCE_DUMMY_YELLOW_OID = "10000000-0000-0000-0000-000000000704"; protected static final String RESOURCE_DUMMY_YELLOW_NAME = "yellow"; protected static final String RESOURCE_DUMMY_YELLOW_NAMESPACE = MidPointConstants.NS_RI; @@ -159,7 +159,7 @@ public class AbstractConfiguredModelIntegrationTest extends AbstractModelIntegra protected static final String RESOURCE_DUMMY_EMERALD_NAMESPACE = MidPointConstants.NS_RI; // Black dummy resource for testing tolerant attributes - protected static final String RESOURCE_DUMMY_BLACK_FILENAME = COMMON_DIR + "/resource-dummy-black.xml"; + protected static final File RESOURCE_DUMMY_BLACK_FILE = new File(COMMON_DIR, "resource-dummy-black.xml"); protected static final String RESOURCE_DUMMY_BLACK_OID = "10000000-0000-0000-0000-000000000305"; protected static final String RESOURCE_DUMMY_BLACK_NAME = "black"; protected static final String RESOURCE_DUMMY_BLACK_NAMESPACE = MidPointConstants.NS_RI; diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractInitializedModelIntegrationTest.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractInitializedModelIntegrationTest.java index 3334eaf08eb..cd104a88654 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractInitializedModelIntegrationTest.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractInitializedModelIntegrationTest.java @@ -104,11 +104,6 @@ public class AbstractInitializedModelIntegrationTest extends AbstractConfiguredM protected ResourceType resourceDummyWhiteType; protected PrismObject resourceDummyWhite; - protected DummyResource dummyResourceYellow; - protected DummyResourceContoller dummyResourceCtlYellow; - protected ResourceType resourceDummyYellowType; - protected PrismObject resourceDummyYellow; - protected DummyResource dummyResourceGreen; protected DummyResourceContoller dummyResourceCtlGreen; protected ResourceType resourceDummyGreenType; @@ -119,11 +114,6 @@ public class AbstractInitializedModelIntegrationTest extends AbstractConfiguredM protected ResourceType resourceDummyEmeraldType; protected PrismObject resourceDummyEmerald; - protected DummyResource dummyResourceBlack; - protected DummyResourceContoller dummyResourceCtlBlack; - protected ResourceType resourceDummyBlackType; - protected PrismObject resourceDummyBlack; - protected DummyResource dummyResourceOrange; protected DummyResourceContoller dummyResourceCtlOrange; protected ResourceType resourceDummyOrangeType; @@ -164,6 +154,12 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti dummyResourceCtlRed = initDummyResourcePirate(RESOURCE_DUMMY_RED_NAME, RESOURCE_DUMMY_RED_FILE, RESOURCE_DUMMY_RED_OID, initTask, initResult); + initDummyResourcePirate(RESOURCE_DUMMY_YELLOW_NAME, + RESOURCE_DUMMY_YELLOW_FILE, RESOURCE_DUMMY_YELLOW_OID, initTask, initResult); + + initDummyResourcePirate(RESOURCE_DUMMY_BLACK_NAME, + RESOURCE_DUMMY_BLACK_FILE, RESOURCE_DUMMY_BLACK_OID, initTask, initResult); + dummyResourceCtlBlue = DummyResourceContoller.create(RESOURCE_DUMMY_BLUE_NAME, resourceDummyBlue); dummyResourceCtlBlue.extendSchemaPirate(); dummyResourceBlue = dummyResourceCtlBlue.getDummyResource(); @@ -185,13 +181,6 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti resourceDummyWhiteType = resourceDummyWhite.asObjectable(); dummyResourceCtlWhite.setResource(resourceDummyWhite); - dummyResourceCtlYellow = DummyResourceContoller.create(RESOURCE_DUMMY_YELLOW_NAME, resourceDummyYellow); - dummyResourceCtlYellow.extendSchemaPirate(); - dummyResourceYellow = dummyResourceCtlYellow.getDummyResource(); - resourceDummyYellow = importAndGetObjectFromFile(ResourceType.class, RESOURCE_DUMMY_YELLOW_FILENAME, RESOURCE_DUMMY_YELLOW_OID, initTask, initResult); - resourceDummyYellowType = resourceDummyYellow.asObjectable(); - dummyResourceCtlYellow.setResource(resourceDummyYellow); - dummyResourceCtlGreen = DummyResourceContoller.create(RESOURCE_DUMMY_GREEN_NAME, resourceDummyGreen); dummyResourceCtlGreen.extendSchemaPirate(); dummyResourceGreen = dummyResourceCtlGreen.getDummyResource(); @@ -206,13 +195,6 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti resourceDummyEmerald = importAndGetObjectFromFile(ResourceType.class, getResourceDummyEmeraldFile(), RESOURCE_DUMMY_EMERALD_OID, initTask, initResult); resourceDummyEmeraldType = resourceDummyEmerald.asObjectable(); dummyResourceCtlEmerald.setResource(resourceDummyEmerald); - - dummyResourceCtlBlack = DummyResourceContoller.create(RESOURCE_DUMMY_BLACK_NAME, resourceDummyBlack); - dummyResourceCtlBlack.extendSchemaPirate(); - dummyResourceBlack = dummyResourceCtlBlack.getDummyResource(); - resourceDummyBlack = importAndGetObjectFromFile(ResourceType.class, RESOURCE_DUMMY_BLACK_FILENAME, RESOURCE_DUMMY_BLACK_OID, initTask, initResult); - resourceDummyBlackType = resourceDummyBlack.asObjectable(); - dummyResourceCtlBlack.setResource(resourceDummyBlack); dummyResourceCtlOrange = DummyResourceContoller.create(RESOURCE_DUMMY_ORANGE_NAME, resourceDummyOrange); dummyResourceCtlOrange.extendSchemaPirate(); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestActivation.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestActivation.java index ed2f4110487..adddd7e1f81 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestActivation.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestActivation.java @@ -999,7 +999,8 @@ public void test150ModifyUserJackAssignYellowAccount() throws Exception { // Check shadow PrismObject accountShadowYellow = getShadowModel(accountYellowOid); - assertAccountShadowModel(accountShadowYellow, accountYellowOid, ACCOUNT_JACK_DUMMY_USERNAME, resourceDummyYellowType); + assertAccountShadowModel(accountShadowYellow, accountYellowOid, ACCOUNT_JACK_DUMMY_USERNAME, + getDummyResourceType(RESOURCE_DUMMY_YELLOW_NAME)); assertAdministrativeStatusEnabled(accountShadowYellow); TestUtil.assertCreateTimestamp(accountShadowYellow, start, end); assertEnableTimestampShadow(accountShadowYellow, start, end); @@ -1108,7 +1109,8 @@ private void checkAdminStatusFor15x(PrismObject user, boolean userStat assertDisableReasonShadow(account, SchemaConstants.MODEL_DISABLE_REASON_EXPLICIT); } - assertAccountShadowModel(accountYellow, accountYellowOid, ACCOUNT_JACK_DUMMY_USERNAME, resourceDummyYellowType); + assertAccountShadowModel(accountYellow, accountYellowOid, ACCOUNT_JACK_DUMMY_USERNAME, + getDummyResourceType(RESOURCE_DUMMY_YELLOW_NAME)); assertAdministrativeStatus(accountYellow, accountStatusYellow ? ActivationStatusType.ENABLED : ActivationStatusType.DISABLED); if (!accountStatusYellow) { assertDisableReasonShadow(accountYellow, SchemaConstants.MODEL_DISABLE_REASON_EXPLICIT); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestConnectorMultiInstance.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestConnectorMultiInstance.java index 17d762c5453..74180891324 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestConnectorMultiInstance.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestConnectorMultiInstance.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2016 Evolveum + * Copyright (c) 2010-2017 Evolveum * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,13 +64,6 @@ public class TestConnectorMultiInstance extends AbstractConfiguredModelIntegrati protected DummyResource dummyResourceYellow; protected DummyResourceContoller dummyResourceCtlYellow; - protected ResourceType resourceDummyYellowType; - protected PrismObject resourceDummyYellow; - - protected DummyResource dummyResourceBlack; - protected DummyResourceContoller dummyResourceCtlBlack; - protected ResourceType resourceDummyBlackType; - protected PrismObject resourceDummyBlack; private String accountJackYellowOid; private String initialConnectorStaticVal; @@ -82,19 +75,10 @@ public class TestConnectorMultiInstance extends AbstractConfiguredModelIntegrati public void initSystem(Task initTask, OperationResult initResult) throws Exception { super.initSystem(initTask, initResult); - dummyResourceCtlYellow = DummyResourceContoller.create(RESOURCE_DUMMY_YELLOW_NAME, resourceDummyYellow); - dummyResourceCtlYellow.extendSchemaPirate(); - dummyResourceYellow = dummyResourceCtlYellow.getDummyResource(); - resourceDummyYellow = importAndGetObjectFromFile(ResourceType.class, RESOURCE_DUMMY_YELLOW_FILENAME, RESOURCE_DUMMY_YELLOW_OID, initTask, initResult); - resourceDummyYellowType = resourceDummyYellow.asObjectable(); - dummyResourceCtlYellow.setResource(resourceDummyYellow); + dummyResourceCtlYellow = initDummyResourcePirate(RESOURCE_DUMMY_YELLOW_NAME, RESOURCE_DUMMY_YELLOW_FILE, RESOURCE_DUMMY_YELLOW_OID, initTask, initResult); + dummyResourceYellow = dummyResourceCtlYellow.getDummyResource(); - dummyResourceCtlBlack = DummyResourceContoller.create(RESOURCE_DUMMY_BLACK_NAME, resourceDummyBlack); - dummyResourceCtlBlack.extendSchemaPirate(); - dummyResourceBlack = dummyResourceCtlBlack.getDummyResource(); - resourceDummyBlack = importAndGetObjectFromFile(ResourceType.class, RESOURCE_DUMMY_BLACK_FILENAME, RESOURCE_DUMMY_BLACK_OID, initTask, initResult); - resourceDummyBlackType = resourceDummyBlack.asObjectable(); - dummyResourceCtlBlack.setResource(resourceDummyBlack); + initDummyResourcePirate(RESOURCE_DUMMY_BLACK_NAME, RESOURCE_DUMMY_BLACK_FILE, RESOURCE_DUMMY_BLACK_OID, initTask, initResult); repoAddObjectFromFile(USER_JACK_FILE, true, initResult); repoAddObjectFromFile(USER_GUYBRUSH_FILE, true, initResult); @@ -365,9 +349,9 @@ public void test200GuybrushAssignDummyBlack() throws Exception { assertConnectorInstances("black", RESOURCE_DUMMY_BLACK_OID, 0, 1); assertConnectorInstances("yellow", RESOURCE_DUMMY_YELLOW_OID, 0, 2); - assertConnectorToStringDifferent(shadowBlack, dummyResourceCtlBlack, initialConnectorStaticVal); - assertConnectorToStringDifferent(shadowBlack, dummyResourceCtlBlack, initialConnectorToString); - assertConnectorStaticVal(shadowBlack, dummyResourceCtlBlack, initialConnectorStaticVal); + assertConnectorToStringDifferent(shadowBlack, getDummyResourceController(RESOURCE_DUMMY_BLACK_NAME), initialConnectorStaticVal); + assertConnectorToStringDifferent(shadowBlack, getDummyResourceController(RESOURCE_DUMMY_BLACK_NAME), initialConnectorToString); + assertConnectorStaticVal(shadowBlack, getDummyResourceController(RESOURCE_DUMMY_BLACK_NAME), initialConnectorStaticVal); } diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestMultiResource.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestMultiResource.java index 6cff2b67752..f0364dcf1b0 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestMultiResource.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestMultiResource.java @@ -1523,7 +1523,7 @@ public void test382AddAccountYellow() throws Exception { Task task = taskManager.createTaskInstance(TestRbac.class.getName() + "." + TEST_NAME); OperationResult result = task.getResult(); - ObjectDelta userDelta = createModifyUserAddAccount(USER_JACK_OID, resourceDummyYellow); + ObjectDelta userDelta = createModifyUserAddAccount(USER_JACK_OID, getDummyResourceObject(RESOURCE_DUMMY_YELLOW_NAME)); // WHEN TestUtil.displayWhen(TEST_NAME); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestPreviewChanges.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestPreviewChanges.java index 3e89d6fc1ae..99b35736c7a 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestPreviewChanges.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestPreviewChanges.java @@ -94,10 +94,10 @@ public class TestPreviewChanges extends AbstractInitializedModelIntegrationTest public static final File TEST_DIR = new File("src/test/resources/preview"); // YELLOW dummy resource has a STRICT dependency on default dummy resource - protected static final File RESOURCE_DUMMY_YELLOW_FILE = new File(TEST_DIR, "resource-dummy-yellow.xml"); - protected static final String RESOURCE_DUMMY_YELLOW_OID = "10000000-0000-0000-0000-000000000504"; - protected static final String RESOURCE_DUMMY_YELLOW_NAME = "yellow"; - protected static final String RESOURCE_DUMMY_YELLOW_NAMESPACE = MidPointConstants.NS_RI; + protected static final File RESOURCE_DUMMY_LEMON_FILE = new File(TEST_DIR, "resource-dummy-lemon.xml"); + protected static final String RESOURCE_DUMMY_LEMON_OID = "10000000-0000-0000-0000-000000000504"; + protected static final String RESOURCE_DUMMY_LEMON_NAME = "lemon"; + protected static final String RESOURCE_DUMMY_LEMON_NAMESPACE = MidPointConstants.NS_RI; private static final String USER_MORGAN_OID = "c0c010c0-d34d-b33f-f00d-171171117777"; private static final String USER_BLACKBEARD_OID = "c0c010c0-d34d-b33f-f00d-161161116666"; @@ -110,12 +110,8 @@ public class TestPreviewChanges extends AbstractInitializedModelIntegrationTest public void initSystem(Task initTask, OperationResult initResult) throws Exception { super.initSystem(initTask, initResult); - dummyResourceCtlYellow = DummyResourceContoller.create(RESOURCE_DUMMY_YELLOW_NAME, resourceDummyYellow); - dummyResourceCtlYellow.extendSchemaPirate(); - dummyResourceYellow = dummyResourceCtlYellow.getDummyResource(); - resourceDummyYellow = importAndGetObjectFromFile(ResourceType.class, RESOURCE_DUMMY_YELLOW_FILE, RESOURCE_DUMMY_YELLOW_OID, initTask, initResult); - resourceDummyYellowType = resourceDummyYellow.asObjectable(); - dummyResourceCtlYellow.setResource(resourceDummyYellow); + initDummyResourcePirate(RESOURCE_DUMMY_LEMON_NAME, + RESOURCE_DUMMY_LEMON_FILE, RESOURCE_DUMMY_LEMON_OID, initTask, initResult); } @Test @@ -1347,16 +1343,16 @@ public void test630AddUserRogers() throws Exception { // administrativeStatus (ENABLED), enableTimestamp, ship (from organizationalUnit), name, gossip, water, iteration, iterationToken, password/value PrismAsserts.assertModifications(accountSecondaryDelta, 9); PrismAsserts.assertPropertyReplace(accountSecondaryDelta, - getAttributePath(resourceDummyYellow, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_SHIP_NAME), + getAttributePath(getDummyResourceObject(RESOURCE_DUMMY_LEMON_NAME), DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_SHIP_NAME), "The crew of The Sea Monkey"); PrismAsserts.assertPropertyReplace(accountSecondaryDelta, new ItemPath(ShadowType.F_ATTRIBUTES, SchemaConstants.ICFS_NAME), "rogers"); PrismAsserts.assertPropertyAdd(accountSecondaryDelta, - getAttributePath(resourceDummyYellow, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME), + getAttributePath(getDummyResourceObject(RESOURCE_DUMMY_LEMON_NAME), DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME), "Rum Rogers Sr. must be the best pirate the has ever seen"); PrismAsserts.assertPropertyReplace(accountSecondaryDelta, - getAttributePath(resourceDummyYellow, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_WATER_NAME), + getAttributePath(getDummyResourceObject(RESOURCE_DUMMY_LEMON_NAME), DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_WATER_NAME), "pirate Rum Rogers Sr. drinks only rum!"); } diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestTolerantAttributes.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestTolerantAttributes.java index 9727701c2b5..f0de51fe68c 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestTolerantAttributes.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestTolerantAttributes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2016 Evolveum + * Copyright (c) 2010-2017 Evolveum * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -112,12 +112,12 @@ public void test100ModifyUserAddAccount() throws Exception { // Check shadow PrismObject accountShadow = repositoryService.getObject(ShadowType.class, accountOid, null, result); - assertAccountShadowRepo(accountShadow, accountOid, "jack", resourceDummyBlackType); + assertAccountShadowRepo(accountShadow, accountOid, "jack", getDummyResourceType(RESOURCE_DUMMY_BLACK_NAME)); assertEnableTimestampShadow(accountShadow, startTime, endTime); // Check account PrismObject accountModel = modelService.getObject(ShadowType.class, accountOid, null, task, result); - assertAccountShadowModel(accountModel, accountOid, "jack", resourceDummyBlackType); + assertAccountShadowModel(accountModel, accountOid, "jack", getDummyResourceType(RESOURCE_DUMMY_BLACK_NAME)); accountDefinition = accountModel.getDefinition(); @@ -159,11 +159,11 @@ public void test101modifyAddAttributesIntolerantPattern() throws Exception{ // Check shadow PrismObject accountShadow = repositoryService.getObject(ShadowType.class, accountOid, null, result); - assertAccountShadowRepo(accountShadow, accountOid, "jack", resourceDummyBlackType); + assertAccountShadowRepo(accountShadow, accountOid, "jack", getDummyResourceType(RESOURCE_DUMMY_BLACK_NAME)); // Check account PrismObject accountModel = modelService.getObject(ShadowType.class, accountOid, null, task, result); - assertAccountShadowModel(accountModel, accountOid, "jack", resourceDummyBlackType); + assertAccountShadowModel(accountModel, accountOid, "jack", getDummyResourceType(RESOURCE_DUMMY_BLACK_NAME)); // Check account in dummy resource assertAccount(userJack, RESOURCE_DUMMY_BLACK_OID); @@ -207,11 +207,11 @@ public void test102modifyAddAttributeTolerantPattern() throws Exception{ // Check shadow PrismObject accountShadow = repositoryService.getObject(ShadowType.class, accountOid, null, result); - assertAccountShadowRepo(accountShadow, accountOid, "jack", resourceDummyBlackType); + assertAccountShadowRepo(accountShadow, accountOid, "jack", getDummyResourceType(RESOURCE_DUMMY_BLACK_NAME)); // Check account PrismObject accountModel = modelService.getObject(ShadowType.class, accountOid, null, task, result); - assertAccountShadowModel(accountModel, accountOid, "jack", resourceDummyBlackType); + assertAccountShadowModel(accountModel, accountOid, "jack", getDummyResourceType(RESOURCE_DUMMY_BLACK_NAME)); // Check account in dummy resource assertAccount(userJack, RESOURCE_DUMMY_BLACK_OID); @@ -255,11 +255,11 @@ public void test103modifyReplaceAttributeIntolerant() throws Exception{ // Check shadow PrismObject accountShadow = repositoryService.getObject(ShadowType.class, accountOid, null, result); - assertAccountShadowRepo(accountShadow, accountOid, "jack", resourceDummyBlackType); + assertAccountShadowRepo(accountShadow, accountOid, "jack", getDummyResourceType(RESOURCE_DUMMY_BLACK_NAME)); // Check account PrismObject accountModel = modelService.getObject(ShadowType.class, accountOid, null, task, result); - assertAccountShadowModel(accountModel, accountOid, "jack", resourceDummyBlackType); + assertAccountShadowModel(accountModel, accountOid, "jack", getDummyResourceType(RESOURCE_DUMMY_BLACK_NAME)); // Check account in dummy resource assertAccount(userJack, RESOURCE_DUMMY_BLACK_OID); @@ -279,7 +279,7 @@ public void test104modifyReplaceAttributeTolerantPattern() throws Exception{ assumeAssignmentPolicy(AssignmentPolicyEnforcementType.POSITIVE); ObjectDelta userDelta = ObjectDelta.createEmptyModifyDelta(UserType.class, USER_JACK_OID, prismContext); - ItemPath drinkItemPath = new ItemPath(new QName(resourceDummyBlackType.getNamespace(), "drink")); + ItemPath drinkItemPath = new ItemPath(new QName(getDummyResourceType(RESOURCE_DUMMY_BLACK_NAME).getNamespace(), "drink")); PropertyDelta propertyDelta = PropertyDelta.createModificationReplaceProperty(new ItemPath(UserType.F_EMPLOYEE_NUMBER), getUserDefinition(), "thiIsOk"); userDelta.addModification(propertyDelta); Collection> deltas = (Collection)MiscUtil.createCollection(userDelta); @@ -303,11 +303,11 @@ public void test104modifyReplaceAttributeTolerantPattern() throws Exception{ // Check shadow PrismObject accountShadow = repositoryService.getObject(ShadowType.class, accountOid, null, result); - assertAccountShadowRepo(accountShadow, accountOid, "jack", resourceDummyBlackType); + assertAccountShadowRepo(accountShadow, accountOid, "jack", getDummyResourceType(RESOURCE_DUMMY_BLACK_NAME)); // Check account PrismObject accountModel = modelService.getObject(ShadowType.class, accountOid, null, task, result); - assertAccountShadowModel(accountModel, accountOid, "jack", resourceDummyBlackType); + assertAccountShadowModel(accountModel, accountOid, "jack", getDummyResourceType(RESOURCE_DUMMY_BLACK_NAME)); // Check account in dummy resource assertAccount(userJack, RESOURCE_DUMMY_BLACK_OID); diff --git a/model/model-intest/src/test/resources/preview/resource-dummy-yellow.xml b/model/model-intest/src/test/resources/preview/resource-dummy-lemon.xml similarity index 98% rename from model/model-intest/src/test/resources/preview/resource-dummy-yellow.xml rename to model/model-intest/src/test/resources/preview/resource-dummy-lemon.xml index c9f78b242f5..162b330e414 100644 --- a/model/model-intest/src/test/resources/preview/resource-dummy-yellow.xml +++ b/model/model-intest/src/test/resources/preview/resource-dummy-lemon.xml @@ -1,6 +1,6 @@