public AssignmentType description(String value) { setDescription(value); return this; }
@Test public void testContextlessAssignmentEquals() throws Exception { System.out.println("\n\n===[ testContextlessAssignmentEquals ]===\n"); AssignmentType a1 = new AssignmentType(); // no prismContext here a1.setDescription("descr1"); AssignmentType a2 = new AssignmentType(); // no prismContext here a2.setDescription("descr2"); AssignmentType a3 = new AssignmentType(); // no prismContext here a3.setDescription("descr1"); assertFalse(a1.equals(a2)); // this should work even without prismContext assertTrue(a1.equals(a3)); // this should work even without prismContext PrismContext prismContext = PrismTestUtil.getPrismContext(); prismContext.adopt(a1); prismContext.adopt(a2); prismContext.adopt(a3); assertFalse(a1.equals(a2)); // this should work as well assertTrue(a1.equals(a3)); }
a1.setDescription("descr1"); user.getAssignment().add(a1); AssignmentType a2 = new AssignmentType(); // no prismContext here a2.setDescription("descr2"); user.getAssignment().add(a2); a2identical.setDescription("descr2"); assertTrue(user.getAssignment().contains(a2identical)); b1.setDescription("descr1"); userWithContext.getAssignment().add(b1); AssignmentType b2 = new AssignmentType(); // no prismContext here b2.setDescription("descr2"); userWithContext.getAssignment().add(b2); b2identical.setDescription("descr2"); assertTrue(user.getAssignment().contains(b2identical));
private void createCustomConstruction(RoleType role, String name, int order) { ConstructionType c = new ConstructionType(prismContext); c.setDescription(name); c.setResourceRef(ObjectTypeUtil.createObjectRef(RESOURCE_DUMMY_EMPTY_OID, ObjectTypes.RESOURCE)); ResourceAttributeDefinitionType nameDef = new ResourceAttributeDefinitionType(); nameDef.setRef(new ItemPathType(ItemPath.create(new QName(SchemaConstants.NS_ICF_SCHEMA, "name")))); MappingType outbound = new MappingType(); outbound.setName(name); ExpressionType expression = new ExpressionType(); ScriptExpressionEvaluatorType script = new ScriptExpressionEvaluatorType(); script.setCode( "import com.evolveum.midpoint.model.impl.lens.TestAssignmentProcessor2\n\n" + "TestAssignmentProcessor2.startCallback('" + name + "')\n" + "this.binding.variables.each {k,v -> TestAssignmentProcessor2.variableCallback(k, v, '" + name + "')}\n" + "TestAssignmentProcessor2.finishCallback('" + name + "')\n" + "return null"); expression.getExpressionEvaluator().add(new ObjectFactory().createScript(script)); outbound.setExpression(expression); nameDef.setOutbound(outbound); c.getAttribute().add(nameDef); AssignmentType a = new AssignmentType(prismContext); a.setDescription("Assignment for " + c.getDescription()); a.setConstruction(c); addAssignmentOrInducement(role, order, a); }
ass.setDescription("asdf"); ass.setTargetRef(createRef(OrgType.COMPLEX_TYPE, "444")); MetadataType metadata = new MetadataType();
assignmentType.setDescription(null); user.asObjectable().getAssignment().add(assignmentType.clone());
a1a.setDescription("descr1"); a2.setDescription("descr2"); a1b.setDescription("descr1"); a1m.setDescription("descr1"); MetadataType metadata1m = new MetadataType(); metadata1m.setCreateTimestamp(XmlTypeConverter.createXMLGregorianCalendar(System.currentTimeMillis())); a1e.setDescription("descr1"); ActivationType activation1e = new ActivationType(); activation1e.setEffectiveStatus(ActivationStatusType.ENABLED);
c.setResourceRef(ObjectTypeUtil.createObjectRef(RESOURCE_DUMMY_EMPTY_OID, ObjectTypes.RESOURCE)); AssignmentType a = new AssignmentType(prismContext); a.setDescription("Assignment for " + c.getDescription()); a.setConstruction(c); addAssignmentOrInducement(abstractRole, i, a);
a1a.setDescription("descr1"); a2.setDescription("descr2"); a1b.setDescription("descr1"); a1m.setDescription("descr1"); MetadataType metadata1m = new MetadataType(); metadata1m.setCreateTimestamp(XmlTypeConverter.createXMLGregorianCalendar(System.currentTimeMillis())); a1e.setDescription("descr1"); ActivationType activation1e = new ActivationType(); activation1e.setEffectiveStatus(ActivationStatusType.ENABLED);
dummyAssignmentType2.setTargetRef(ObjectTypeUtil.createObjectRef(ROLE_SUPERUSER_OID, ObjectTypes.ROLE)); dummyAssignmentType2.setActivation(activationType.clone()); dummyAssignmentType2.setDescription("just to differentiate");