Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @BpmnModelResource public void shouldFindReferenceWithNamespace()
        public virtual void shouldFindReferenceWithNamespace()
        {
            MessageEventDefinition messageEventDefinition = bpmnModelInstance.getModelElementById("message-event-definition");
            Message message = bpmnModelInstance.getModelElementById("message-id");

            assertThat(messageEventDefinition.Message).NotNull;
            assertThat(messageEventDefinition.Message).isEqualTo(message);
            message.Id = "changed-message";
            assertThat(messageEventDefinition.Message).NotNull;
            assertThat(messageEventDefinition.Message).isEqualTo(message);
            message.setAttributeValue("id", "again-changed-message", true);
            assertThat(messageEventDefinition.Message).NotNull;
            assertThat(messageEventDefinition.Message).isEqualTo(message);

            StartEvent startEvent = bpmnModelInstance.getModelElementById("start-event");
            ICollection <EventDefinition> eventDefinitionRefs = startEvent.EventDefinitionRefs;

            assertThat(eventDefinitionRefs).NotEmpty;
            assertThat(eventDefinitionRefs).contains(messageEventDefinition);
            messageEventDefinition.Id = "changed-message-event";
            assertThat(eventDefinitionRefs).NotEmpty;
            assertThat(eventDefinitionRefs).contains(messageEventDefinition);
            messageEventDefinition.setAttributeValue("id", "again-changed-message-event", true);
            assertThat(eventDefinitionRefs).NotEmpty;
            assertThat(eventDefinitionRefs).contains(messageEventDefinition);

            message.removeAttribute("id");
            assertThat(messageEventDefinition.Message).Null;
            messageEventDefinition.removeAttribute("id");
            assertThat(eventDefinitionRefs).doesNotContain(messageEventDefinition);
            assertThat(eventDefinitionRefs).Empty;
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testShouldRemoveMessageEventDefinitionRefIfIdIsRemovedOfMessageEventDefinition()
        public virtual void testShouldRemoveMessageEventDefinitionRefIfIdIsRemovedOfMessageEventDefinition()
        {
            ICollection <EventDefinition> eventDefinitionRefs = startEvent.EventDefinitionRefs;

            assertThat(eventDefinitionRefs).contains(messageEventDefinition);
            messageEventDefinition.removeAttribute("id");
            assertThat(eventDefinitionRefs).doesNotContain(messageEventDefinition);
            assertThat(eventDefinitionRefs).Empty;
        }