Skip to content

Commit

Permalink
Fixed some of xmlns problems in longtests. (Partly?) fixed determinat…
Browse files Browse the repository at this point in the history
…ion of ObjectPolicyConfigurationType.
  • Loading branch information
mederly committed Feb 28, 2015
1 parent 90b06dc commit 2fbe37e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
Expand Up @@ -357,6 +357,14 @@ private <F extends ObjectType> void loadFromSystemConfig(LensContext<F> context,
return;
}
SystemConfigurationType systemConfigurationType = systemConfiguration.asObjectable();

if (context.getFocusContext() != null) {
if (context.getFocusContext().getObjectPolicyConfigurationType() == null) {
ObjectPolicyConfigurationType policyConfigurationType =
ModelUtils.determineObjectPolicyConfiguration(context.getFocusContext().getObjectTypeClass(), systemConfigurationType);
context.getFocusContext().setObjectPolicyConfigurationType(policyConfigurationType);
}
}

if (context.getFocusTemplate() == null) {
PrismObject<ObjectTemplateType> focusTemplate = determineFocusTemplate(context, result);
Expand Down Expand Up @@ -387,16 +395,14 @@ private <F extends ObjectType> void loadFromSystemConfig(LensContext<F> context,
context.setGlobalPasswordPolicy(globalPasswordPolicy);
}
}


// expects that object policy configuration is already set in focusContext
private <F extends ObjectType> PrismObject<ObjectTemplateType> determineFocusTemplate(LensContext<F> context, OperationResult result) throws ObjectNotFoundException, SchemaException, ConfigurationException {
SystemConfigurationType systemConfigurationType = context.getSystemConfiguration().asObjectable();
LensFocusContext<F> focusContext = context.getFocusContext();
if (focusContext == null) {
return null;
}
Class<F> focusType = focusContext.getObjectTypeClass();

ObjectPolicyConfigurationType policyConfigurationType = ModelUtils.determineObjectPolicyConfiguration(focusType, systemConfigurationType);
ObjectPolicyConfigurationType policyConfigurationType = focusContext.getObjectPolicyConfigurationType();
if (policyConfigurationType == null) {
LOGGER.trace("No default object template");
return null;
Expand Down
Expand Up @@ -27,6 +27,7 @@
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:func="http://midpoint.evolveum.com/xml/ns/public/function/basic-3"
xmlns:ext="http://midpoint.evolveum.com/xml/ns/science/user/ext"
>

<name>Test AD (OpenDJ simulation)</name>
Expand Down
3 changes: 2 additions & 1 deletion testing/story/src/test/resources/science/role-statistics.xml
@@ -1,4 +1,5 @@
<role xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
oid="23d90f70-1924-419e-9beb-78a8bde6d261"
version="7">
<name>Stats</name>
Expand All @@ -13,7 +14,7 @@
<associationTargetSearch>
<filter xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3">
<q:equal>
<q:path>attributes/icsf:name</q:path>
<q:path>attributes/icfs:name</q:path>
<q:value>CN=StatsUsers,OU=groups,DC=example,DC=com</q:value>
</q:equal>
</filter>
Expand Down

0 comments on commit 2fbe37e

Please sign in to comment.