-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding merge test for object collection
- Loading branch information
Showing
8 changed files
with
186 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
.../main/java/com/evolveum/midpoint/schema/merger/object/ObjectCollectionMergeOperation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (C) 2010-2023 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.schema.merger.object; | ||
|
||
import com.evolveum.midpoint.schema.merger.BaseMergeOperation; | ||
import com.evolveum.midpoint.schema.merger.GenericItemMerger; | ||
import com.evolveum.midpoint.schema.merger.OriginMarker; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectCollectionType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.Map; | ||
|
||
public class ObjectCollectionMergeOperation extends BaseMergeOperation<ObjectCollectionType> { | ||
|
||
public ObjectCollectionMergeOperation( | ||
@NotNull ObjectCollectionType target, | ||
@NotNull ObjectCollectionType source) { | ||
|
||
super(target, | ||
source, | ||
new GenericItemMerger( | ||
OriginMarker.forOid(source.getOid(), ObjectCollectionType.COMPLEX_TYPE), | ||
createPathMap(Map.of()))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...hema/src/test/resources/merger/object-collection/object-collection-resource-up-result.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2010-2019 Evolveum and contributors | ||
~ | ||
~ This work is dual-licensed under the Apache License 2.0 | ||
~ and European Union Public License. See LICENSE file for details. | ||
--> | ||
|
||
<objectCollection xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" | ||
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3" | ||
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" | ||
oid="00000000-0000-0000-0001-000000000003"> | ||
<name>Resources up</name> | ||
<assignment id="1"> | ||
<policyRule> | ||
<policyConstraints> | ||
<collectionStats id="2"> | ||
<collection id="3"> | ||
<interpretation>explicit</interpretation> | ||
</collection> | ||
</collectionStats> | ||
<collectionStats> | ||
<collection> | ||
<interpretation>explicit</interpretation> | ||
</collection> | ||
</collectionStats> | ||
</policyConstraints> | ||
<policySituation>#resourceHealthDanger</policySituation> | ||
<policyThreshold> | ||
<highWaterMark> | ||
<percentage>99.9</percentage> | ||
</highWaterMark> | ||
</policyThreshold> | ||
</policyRule> | ||
</assignment> | ||
<type>ResourceType</type> | ||
<filter> | ||
<q:text>operationalState/lastAvailabilityStatus = "up"</q:text> | ||
</filter> | ||
<domain> | ||
<collectionRef oid="00000000-0000-0000-0001-000000000006" type="c:ObjectCollectionType"/> | ||
</domain> | ||
</objectCollection> |
41 changes: 41 additions & 0 deletions
41
...hema/src/test/resources/merger/object-collection/object-collection-resource-up-source.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2010-2019 Evolveum and contributors | ||
~ | ||
~ This work is dual-licensed under the Apache License 2.0 | ||
~ and European Union Public License. See LICENSE file for details. | ||
--> | ||
|
||
<objectCollection xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" | ||
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3" | ||
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" | ||
oid="00000000-0000-0000-0001-000000000003"> | ||
<name>Resources up</name> | ||
<assignment> | ||
<policyRule> | ||
<policyConstraints> | ||
<collectionStats> | ||
<collection> | ||
<interpretation>explicit</interpretation> | ||
</collection> | ||
</collectionStats> | ||
</policyConstraints> | ||
<policySituation>#resourceHealthDanger</policySituation> | ||
<policyThreshold> | ||
<highWaterMark> | ||
<percentage>99.9</percentage> | ||
</highWaterMark> | ||
</policyThreshold> | ||
</policyRule> | ||
</assignment> | ||
<type>ResourceType</type> | ||
<filter> | ||
<q:equal> | ||
<q:path>operationalState/lastAvailabilityStatus</q:path> | ||
<q:value>up</q:value> | ||
</q:equal> | ||
</filter> | ||
<domain> | ||
<collectionRef oid="00000000-0000-0000-0001-000000000006" type="c:ObjectCollectionType"/> | ||
</domain> | ||
</objectCollection> |
38 changes: 38 additions & 0 deletions
38
...hema/src/test/resources/merger/object-collection/object-collection-resource-up-target.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2010-2019 Evolveum and contributors | ||
~ | ||
~ This work is dual-licensed under the Apache License 2.0 | ||
~ and European Union Public License. See LICENSE file for details. | ||
--> | ||
|
||
<objectCollection xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" | ||
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3" | ||
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" | ||
oid="00000000-0000-0000-0001-000000000003"> | ||
<name>Resources up</name> | ||
<assignment id="1"> | ||
<policyRule> | ||
<policyConstraints> | ||
<collectionStats id="2"> | ||
<collection id="3"> | ||
<interpretation>explicit</interpretation> | ||
</collection> | ||
</collectionStats> | ||
</policyConstraints> | ||
<policySituation>#resourceHealthDanger</policySituation> | ||
<policyThreshold> | ||
<highWaterMark> | ||
<percentage>99.9</percentage> | ||
</highWaterMark> | ||
</policyThreshold> | ||
</policyRule> | ||
</assignment> | ||
<type>ResourceType</type> | ||
<filter> | ||
<q:text>operationalState/lastAvailabilityStatus = "up"</q:text> | ||
</filter> | ||
<domain> | ||
<collectionRef oid="00000000-0000-0000-0001-000000000006" type="c:ObjectCollectionType"/> | ||
</domain> | ||
</objectCollection> |