Skip to content

Commit

Permalink
Fixing problem with objectPolicy matching, which also should fix MID-…
Browse files Browse the repository at this point in the history
…2236
  • Loading branch information
semancik committed Mar 2, 2015
1 parent d4f1ced commit 0689dd4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
Expand Up @@ -172,7 +172,7 @@ public static ObjectTypes getObjectTypeFromTypeQName(QName typeQName) {
// END OF UGLY HACK

for (ObjectTypes type : values()) {
if (type.getTypeQName().equals(typeQName)) {
if (QNameUtil.match(type.getTypeQName(), typeQName)) {
return type;
}
}
Expand Down
Expand Up @@ -252,6 +252,10 @@ public ObjectTemplateType getFocusTemplate() {
return focusTemplate;
}

public void setFocusTemplate(ObjectTemplateType focusTemplate) {
this.focusTemplate = focusTemplate;
}

public LensProjectionContext findProjectionContext(ResourceShadowDiscriminator rat, String oid) {
LensProjectionContext projectionContext = findProjectionContext(rat);

Expand All @@ -271,10 +275,6 @@ public void setSystemConfiguration(
this.systemConfiguration = systemConfiguration;
}

public void setFocusTemplate(ObjectTemplateType focusTemplate) {
this.focusTemplate = focusTemplate;
}

public ProjectionPolicyType getAccountSynchronizationSettings() {
return accountSynchronizationSettings;
}
Expand Down
Expand Up @@ -404,12 +404,12 @@ private <F extends ObjectType> PrismObject<ObjectTemplateType> determineFocusTem
}
ObjectPolicyConfigurationType policyConfigurationType = focusContext.getObjectPolicyConfigurationType();
if (policyConfigurationType == null) {
LOGGER.trace("No default object template");
LOGGER.trace("No default object template (no policy)");
return null;
}
ObjectReferenceType templateRef = policyConfigurationType.getObjectTemplateRef();
if (templateRef == null) {
LOGGER.trace("No default object template");
LOGGER.trace("No default object template (no templateRef)");
return null;
}

Expand Down
Expand Up @@ -94,6 +94,7 @@
import com.evolveum.midpoint.test.util.TestUtil;
import com.evolveum.midpoint.util.DebugUtil;
import com.evolveum.midpoint.util.MiscUtil;
import com.evolveum.midpoint.util.QNameUtil;
import com.evolveum.midpoint.util.exception.CommunicationException;
import com.evolveum.midpoint.util.exception.ConfigurationException;
import com.evolveum.midpoint.util.exception.ExpressionEvaluationException;
Expand Down Expand Up @@ -1539,7 +1540,7 @@ protected void setDefaultObjectTemplate(QName objectType, String userTemplateOid

PrismContainerValue<ObjectPolicyConfigurationType> oldValue = null;
for (ObjectPolicyConfigurationType focusPolicyType: systemConfig.asObjectable().getDefaultObjectPolicyConfiguration()) {
if (objectType.equals(focusPolicyType.getType())) {
if (QNameUtil.match(objectType, focusPolicyType.getType())) {
oldValue = focusPolicyType.asPrismContainerValue();
}
}
Expand Down
@@ -1,6 +1,6 @@
package com.evolveum.midpoint.testing.story;
/*
* Copyright (c) 2014 Evolveum
* Copyright (c) 2014-2015 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -335,6 +335,10 @@ public void test000Sanity() throws Exception {
OperationResult testResultOpenDj = modelService.testResource(RESOURCE_OPENDJ_OID, task);
TestUtil.assertSuccess(testResultOpenDj);

SystemConfigurationType systemConfiguration = getSystemConfiguration();
assertNotNull("No system configuration", systemConfiguration);
display("System config", systemConfiguration);

waitForTaskStart(TASK_TRIGGER_SCANNER_OID, true);
waitForTaskStart(TASK_VALIDITY_SCANNER_OID, true);
waitForTaskStart(TASK_LIVE_SYNC_DUMMY_SOURCE_OID, false);
Expand Down

0 comments on commit 0689dd4

Please sign in to comment.