//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Before @SuppressWarnings("unchecked") public void copyModelInstance() public virtual void copyModelInstance() { modelInstance = cloneModelInstance(); tweety = modelInstance.getModelElementById("tweety"); daffy = modelInstance.getModelElementById("daffy"); daisy = modelInstance.getModelElementById("daisy"); plucky = modelInstance.getModelElementById("plucky"); birdo = modelInstance.getModelElementById("birdo"); animalType = modelInstance.Model.getType(typeof(Animal)); // QName attribute reference fatherReference = (QNameAttributeReferenceImpl <Animal>)animalType.getAttribute("father").OutgoingReferences.GetEnumerator().next(); // ID attribute reference motherReference = (AttributeReferenceImpl <Animal>)animalType.getAttribute("mother").OutgoingReferences.GetEnumerator().next(); // ID element reference flightPartnerRefsColl = FlyingAnimal.flightPartnerRefsColl; ModelElementType flightPartnerRefType = modelInstance.Model.getType(typeof(FlightPartnerRef)); flightPartnerRef = (FlightPartnerRef)modelInstance.getModelElementsByType(flightPartnerRefType).GetEnumerator().next(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Before @SuppressWarnings("unchecked") public void copyModelInstance() public virtual void copyModelInstance() { modelInstance = cloneModelInstance(); tweety = modelInstance.getModelElementById("tweety"); ModelElementType animalType = modelInstance.Model.getType(typeof(Animal)); idAttribute = (Attribute <string>)animalType.getAttribute("id"); nameAttribute = (Attribute <string>)animalType.getAttribute("name"); fatherAttribute = (Attribute <string>)animalType.getAttribute("father"); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testReferenceTargetAttribute() public virtual void testReferenceTargetAttribute() { //JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET: //ORIGINAL LINE: org.camunda.bpm.model.xml.type.attribute.Attribute<?> idAttribute = animalType.getAttribute("id"); Attribute <object> idAttribute = animalType.getAttribute("id"); assertThat(idAttribute).hasIncomingReferences(fatherReference, motherReference); assertThat(fatherReference).hasTargetAttribute(idAttribute); assertThat(motherReference).hasTargetAttribute(idAttribute); assertThat(flightPartnerRefsColl).hasTargetAttribute(idAttribute); }
/// <summary> /// Set new identifier if the type has a String id attribute /// </summary> /// <param name="type"> the type of the model element </param> /// <param name="modelElementInstance"> the model element instance to set the id </param> /// <param name="newId"> new identifier </param> /// <param name="withReferenceUpdate"> true to update id references in other elements, false otherwise </param> public static void setNewIdentifier(ModelElementType type, ModelElementInstance modelElementInstance, string newId, bool withReferenceUpdate) { //JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET: //ORIGINAL LINE: org.camunda.bpm.model.xml.type.attribute.Attribute<?> id = type.getAttribute(ID_ATTRIBUTE_NAME); Attribute <object> id = type.getAttribute(ID_ATTRIBUTE_NAME); if (id != null && id is StringAttribute && id.IdAttribute) { ((StringAttribute)id).setValue(modelElementInstance, newId, withReferenceUpdate); } }
public virtual AttributeAssert assertThatAttribute(string attributeName) { return(assertThat(modelElementType.getAttribute(attributeName))); }