From 671c4269bc01f0162d64d3ba0d77033b1a0906a1 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Tue, 2 Jun 2020 02:03:27 +0200 Subject: [PATCH 1/2] Optimize findLinkedTargets and improve tests Object type is checked before actual object fetching. HW tokens test scenario was added to TestLinkedObjects. Also, resources for TestLinkedObjects were sorted out into separate "per-scenario" directories. Object templates were removed. "Order 2" inducements were reduced. A part of MID-6109 implementation. --- .../xml/ns/public/common/common-policy-3.xsd | 4 +- .../impl/expr/LinkedObjectsFunctions.java | 36 +- .../model/intest/TestLinkedObjects.java | 375 +++++++++++++----- .../test/resources/linked/archetype-user.xml | 43 -- .../linked/gummi/archetype-device.xml | 82 ++++ .../archetype-gummi-user.xml} | 106 +++-- .../archetype-magic-token.xml} | 47 +-- .../linked/{ => gummi}/service-axe.xml | 0 .../linked/{ => gummi}/service-medallion.xml | 0 .../linked/{ => gummi}/service-sword.xml | 0 .../linked/{ => gummi}/service-whistle.xml | 0 .../linked/{ => gummi}/user-cavin.xml | 0 .../linked/{ => gummi}/user-cubby.xml | 0 .../linked/{ => gummi}/user-grammi.xml | 0 .../linked/{ => gummi}/user-gruffy.xml | 3 + .../linked/{ => gummi}/user-zummi.xml | 0 .../linked/hw-tokens/archetype-hw-token.xml | 109 +++++ .../linked/hw-tokens/resource-hw-tokens.xml | 130 ++++++ .../resources/linked/hw-tokens/token-blue.xml | 13 + .../linked/hw-tokens/token-green.xml | 13 + .../resources/linked/hw-tokens/token-red.xml | 16 + .../resources/linked/hw-tokens/user-niels.xml | 13 + .../resources/linked/hw-tokens/user-paul.xml | 13 + .../linked/hw-tokens/user-werner.xml | 16 + .../archetype-project-groups.xml | 0 .../archetype-project-users.xml | 0 .../{ => projects}/archetype-project.xml | 7 +- .../resources/linked/system-configuration.xml | 40 +- .../test/resources/linked/template-device.xml | 29 -- .../test/resources/linked/template-user.xml | 31 -- .../member-recompute/archetype-department.xml | 3 +- 31 files changed, 797 insertions(+), 332 deletions(-) delete mode 100644 model/model-intest/src/test/resources/linked/archetype-user.xml create mode 100644 model/model-intest/src/test/resources/linked/gummi/archetype-device.xml rename model/model-intest/src/test/resources/linked/{archetype-device.xml => gummi/archetype-gummi-user.xml} (51%) rename model/model-intest/src/test/resources/linked/{archetype-token.xml => gummi/archetype-magic-token.xml} (74%) rename model/model-intest/src/test/resources/linked/{ => gummi}/service-axe.xml (100%) rename model/model-intest/src/test/resources/linked/{ => gummi}/service-medallion.xml (100%) rename model/model-intest/src/test/resources/linked/{ => gummi}/service-sword.xml (100%) rename model/model-intest/src/test/resources/linked/{ => gummi}/service-whistle.xml (100%) rename model/model-intest/src/test/resources/linked/{ => gummi}/user-cavin.xml (100%) rename model/model-intest/src/test/resources/linked/{ => gummi}/user-cubby.xml (100%) rename model/model-intest/src/test/resources/linked/{ => gummi}/user-grammi.xml (100%) rename model/model-intest/src/test/resources/linked/{ => gummi}/user-gruffy.xml (84%) rename model/model-intest/src/test/resources/linked/{ => gummi}/user-zummi.xml (100%) create mode 100644 model/model-intest/src/test/resources/linked/hw-tokens/archetype-hw-token.xml create mode 100644 model/model-intest/src/test/resources/linked/hw-tokens/resource-hw-tokens.xml create mode 100644 model/model-intest/src/test/resources/linked/hw-tokens/token-blue.xml create mode 100644 model/model-intest/src/test/resources/linked/hw-tokens/token-green.xml create mode 100644 model/model-intest/src/test/resources/linked/hw-tokens/token-red.xml create mode 100644 model/model-intest/src/test/resources/linked/hw-tokens/user-niels.xml create mode 100644 model/model-intest/src/test/resources/linked/hw-tokens/user-paul.xml create mode 100644 model/model-intest/src/test/resources/linked/hw-tokens/user-werner.xml rename model/model-intest/src/test/resources/linked/{ => projects}/archetype-project-groups.xml (100%) rename model/model-intest/src/test/resources/linked/{ => projects}/archetype-project-users.xml (100%) rename model/model-intest/src/test/resources/linked/{ => projects}/archetype-project.xml (95%) delete mode 100644 model/model-intest/src/test/resources/linked/template-device.xml delete mode 100644 model/model-intest/src/test/resources/linked/template-user.xml diff --git a/infra/schema/src/main/resources/xml/ns/public/common/common-policy-3.xsd b/infra/schema/src/main/resources/xml/ns/public/common/common-policy-3.xsd index 028560b14e9..70583eeef3d 100644 --- a/infra/schema/src/main/resources/xml/ns/public/common/common-policy-3.xsd +++ b/infra/schema/src/main/resources/xml/ns/public/common/common-policy-3.xsd @@ -2890,7 +2890,7 @@ - Task customizer: an expression that takes a task and customizes its content. + An expression that takes a task and customizes its content. Input variable: preparedTask (of TaskType). Output: TaskType that should be used. (It is possible to modify preparedTask and return it.) @@ -2922,7 +2922,7 @@ - Uses iterative scripting handler. This is the default. + Uses iterative scripting handler, i.e. object query with a script that processes every object found. This is the default. diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/expr/LinkedObjectsFunctions.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/expr/LinkedObjectsFunctions.java index 4a5949a04fb..449f4422ec2 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/expr/LinkedObjectsFunctions.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/expr/LinkedObjectsFunctions.java @@ -13,10 +13,8 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; +import java.util.Objects; import java.util.stream.Collectors; import com.evolveum.midpoint.model.common.LinkManager; @@ -136,7 +134,7 @@ List findLinkedTargets(Class type, String ConfigurationException, ExpressionEvaluationException { Set membership = getMembership(); List assignedWithMemberRelation = membership.stream() - .filter(ref -> relationRegistry.isMember(ref.getRelation())) + .filter(ref -> relationRegistry.isMember(ref.getRelation()) && objectTypeMatches(ref, type)) .collect(Collectors.toList()); // TODO deduplicate w.r.t. member/manager // TODO optimize matching @@ -158,7 +156,6 @@ List findLinkedTargets(Class type, String List findLinkedTargets(String linkTypeName) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException { - Task currentTask = midpointFunctions.getCurrentTask(); OperationResult currentResult = midpointFunctions.getCurrentResult(); LensFocusContext focusContext = (LensFocusContext) midpointFunctions.getFocusContext(); if (focusContext == null) { @@ -169,9 +166,11 @@ List findLinkedTargets(String linkTypeName) throw new IllegalStateException("No definition for target link type " + linkTypeName + " for " + focusContext); } + Class expectedClasses = getExpectedClass(definition.getSelector()); + Set membership = getMembership(); List assignedWithMatchingRelation = membership.stream() - .filter(ref -> relationMatches(ref, definition.getSelector())) + .filter(ref -> relationMatches(ref, definition.getSelector()) && objectTypeMatches(ref, expectedClasses)) .collect(Collectors.toList()); // TODO deduplicate w.r.t. member/manager // TODO optimize matching @@ -187,6 +186,14 @@ List findLinkedTargets(String linkTypeName) return objects; } + private Class getExpectedClass(LinkedObjectSelectorType selector) { + if (selector == null || selector.getType() == null) { + return null; + } else { + return prismContext.getSchemaRegistry().determineClassForTypeRequired(selector.getType()); + } + } + @NotNull private Set getMembership() { if (Boolean.FALSE.equals(midpointFunctions.isEvaluateNew())) { @@ -221,6 +228,17 @@ private Set getMembershipOld() { } } + private boolean objectTypeMatches(PrismReferenceValue ref, Class expectedClass) { + if (expectedClass == null) { + return true; + } else { + Class refTargetClass = prismContext.getSchemaRegistry().determineClassForTypeRequired( + Objects.requireNonNull( + ref.getTargetType(), "no target type")); + return expectedClass.isAssignableFrom(refTargetClass); + } + } + private boolean relationMatches(PrismReferenceValue ref, LinkedObjectSelectorType selector) { return selector == null || selector.getRelation().isEmpty() || @@ -228,11 +246,11 @@ private boolean relationMatches(PrismReferenceValue ref, LinkedObjectSelectorTyp } private boolean objectMatches(AssignmentHolderType targetObject, Class type, String archetypeOid) { - return type.isAssignableFrom(targetObject.getClass()) + return (type == null || type.isAssignableFrom(targetObject.getClass())) && (archetypeOid == null || hasArchetype(targetObject, archetypeOid)); } - private boolean objectMatches(AssignmentHolderType targetObject, ObjectSelectorType selector) + private boolean objectMatches(AssignmentHolderType targetObject, ObjectSelectorType selector) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException { return selector == null || diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestLinkedObjects.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestLinkedObjects.java index a1b7468bf54..a9e6c96fb12 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestLinkedObjects.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestLinkedObjects.java @@ -7,21 +7,32 @@ package com.evolveum.midpoint.model.intest; import java.io.File; +import java.io.FileNotFoundException; +import java.net.ConnectException; + +import com.evolveum.icf.dummy.resource.ConflictException; +import com.evolveum.icf.dummy.resource.DummyGroup; +import com.evolveum.icf.dummy.resource.SchemaViolationException; +import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.prism.delta.ObjectDelta; +import com.evolveum.midpoint.prism.polystring.PolyString; +import com.evolveum.midpoint.schema.constants.SchemaConstants; +import com.evolveum.midpoint.test.DummyTestResource; + +import com.evolveum.midpoint.test.PredefinedTestMethodTracing; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.annotation.DirtiesContext.ClassMode; import org.springframework.test.context.ContextConfiguration; import org.testng.annotations.Test; -import com.evolveum.midpoint.prism.PrismObject; -import com.evolveum.midpoint.prism.delta.ObjectDelta; -import com.evolveum.midpoint.prism.polystring.PolyString; -import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.test.TestResource; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; +import static org.assertj.core.api.Assertions.assertThat; + /** * Various tests related to navigation the links between objects. * See also https://wiki.evolveum.com/display/midPoint/Linked+objects. @@ -31,38 +42,74 @@ public class TestLinkedObjects extends AbstractEmptyModelIntegrationTest { public static final File TEST_DIR = new File("src/test/resources/linked"); + private static final File HW_TOKENS_DIR = new File("src/test/resources/linked/hw-tokens"); + private static final File GUMMI_DIR = new File("src/test/resources/linked/gummi"); + private static final File PROJECTS_DIR = new File("src/test/resources/linked/projects"); private static final File SYSTEM_CONFIGURATION_FILE = new File(TEST_DIR, "system-configuration.xml"); - private static final TestResource TEMPLATE_USER = new TestResource<>(TEST_DIR, "template-user.xml", "241afdcc-26eb-4417-a4df-a8c1add06e84"); - private static final TestResource TEMPLATE_DEVICE = new TestResource<>(TEST_DIR, "template-device.xml", "e0d5d585-da74-4523-b4f5-78cb54c0dccd"); + //region Objects for HW tokens scenario + private static final String ATTR_OWNER_NAME = "ownerName"; + private static final String ATTR_OWNER_EMAIL_ADDRESS = "ownerEmailAddress"; + + private static final TestResource ARCHETYPE_HW_TOKEN = new TestResource<>(HW_TOKENS_DIR, "archetype-hw-token.xml", "21575364-d869-4b96-ac3f-b7b26e0e8540"); + private static final DummyTestResource RESOURCE_HW_TOKENS = new DummyTestResource(HW_TOKENS_DIR, "resource-hw-tokens.xml", "2730a64c-73fc-4c67-8bac-e40b4437931c", "hw-tokens", + controller -> { + controller.addAttrDef(controller.getDummyResource().getGroupObjectClass(), + ATTR_OWNER_NAME, String.class, false, false); + controller.addAttrDef(controller.getDummyResource().getGroupObjectClass(), + ATTR_OWNER_EMAIL_ADDRESS, String.class, false, false); + }); + + private static final TestResource TOKEN_BLUE = new TestResource<>(HW_TOKENS_DIR, "token-blue.xml", "0e5b7304-ea5c-438e-84d1-2b0ce40517ce"); + private static final TestResource TOKEN_GREEN = new TestResource<>(HW_TOKENS_DIR, "token-green.xml", "36c01826-c425-4da0-9e1e-023d807e1284"); + private static final TestResource TOKEN_RED = new TestResource<>(HW_TOKENS_DIR, "token-red.xml", "a449ad16-d13f-4a4d-99d4-2dd29ab18e65"); + + private static final TestResource USER_NIELS = new TestResource<>(HW_TOKENS_DIR, "user-niels.xml", "139b2203-9675-422f-b5da-85001641c730"); + private static final TestResource USER_PAUL = new TestResource<>(HW_TOKENS_DIR, "user-paul.xml", "8dff246b-82f3-47b2-ad58-42d962c46c2c"); + private static final TestResource USER_WERNER = new TestResource<>(HW_TOKENS_DIR, "user-werner.xml", "98f31568-5a4d-413d-beed-394b90530033"); + //endregion + + //region Gummi scenario (devices and magic tokens) + private static final TestResource ARCHETYPE_USER = new TestResource<>(GUMMI_DIR, "archetype-gummi-user.xml", "c46b1bcc-af43-44ee-a107-71f36e952cc5"); + private static final TestResource ARCHETYPE_TOKEN = new TestResource<>(GUMMI_DIR, "archetype-magic-token.xml", "e7bff8d1-cebd-4fbe-b935-64cfc2f22f52"); + private static final TestResource ARCHETYPE_DEVICE = new TestResource<>(GUMMI_DIR, "archetype-device.xml", "d6d90e2c-ad25-4f7f-a0e1-2f5fac03b402"); + + private static final TestResource SERVICE_MEDALLION = new TestResource<>(GUMMI_DIR, "service-medallion.xml", "8734f795-f6b4-4cc5-843b-6307aaf88f9d"); + private static final TestResource SERVICE_WHISTLE = new TestResource<>(GUMMI_DIR, "service-whistle.xml", "40c18026-ca88-4bda-ab0b-f1a2a9c94818"); + private static final TestResource SERVICE_SWORD = new TestResource<>(GUMMI_DIR, "service-sword.xml", "c64ee819-6dcd-4ad2-a91a-303fb0aed29e"); + private static final TestResource SERVICE_AXE = new TestResource<>(GUMMI_DIR, "service-axe.xml", "90a3a6a0-07ea-4b2d-b800-ccdf4e7dea78"); + + private static final TestResource USER_CAVIN = new TestResource<>(GUMMI_DIR, "user-cavin.xml", "04753be2-f0f1-4292-8f24-48b0eedfcce3"); + private static final TestResource USER_ZUMMI = new TestResource<>(GUMMI_DIR, "user-zummi.xml", "3224fccd-27fa-45b5-8cf3-497a0d2dd892"); + private static final TestResource USER_GRUFFY = new TestResource<>(GUMMI_DIR, "user-gruffy.xml", "30b59b40-2875-410d-8731-482743eb6de2"); + private static final TestResource USER_GRAMMI = new TestResource<>(GUMMI_DIR, "user-grammi.xml", "041d0c03-c322-4e0d-89ba-a2d49b732674"); + private static final TestResource USER_CUBBY = new TestResource<>(GUMMI_DIR, "user-cubby.xml", "7b8f2e00-a49e-40ff-a4bd-11b70bac89d3"); + //endregion + + // region Projects scenario + private static final TestResource ARCHETYPE_PROJECT = new TestResource<>(PROJECTS_DIR, "archetype-project.xml", "4d3280a1-6514-4984-ac2c-7e56c05af258"); + private static final TestResource ARCHETYPE_PROJECT_USERS = new TestResource<>(PROJECTS_DIR, "archetype-project-users.xml", "3af67ba4-183f-45e7-887e-4ae5ddff4cdf"); + private static final TestResource ARCHETYPE_PROJECT_GROUPS = new TestResource<>(PROJECTS_DIR, "archetype-project-groups.xml", "a85bddc9-4ff0-475f-8ccc-17f9038d4ce1"); + // endregion - private static final TestResource ARCHETYPE_USER = new TestResource<>(TEST_DIR, "archetype-user.xml", "c46b1bcc-af43-44ee-a107-71f36e952cc5"); - private static final TestResource ARCHETYPE_TOKEN = new TestResource<>(TEST_DIR, "archetype-token.xml", "e7bff8d1-cebd-4fbe-b935-64cfc2f22f52"); - private static final TestResource ARCHETYPE_DEVICE = new TestResource<>(TEST_DIR, "archetype-device.xml", "d6d90e2c-ad25-4f7f-a0e1-2f5fac03b402"); + @Override + public void initSystem(Task initTask, OperationResult initResult) throws Exception { + super.initSystem(initTask, initResult); - private static final TestResource SERVICE_MEDALLION = new TestResource<>(TEST_DIR, "service-medallion.xml", "8734f795-f6b4-4cc5-843b-6307aaf88f9d"); - private static final TestResource SERVICE_WHISTLE = new TestResource<>(TEST_DIR, "service-whistle.xml", "40c18026-ca88-4bda-ab0b-f1a2a9c94818"); - private static final TestResource SERVICE_SWORD = new TestResource<>(TEST_DIR, "service-sword.xml", "c64ee819-6dcd-4ad2-a91a-303fb0aed29e"); - private static final TestResource SERVICE_AXE = new TestResource<>(TEST_DIR, "service-axe.xml", "90a3a6a0-07ea-4b2d-b800-ccdf4e7dea78"); + // Initialization for HW tokens scenario - private static final TestResource USER_CAVIN = new TestResource<>(TEST_DIR, "user-cavin.xml", "04753be2-f0f1-4292-8f24-48b0eedfcce3"); - private static final TestResource USER_ZUMMI = new TestResource<>(TEST_DIR, "user-zummi.xml", "3224fccd-27fa-45b5-8cf3-497a0d2dd892"); - private static final TestResource USER_GRUFFY = new TestResource<>(TEST_DIR, "user-gruffy.xml", "30b59b40-2875-410d-8731-482743eb6de2"); - private static final TestResource USER_GRAMMI = new TestResource<>(TEST_DIR, "user-grammi.xml", "041d0c03-c322-4e0d-89ba-a2d49b732674"); - private static final TestResource USER_CUBBY = new TestResource<>(TEST_DIR, "user-cubby.xml", "7b8f2e00-a49e-40ff-a4bd-11b70bac89d3"); + addObject(ARCHETYPE_HW_TOKEN, initTask, initResult); + initDummyResource(RESOURCE_HW_TOKENS, initTask, initResult); - // Separate scenario (projects and sub-orgs) - private static final TestResource ARCHETYPE_PROJECT = new TestResource<>(TEST_DIR, "archetype-project.xml", "4d3280a1-6514-4984-ac2c-7e56c05af258"); - private static final TestResource ARCHETYPE_PROJECT_USERS = new TestResource<>(TEST_DIR, "archetype-project-users.xml", "3af67ba4-183f-45e7-887e-4ae5ddff4cdf"); - private static final TestResource ARCHETYPE_PROJECT_GROUPS = new TestResource<>(TEST_DIR, "archetype-project-groups.xml", "a85bddc9-4ff0-475f-8ccc-17f9038d4ce1"); + addObject(TOKEN_BLUE, initTask, initResult); + addObject(TOKEN_GREEN, initTask, initResult); + addObject(TOKEN_RED, initTask, initResult); - @Override - public void initSystem(Task initTask, OperationResult initResult) throws Exception { - super.initSystem(initTask, initResult); + addObject(USER_NIELS, initTask, initResult); + addObject(USER_PAUL, initTask, initResult); - addObject(TEMPLATE_USER, initTask, initResult); - addObject(TEMPLATE_DEVICE, initTask, initResult); + // Initialization for Gummi scenario addObject(ARCHETYPE_USER, initTask, initResult); addObject(ARCHETYPE_TOKEN, initTask, initResult); @@ -79,6 +126,8 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti addObject(USER_GRAMMI, initTask, initResult); addObject(USER_CUBBY, initTask, initResult); + // Initialization for Projects scenario + addObject(ARCHETYPE_PROJECT, initTask, initResult); addObject(ARCHETYPE_PROJECT_USERS, initTask, initResult); addObject(ARCHETYPE_PROJECT_GROUPS, initTask, initResult); @@ -92,7 +141,45 @@ protected File getSystemConfigurationFile() { } @Test - public void test000Sanity() throws Exception { + public void test000SanityForHwTokens() throws Exception { + Task task = getTestTask(); + OperationResult result = task.getResult(); + + assertService(TOKEN_BLUE.oid, "after init") + .display() + .assertLinks(1) + .getObjectable(); + refresh(TOKEN_BLUE, task, result); + assertHwToken(TOKEN_BLUE, "blue", null, null); + + assertService(TOKEN_GREEN.oid, "after init") + .display() + .assertLinks(1); + refresh(TOKEN_GREEN, task, result); + assertHwToken(TOKEN_GREEN, "green", null, null); + + assertService(TOKEN_RED.oid, "after init") + .display() + .assertAdministrativeStatus(ActivationStatusType.DISABLED) + .assertLinks(1); + refresh(TOKEN_RED, task, result); + assertHwToken(TOKEN_RED, "red", null, null); + } + + private void assertHwToken(TestResource token, String desc, String expectedOwnerName, String expectedOwnerEmailAddress) + throws ConnectException, FileNotFoundException, SchemaViolationException, ConflictException, InterruptedException { + DummyGroup dummyGroup = RESOURCE_HW_TOKENS.controller.getDummyResource().getGroupByName(token.getObjectable().getName().getOrig()); + displayDumpable("hw token dummy group", dummyGroup); + assertThat(dummyGroup).as(desc + " group").isNotNull(); + assertThat(dummyGroup.getAttributeValue(ATTR_OWNER_NAME)).as(desc + " owner name").isEqualTo(expectedOwnerName); + assertThat(dummyGroup.getAttributeValue(ATTR_OWNER_EMAIL_ADDRESS)).as(desc + " owner email").isEqualTo(expectedOwnerEmailAddress); + } + + @Test + public void test000SanityForGummi() throws Exception { + Task task = getTestTask(); + OperationResult result = task.getResult(); + assertUser(USER_CAVIN.oid, "after init") .assertOrganizationalUnits() .display(); @@ -110,12 +197,153 @@ public void test000Sanity() throws Exception { .display(); } + /** + * Let's give blue HW token to Niels Bohr. + */ + @Test + public void test100GiveBlueTokenToNiels() throws Exception { + given(); + Task task = getTestTask(); + OperationResult result = task.getResult(); + + when(); + assign(USER_NIELS, TOKEN_BLUE, SchemaConstants.ORG_DEFAULT, null, task, result); + + then(); + assertSuccess(result); + + assertHwToken(TOKEN_BLUE, "blue", "niels", "niels.bohr@mail.net"); + } + + /** + * Let's take blue HW token from Niels Bohr and give him to Paul Dirac. + */ + @Test + public void test110GiveBlueTokenToPaul() throws Exception { + given(); + Task task = getTestTask(); + OperationResult result = task.getResult(); + + when(); + refresh(USER_NIELS, task, result); + unassignIfSingle(USER_NIELS, TOKEN_BLUE, SchemaConstants.ORG_DEFAULT, null, task, result); + + assertHwToken(TOKEN_BLUE, "blue", null, null); + + assign(USER_PAUL, TOKEN_BLUE, SchemaConstants.ORG_DEFAULT, null, task, result); + + then(); + assertSuccess(result); + + assertHwToken(TOKEN_BLUE, "blue", "paul", "pdi@m.org"); + } + + /** + * Let's give red HW token (disabled) to Paul Dirac. + */ + @Test + public void test120GiveRedTokenToPaul() throws Exception { + given(); + Task task = getTestTask(); + OperationResult result = task.getResult(); + + when(); + assign(USER_PAUL, TOKEN_RED, SchemaConstants.ORG_DEFAULT, null, task, result); + + then(); + assertSuccess(result); + + assertHwToken(TOKEN_BLUE, "blue", "paul", "pdi@m.org"); + assertHwToken(TOKEN_RED, "red", "paul", "pdi@m.org"); + } + /** + * Move Paul's mailbox. Both blue (enabled) and red (disabled) tokens should be updated. + */ + @Test + public void test130MovePaulMailbox() throws Exception { + given(); + Task task = getTestTask(); + OperationResult result = task.getResult(); + + when(); + ObjectDelta delta = deltaFor(UserType.class) + .item(UserType.F_EMAIL_ADDRESS).replace("paul.dirac@mail.net") + .asObjectDelta(USER_PAUL.oid); + executeChanges(delta, null, task, result); + + then(); + assertSuccess(result); + + assertHwToken(TOKEN_BLUE, "blue", "paul", "paul.dirac@mail.net"); + assertHwToken(TOKEN_RED, "red", "paul", "paul.dirac@mail.net"); + } + + /** + * Let's give red token (disabled) from Dirac to Bohr. + */ + @Test + public void test140GiveRedTokenToNiels() throws Exception { + given(); + Task task = getTestTask(); + OperationResult result = task.getResult(); + + when(); + refresh(USER_PAUL, task, result); + unassignIfSingle(USER_PAUL, TOKEN_RED, SchemaConstants.ORG_DEFAULT, null, task, result); + + assertHwToken(TOKEN_RED, "red", null, null); + + assign(USER_NIELS, TOKEN_RED, SchemaConstants.ORG_DEFAULT, null, task, result); + + then(); + assertSuccess(result); + + assertHwToken(TOKEN_BLUE, "blue", "paul", "paul.dirac@mail.net"); + assertHwToken(TOKEN_RED, "red", "niels", "niels.bohr@mail.net"); + } + + /** + * Now for something more harsh: let's create Werner with the token already assigned. + */ + @Test + public void test150CreateWernerWithGreenToken() throws Exception { + given(); + Task task = getTestTask(); + OperationResult result = task.getResult(); + + when(); + addObject(USER_WERNER, task, result); + + then(); + assertSuccess(result); + + assertHwToken(TOKEN_GREEN, "green", "werner", "anything@somewhere.maybe"); + } + + /** + * And the final twist: Werner Heisenberg disappears with green token being assigned. + */ + @Test + public void test160DeleteWernerWithGreenToken() throws Exception { + given(); + Task task = getTestTask(); + OperationResult result = task.getResult(); + + when(); + deleteObject(UserType.class, USER_WERNER.oid, task, result); + + then(); + assertSuccess(result); + + assertHwToken(TOKEN_GREEN, "green", null, null); + } + /** * Cavin's grandfather gives medallion to him. * We should observe correct data on both the medallion and its holder. */ @Test - public void test100GiveMedallionToCavin() throws Exception { + public void test200GiveMedallionToCavin() throws Exception { given(); Task task = getTestTask(); OperationResult result = task.getResult(); @@ -138,7 +366,7 @@ public void test100GiveMedallionToCavin() throws Exception { * We should observe update on the medallion. */ @Test - public void test110EntitleCavin() throws Exception { + public void test210EntitleCavin() throws Exception { given(); Task task = getTestTask(); OperationResult result = task.getResult(); @@ -165,7 +393,7 @@ public void test110EntitleCavin() throws Exception { * Phase one is that it is unassigned from Cavin. */ @Test - public void test120PassMedallionToZummiPhaseOne() throws Exception { + public void test220PassMedallionToZummiPhaseOne() throws Exception { given(); Task task = getTestTask(); OperationResult result = task.getResult(); @@ -190,7 +418,7 @@ public void test120PassMedallionToZummiPhaseOne() throws Exception { * Phase two is that it is assigned to Zummi. */ @Test - public void test130PassMedallionToZummiPhaseTwo() throws Exception { + public void test230PassMedallionToZummiPhaseTwo() throws Exception { given(); Task task = getTestTask(); OperationResult result = task.getResult(); @@ -212,7 +440,7 @@ public void test130PassMedallionToZummiPhaseTwo() throws Exception { * Medallion is renamed. So its holder should be updated. */ @Test - public void test140RenameMedallion() throws Exception { + public void test240RenameMedallion() throws Exception { given(); Task task = getTestTask(); OperationResult result = task.getResult(); @@ -234,7 +462,7 @@ public void test140RenameMedallion() throws Exception { * Give axe to Gruffy. */ @Test - public void test150GiveAxeToGruffy() throws Exception { + public void test250GiveAxeToGruffy() throws Exception { given(); Task task = getTestTask(); OperationResult result = task.getResult(); @@ -252,34 +480,11 @@ public void test150GiveAxeToGruffy() throws Exception { .assertDescription("Used by gruffy (Gruffy Gummi)"); } - /** - * Weird case: In a user -> token link, the token is deactivated. - * User should be no longer marked as token holder. - */ - @Test - public void test200DeactivateMedallion() throws Exception { - given(); - Task task = getTestTask(); - OperationResult result = task.getResult(); - - when(); - ObjectDelta delta = deltaFor(ServiceType.class) - .item(ServiceType.F_ACTIVATION, ActivationType.F_ADMINISTRATIVE_STATUS).replace(ActivationStatusType.DISABLED) - .asObjectDelta(SERVICE_MEDALLION.oid); - executeChanges(delta, null, task, result); - - then(); - assertSuccess(result); - recomputeUser(USER_ZUMMI.oid); // temporary - - assertUserAfter(USER_ZUMMI.oid) - .assertOrganizationalUnits(); - } /** * Assign disabled device. */ @Test - public void test210AssignDisabledSword() throws Exception { + public void test310AssignDisabledSword() throws Exception { given(); Task task = getTestTask(); OperationResult result = task.getResult(); @@ -301,7 +506,7 @@ public void test210AssignDisabledSword() throws Exception { * Sword is renamed. So its holder should be updated, even if the sword is disabled. */ @Test - public void test220RenameDisabledSword() throws Exception { + public void test320RenameDisabledSword() throws Exception { given(); Task task = getTestTask(); OperationResult result = task.getResult(); @@ -326,7 +531,7 @@ public void test220RenameDisabledSword() throws Exception { * Sword user is renamed. So it should be updated, even if it is disabled. */ @Test - public void test230RenameCubbyUsingDisabledSword() throws Exception { + public void test330RenameCubbyUsingDisabledSword() throws Exception { given(); Task task = getTestTask(); OperationResult result = task.getResult(); @@ -352,7 +557,7 @@ public void test230RenameCubbyUsingDisabledSword() throws Exception { * Unassign sword from cubby. */ @Test - public void test240UnassignSwordFromCubby() throws Exception { + public void test340UnassignSwordFromCubby() throws Exception { given(); Task task = getTestTask(); OperationResult result = task.getResult(); @@ -377,7 +582,7 @@ public void test240UnassignSwordFromCubby() throws Exception { * Assign sword to cubby again. */ @Test - public void test250AssignSwordToCubbyAgain() throws Exception { + public void test350AssignSwordToCubbyAgain() throws Exception { given(); Task task = getTestTask(); OperationResult result = task.getResult(); @@ -400,7 +605,7 @@ public void test250AssignSwordToCubbyAgain() throws Exception { * Delete cubby (sigh). */ @Test - public void test260DeleteCubby() throws Exception { + public void test360DeleteCubby() throws Exception { given(); Task task = getTestTask(); OperationResult result = task.getResult(); @@ -419,7 +624,7 @@ public void test260DeleteCubby() throws Exception { * Add cubby but with sword. */ @Test - public void test270AddCubbyWithSword() throws Exception { + public void test370AddCubbyWithSword() throws Exception { given(); Task task = getTestTask(); OperationResult result = task.getResult(); @@ -441,48 +646,6 @@ public void test270AddCubbyWithSword() throws Exception { .assertDescription("Used by cubby (Cubby Gummi)"); } - /** - * Whistle is held by test user since creation - to check on the ordering of assignments. - * (Whistle first, User second). TEMPORARY - */ - @Test - public void test300CreateNewWhistleHolder() throws Exception { - given(); - Task task = getTestTask(); - OperationResult result = task.getResult(); - - when(); - UserType testUser = new UserType(prismContext) - .name(getTestNameShort()) - .fullName("Test User") - .organizationalUnit("castle holders") - .beginAssignment() - .targetRef(SERVICE_WHISTLE.oid, ServiceType.COMPLEX_TYPE) - .end() - .beginAssignment() - .targetRef(ARCHETYPE_USER.oid, ArchetypeType.COMPLEX_TYPE) - .end(); - addObject(testUser.asPrismObject(), task, result); - - then(); - assertSuccess(result); - - assertUserAfter(testUser.getOid()) - .assertOrganizationalUnits("whistle holders"); - - assertServiceAfter(SERVICE_WHISTLE.oid) - .assertDescription("Held by " + testUser.getName().getOrig() + " (Test User)"); - - recomputeUser(testUser.getOid(), task, result); - - assertUserAfter(testUser.getOid()) - .assertOrganizationalUnits("whistle holders"); - - assertServiceAfter(SERVICE_WHISTLE.oid) - .assertDescription("Held by " + testUser.getName().getOrig() + " (Test User)"); - - } - /** * Creates a project. Two children should be created automatically. */ diff --git a/model/model-intest/src/test/resources/linked/archetype-user.xml b/model/model-intest/src/test/resources/linked/archetype-user.xml deleted file mode 100644 index 3f0098db3a4..00000000000 --- a/model/model-intest/src/test/resources/linked/archetype-user.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - user - - - - devices - - ServiceType - - - - - - - - - - Removes all orphaned organizationalUnit values. Should be executed with all - other assigned mappings, therefore it is placed here. - strong - - - - - organizationalUnit - - all - - - - - - diff --git a/model/model-intest/src/test/resources/linked/gummi/archetype-device.xml b/model/model-intest/src/test/resources/linked/gummi/archetype-device.xml new file mode 100644 index 00000000000..ed7e287c9d9 --- /dev/null +++ b/model/model-intest/src/test/resources/linked/gummi/archetype-device.xml @@ -0,0 +1,82 @@ + + + + device + + A device has some special characteristics: + + 1. It is held by at most single user at given time. + + 2. It gives its holder some properties, e.g. the `organization` obtains value of + `D users` for any device D held. + + 3. On the other hand, it knows who uses it by storing the user's `name` and `fullName` in + its `description` property. + + + + + + user + + UserType + + + + + + + + + From user to device: putting 'Used by ...' into device description. + strong + + + + + description + + + + + + + + recompute-user-on-device-name-change + + Recomputes a user when device name is changed. (Note that user is recomputed + automatically when device is assigned or unassigned.) + + + + name + + + + + + + user + + + + + + + + + + + diff --git a/model/model-intest/src/test/resources/linked/archetype-device.xml b/model/model-intest/src/test/resources/linked/gummi/archetype-gummi-user.xml similarity index 51% rename from model/model-intest/src/test/resources/linked/archetype-device.xml rename to model/model-intest/src/test/resources/linked/gummi/archetype-gummi-user.xml index 097df04684f..9b3249454bb 100644 --- a/model/model-intest/src/test/resources/linked/archetype-device.xml +++ b/model/model-intest/src/test/resources/linked/gummi/archetype-gummi-user.xml @@ -7,69 +7,66 @@ - device - A device has some special characteristics: - - 1. It is held by at most single user at given time. - - 2. It gives its holder some properties, e.g. the `organizational` obtains value of - `D users` for any device D held. - - 3. On the other hand, it knows who uses it by storing the user's `name` and `fullName` in - its `description` property. - - Note that points 2 and 3 are implemented by object templates (point 2 by template for users - and point 3 by template for services). This means that they work for both active and - inactive devices. For a different approach please see the "token" archetype. - - + oid="c46b1bcc-af43-44ee-a107-71f36e952cc5"> + gummi-user - - - user + + devices + + ServiceType + + + + + magic-tokens - UserType + ServiceType + - + - - - - - - recompute-user-on-device-name-change - - Recomputes a user when device name is changed. (Note that user is recomputed - automatically when device is assigned or unassigned.) - - - - name - - - - - - - user - - - - - - - - - 1 + + + strong + + + + + organization + + all + + + + + strong + + + + + organizationalUnit + + all + + + + - - recompute-device-on-user-name-change @@ -97,7 +94,6 @@ - 2 @@ -123,6 +119,6 @@ - 2 + diff --git a/model/model-intest/src/test/resources/linked/archetype-token.xml b/model/model-intest/src/test/resources/linked/gummi/archetype-magic-token.xml similarity index 74% rename from model/model-intest/src/test/resources/linked/archetype-token.xml rename to model/model-intest/src/test/resources/linked/gummi/archetype-magic-token.xml index e261fada8f0..7f3c09dc6d0 100644 --- a/model/model-intest/src/test/resources/linked/archetype-token.xml +++ b/model/model-intest/src/test/resources/linked/gummi/archetype-magic-token.xml @@ -8,8 +8,9 @@ - token - A magic token has some special characteristics: + magic-token + + A magic token has some special characteristics: 1. It is held by at most single user at given time. @@ -18,44 +19,8 @@ 3. On the other hand, it knows who holds it by storing the holder's `name` and `fullName` in its `description` property. - - Note that points 2 and 3 are implemented by induced mappings for this particular archetype. - This means that they work only for active tokens. This is fully in accord with the magical - character of the token: if it's inactive (e.g. disabled) it loses all its powers. - - (But what about triggering the changes? They obviously will stop for disabled tokens.) - - For a different approach please see the "device" archetype. - - - - - - - - From token to user: putting 'T holders' into organizationalUnit. - strong - - - - - organizationalUnit - - all - - - - - 2 - UserType - - - - @@ -77,10 +42,6 @@ 1 - - - - recompute-holder-on-token-name-change @@ -107,8 +68,6 @@ 1 - - recompute-token-on-membership-change diff --git a/model/model-intest/src/test/resources/linked/service-axe.xml b/model/model-intest/src/test/resources/linked/gummi/service-axe.xml similarity index 100% rename from model/model-intest/src/test/resources/linked/service-axe.xml rename to model/model-intest/src/test/resources/linked/gummi/service-axe.xml diff --git a/model/model-intest/src/test/resources/linked/service-medallion.xml b/model/model-intest/src/test/resources/linked/gummi/service-medallion.xml similarity index 100% rename from model/model-intest/src/test/resources/linked/service-medallion.xml rename to model/model-intest/src/test/resources/linked/gummi/service-medallion.xml diff --git a/model/model-intest/src/test/resources/linked/service-sword.xml b/model/model-intest/src/test/resources/linked/gummi/service-sword.xml similarity index 100% rename from model/model-intest/src/test/resources/linked/service-sword.xml rename to model/model-intest/src/test/resources/linked/gummi/service-sword.xml diff --git a/model/model-intest/src/test/resources/linked/service-whistle.xml b/model/model-intest/src/test/resources/linked/gummi/service-whistle.xml similarity index 100% rename from model/model-intest/src/test/resources/linked/service-whistle.xml rename to model/model-intest/src/test/resources/linked/gummi/service-whistle.xml diff --git a/model/model-intest/src/test/resources/linked/user-cavin.xml b/model/model-intest/src/test/resources/linked/gummi/user-cavin.xml similarity index 100% rename from model/model-intest/src/test/resources/linked/user-cavin.xml rename to model/model-intest/src/test/resources/linked/gummi/user-cavin.xml diff --git a/model/model-intest/src/test/resources/linked/user-cubby.xml b/model/model-intest/src/test/resources/linked/gummi/user-cubby.xml similarity index 100% rename from model/model-intest/src/test/resources/linked/user-cubby.xml rename to model/model-intest/src/test/resources/linked/gummi/user-cubby.xml diff --git a/model/model-intest/src/test/resources/linked/user-grammi.xml b/model/model-intest/src/test/resources/linked/gummi/user-grammi.xml similarity index 100% rename from model/model-intest/src/test/resources/linked/user-grammi.xml rename to model/model-intest/src/test/resources/linked/gummi/user-grammi.xml diff --git a/model/model-intest/src/test/resources/linked/user-gruffy.xml b/model/model-intest/src/test/resources/linked/gummi/user-gruffy.xml similarity index 84% rename from model/model-intest/src/test/resources/linked/user-gruffy.xml rename to model/model-intest/src/test/resources/linked/gummi/user-gruffy.xml index 8479e6ad626..565be27cf58 100644 --- a/model/model-intest/src/test/resources/linked/user-gruffy.xml +++ b/model/model-intest/src/test/resources/linked/gummi/user-gruffy.xml @@ -11,5 +11,8 @@ + + disabled + Gruffy Gummi diff --git a/model/model-intest/src/test/resources/linked/user-zummi.xml b/model/model-intest/src/test/resources/linked/gummi/user-zummi.xml similarity index 100% rename from model/model-intest/src/test/resources/linked/user-zummi.xml rename to model/model-intest/src/test/resources/linked/gummi/user-zummi.xml diff --git a/model/model-intest/src/test/resources/linked/hw-tokens/archetype-hw-token.xml b/model/model-intest/src/test/resources/linked/hw-tokens/archetype-hw-token.xml new file mode 100644 index 00000000000..3792736a359 --- /dev/null +++ b/model/model-intest/src/test/resources/linked/hw-tokens/archetype-hw-token.xml @@ -0,0 +1,109 @@ + + + + hw-token + + A hardware token has some special characteristics: + + 1. It is held by at most single user at given time. + + 2. It has a projection on a "hw-tokens" resource where it provides (among other things) + the name and email address of its holder. + + + + + + weak + + + + + name + + + + + + + + + entitlement + hw-token + + + + + + recompute-hw-token-on-membership-change + + Recomputes all tokens (of given user) whose membership has changed. + + + + + + + + + changed + + true + + + + + + + + + 2 + + + + + recompute-hw-token-on-holder-change + Recomputes a token when user's name or emailAddress changes. + + + + + modify + name + + + modify + emailAddress + + + + + + + + + true + + + + + + + + + 2 + + + diff --git a/model/model-intest/src/test/resources/linked/hw-tokens/resource-hw-tokens.xml b/model/model-intest/src/test/resources/linked/hw-tokens/resource-hw-tokens.xml new file mode 100644 index 00000000000..775ad13ccc5 --- /dev/null +++ b/model/model-intest/src/test/resources/linked/hw-tokens/resource-hw-tokens.xml @@ -0,0 +1,130 @@ + + + + + + hw-tokens + + + + + connectorType + com.evolveum.icf.dummy.connector.DummyConnector + + + connectorVersion + 2.0 + + + + + + + + hw-tokens + + + + false + false + false + + + + + + + entitlement + hw-token + true + ri:GroupObjectClass + + icfs:name + + + name + + + + + ri:ownerName + false + + strong + + + + + + + ri:ownerEmailAddress + false + + strong + + + + + + + + + + + ri:GroupObjectClass + entitlement + hw-token + ServiceType + true + + + name + + $account/attributes/icfs:name + + + + + linked + true + + + deleted + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#unlink + + + + unlinked + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#link + + + + unmatched + + + + diff --git a/model/model-intest/src/test/resources/linked/hw-tokens/token-blue.xml b/model/model-intest/src/test/resources/linked/hw-tokens/token-blue.xml new file mode 100644 index 00000000000..7f9112ecb24 --- /dev/null +++ b/model/model-intest/src/test/resources/linked/hw-tokens/token-blue.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/model/model-intest/src/test/resources/linked/hw-tokens/token-green.xml b/model/model-intest/src/test/resources/linked/hw-tokens/token-green.xml new file mode 100644 index 00000000000..8ec1fd57428 --- /dev/null +++ b/model/model-intest/src/test/resources/linked/hw-tokens/token-green.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/model/model-intest/src/test/resources/linked/hw-tokens/token-red.xml b/model/model-intest/src/test/resources/linked/hw-tokens/token-red.xml new file mode 100644 index 00000000000..5067cd41c22 --- /dev/null +++ b/model/model-intest/src/test/resources/linked/hw-tokens/token-red.xml @@ -0,0 +1,16 @@ + + + + + + + + disabled + + diff --git a/model/model-intest/src/test/resources/linked/hw-tokens/user-niels.xml b/model/model-intest/src/test/resources/linked/hw-tokens/user-niels.xml new file mode 100644 index 00000000000..37527add326 --- /dev/null +++ b/model/model-intest/src/test/resources/linked/hw-tokens/user-niels.xml @@ -0,0 +1,13 @@ + + + + niels + Niels Bohr + niels.bohr@mail.net + diff --git a/model/model-intest/src/test/resources/linked/hw-tokens/user-paul.xml b/model/model-intest/src/test/resources/linked/hw-tokens/user-paul.xml new file mode 100644 index 00000000000..23c245d87d9 --- /dev/null +++ b/model/model-intest/src/test/resources/linked/hw-tokens/user-paul.xml @@ -0,0 +1,13 @@ + + + + paul + Paul Dirac + pdi@m.org + diff --git a/model/model-intest/src/test/resources/linked/hw-tokens/user-werner.xml b/model/model-intest/src/test/resources/linked/hw-tokens/user-werner.xml new file mode 100644 index 00000000000..d8183bc40e4 --- /dev/null +++ b/model/model-intest/src/test/resources/linked/hw-tokens/user-werner.xml @@ -0,0 +1,16 @@ + + + + werner + + + + anything@somewhere.maybe + Werner Heisenberg + diff --git a/model/model-intest/src/test/resources/linked/archetype-project-groups.xml b/model/model-intest/src/test/resources/linked/projects/archetype-project-groups.xml similarity index 100% rename from model/model-intest/src/test/resources/linked/archetype-project-groups.xml rename to model/model-intest/src/test/resources/linked/projects/archetype-project-groups.xml diff --git a/model/model-intest/src/test/resources/linked/archetype-project-users.xml b/model/model-intest/src/test/resources/linked/projects/archetype-project-users.xml similarity index 100% rename from model/model-intest/src/test/resources/linked/archetype-project-users.xml rename to model/model-intest/src/test/resources/linked/projects/archetype-project-users.xml diff --git a/model/model-intest/src/test/resources/linked/archetype-project.xml b/model/model-intest/src/test/resources/linked/projects/archetype-project.xml similarity index 95% rename from model/model-intest/src/test/resources/linked/archetype-project.xml rename to model/model-intest/src/test/resources/linked/projects/archetype-project.xml index 36de3c0fb32..7ec8ea97225 100644 --- a/model/model-intest/src/test/resources/linked/archetype-project.xml +++ b/model/model-intest/src/test/resources/linked/projects/archetype-project.xml @@ -22,14 +22,14 @@ usersOrg OrgType - + groupsOrg OrgType - + @@ -67,7 +67,6 @@ - 1 @@ -124,7 +122,6 @@ - 1 diff --git a/model/model-intest/src/test/resources/linked/system-configuration.xml b/model/model-intest/src/test/resources/linked/system-configuration.xml index fde2ec09b27..1ef3949ddce 100644 --- a/model/model-intest/src/test/resources/linked/system-configuration.xml +++ b/model/model-intest/src/test/resources/linked/system-configuration.xml @@ -19,15 +19,13 @@ xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xmlns:s="http://midpoint.evolveum.com/xml/ns/public/model/scripting-3"> SystemConfiguration - - UserType - - + + + UserType - @@ -38,8 +36,8 @@ - changed - + ServiceType + @@ -49,6 +47,34 @@ + + + + + + UserType + + + + + delete + + + + + + devices + + + + + + + + + + + OrgType diff --git a/model/model-intest/src/test/resources/linked/template-device.xml b/model/model-intest/src/test/resources/linked/template-device.xml deleted file mode 100644 index 00313b27720..00000000000 --- a/model/model-intest/src/test/resources/linked/template-device.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - template-device - - description - - From user to device: putting 'Used by ...' into device description. - strong - - - - - description - - - - diff --git a/model/model-intest/src/test/resources/linked/template-user.xml b/model/model-intest/src/test/resources/linked/template-user.xml deleted file mode 100644 index 948909497ea..00000000000 --- a/model/model-intest/src/test/resources/linked/template-user.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - template-user - - organization - - afterAssignments - strong - - - - - - all - - - - - diff --git a/model/model-intest/src/test/resources/member-recompute/archetype-department.xml b/model/model-intest/src/test/resources/member-recompute/archetype-department.xml index b7edcf42171..3a954c1902d 100644 --- a/model/model-intest/src/test/resources/member-recompute/archetype-department.xml +++ b/model/model-intest/src/test/resources/member-recompute/archetype-department.xml @@ -43,7 +43,8 @@ From b3cfbfcf8d518825b04e17a525b4b1ab601ea02b Mon Sep 17 00:00:00 2001 From: Katarina Valalikova Date: Tue, 2 Jun 2020 09:06:27 +0200 Subject: [PATCH 2/2] fix java 8 build --- .../main/java/com/evolveum/midpoint/gui/api/page/PageBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/page/PageBase.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/page/PageBase.java index b688582ac46..fc2bdacef65 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/page/PageBase.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/page/PageBase.java @@ -2747,7 +2747,7 @@ public Panel initItemPanel(String panelId, QName typeNa public Panel initContainerValuePanel(String id, IModel> model, ItemPanelSettings settings) { //TODO find from registry first - return new PrismContainerValuePanel<>(id, model, settings) { + return new PrismContainerValuePanel>(id, model, settings) { @Override protected boolean isRemoveButtonVisible() { return false;