protected <F extends FocusType> ContainerDelta<AssignmentType> createAssignmentModification(Class<F> type, QName elementName, String roleOid, QName refType, QName relation, PrismContainer<?> extension, ActivationType activationType, boolean add) throws SchemaException { try { return createAssignmentModification(type, elementName, roleOid, refType, relation, assignment -> { if (extension != null) { try { assignment.asPrismContainerValue().add(extension.clone()); } catch (SchemaException e) { throw new TunnelException(e); } } assignment.setActivation(activationType); }, add); } catch (TunnelException te) { throw (SchemaException)te.getCause(); } }
@Test(enabled = false) // normalization no longer removes empty values public void testEqualsBrokenAssignmentActivation() throws Exception { final String TEST_NAME="testEqualsBrokenAssignmentActivation"; displayTestTitle(TEST_NAME); // GIVEN PrismObjectDefinition<UserType> userDef = PrismInternalTestUtil.getUserTypeDefinition(); PrismContainerDefinition<AssignmentType> assignmentDef = userDef.findContainerDefinition(UserType.F_ASSIGNMENT); PrismContainer<AssignmentType> goodAssignment = assignmentDef.instantiate(UserType.F_ASSIGNMENT); PrismContainer<AssignmentType> brokenAssignment = goodAssignment.clone(); assertEquals("Not equals after clone", goodAssignment, brokenAssignment); // lets break one of these ... PrismContainerValue<AssignmentType> emptyValue = getPrismContext().itemFactory().createContainerValue(); brokenAssignment.add(emptyValue); // WHEN assertFalse("Unexpected equals", goodAssignment.equals(brokenAssignment)); brokenAssignment.normalize(); assertEquals("Not equals after normalize(bad)", goodAssignment, brokenAssignment); goodAssignment.normalize(); assertEquals("Not equals after normalize(good)", goodAssignment, brokenAssignment); } }
PrismContainer<Containerable> coordinatorExtension = coordinatorTaskBean.asPrismObject().findContainer(TaskType.F_EXTENSION); if (coordinatorTaskBean.getExtension() != null) { worker.asPrismObject().add(coordinatorExtension.clone());
PrismContainer<Containerable> masterExtension = masterTaskBean.asPrismObject().findContainer(TaskType.F_EXTENSION); if (masterTaskBean.getExtension() != null) { subtask.asPrismObject().add(masterExtension.clone());
.findContainer(ShadowType.F_ASSOCIATION); if (resourceAssociationContainer != null) { PrismContainer<ShadowAssociationType> associationContainer = resourceAssociationContainer.clone(); resultShadow.addReplaceExisting(associationContainer); if (associationContainer != null) {