public MscDiagramInterpreterTest()
        {
            mscGenerator=new Generator(null);
            process1=new Process(PROCESS_1_COMPLEX_NAME,null,LEFT_RAND,RIGHT_RAND);
            process2=new Process(PROCESS_2_COMPLEX_NAME,null,LEFT_RAND,RIGHT_RAND);
            mscGenerator.Processes.Add(process1);
            mscGenerator.Processes.Add(process2);

            task1=new Task(FILE_LINE,TASK_NAME_1,LINE,PROCESS_1_Index);
            task1.ItemID=TASK_1_ID;
            mscGenerator.Items.Add(task1);

            task2=new Task(FILE_LINE,TASK_NAME_2,LINE,PROCESS_2_Index);
            task2.ItemID=TASK_2_ID;
            mscGenerator.Items.Add(task2);
            message1=new Message(FILE_LINE,MESSAGE_1_NAME,LINE,PROCESS_1_Index,PROCESS_2_Index,MessageStyle.Synchron);
            mscGenerator.Items.Add(message1);
        }
Пример #2
0
 private void InterpretNormalMessageItem(XmlElement interactionElement,Message normalMessageItem)
 {
     int sourceLifelineItemId=normalMessageItem.MessageSource;
     int destinationLifelineItemId=normalMessageItem.MessageDestination;
     XmlElement sourceLifelineElement=GetXmiElementByItemId(sourceLifelineItemId);
     XmlElement destinationLifelineElement=GetXmiElementByItemId(destinationLifelineItemId);
     xmiDocumentBuilder.AddMessageElement(interactionElement,normalMessageItem,sourceLifelineElement,destinationLifelineElement);
 }
Пример #3
0
        private string GetMessageSortNormalMessage(Message normalMessage)
        {
            string messageSort=null;
            MessageStyle messageStyle=normalMessage.MStyle;

            if(messageStyle==MessageStyle.Normal)
            {
                messageSort=UmlModel.MESSAGE_SORT_ASYNCH_CALL;
            }
            else if (messageStyle==MessageStyle.Dashed)
            {
                messageSort=UmlModel.MESSAGE_SORT_ASYNCH_SIGNAL;
            }
            else if(messageStyle==MessageStyle.Synchron)
            {
                messageSort=UmlModel.MESSAGE_SORT_SYNCH_CALL;
            }
            return messageSort;
        }
        public void CreateNormalMessageSyncCall()
        {
            Message normalMessageItem=new Message(FILE_LINE_DUMMY,MESSAGE_NAME,LINE_DUMMY,MESSAGE_SOURCE_DUMMY,MESSAGE_DESTINATION_DUMMY);
            normalMessageItem.MStyle=MessageStyle.Synchron;

            XmlElement createdMessageElement=elementCreator.CreateMessageElement(parentElement,normalMessageItem,sourceLifelineElement,destinationLifelineElement);
            System.Console.WriteLine(modelElement.OuterXml);
            System.Console.WriteLine("*********************************");
            /*
            Assert.IsNotNull(createdMessageElement);
            AssertXML.AssertTypeNameOfElement(createdMessageElement,MESSAGE_ELEMENT_TYPE_NAME);
            AssertXML.AssertNamespacePrefixOfElement(createdMessageElement,EMPTY_STRING);
            AssertXML.AssertOwnedAttributesCount(createdMessageElement,OWNED_ATTRIBUTES_COUNT_CASE_MESSAGE);
            AssertXML.AssertChildElementsCount(parentElement,EXPECTED_CHILD_COUNT_CASE_MESSAGE);
            AssertXML.AssertIsChildElementOf(parentElement,createdMessageElement,XPathQuerys.MESSAGE_ELEMENT_PATH,namespaceManager);
            AssertXML.AssertIsXmiAttributeOf(createdMessageElement,XmiElements.XMI_ID_ATTR_NAME,XmiElements.XMI_NAMESPACE_URI);
            AssertXML.AssertIsCorrectXmiAttributeValue(createdMessageElement,XmiElements.XMI_ID_ATTR_NAME,XmiElements.XMI_NAMESPACE_URI,ID_OF_FIRST_XMI_ELEMENT);
            AssertXML.AssertIsXmiAttributeOf(createdMessageElement,XmiElements.XMI_TYPE_ATTR_NAME,XmiElements.XMI_NAMESPACE_URI);
            AssertXML.AssertIsCorrectXmiAttributeValue(createdMessageElement,XmiElements.XMI_TYPE_ATTR_NAME,XmiElements.XMI_NAMESPACE_URI,XMI_TYPE_ATTRIBUTE_VALUE);
            AssertXML.AssertIsUmlAttributeOf(createdMessageElement,UmlModelElements.NAME_ATTR_NAME,this.namespaceManager);
            AssertXML.AssertValueOfUmlAttribute(createdMessageElement,UmlModelElements.NAME_ATTR_NAME,this.namespaceManager,MESSAGE_NAME);
            VerifyMessageOccurrenceSpecElement(ID_SEND_EVENT_ELEMENT_CASE_MESSAGE,ID_OF_FIRST_XMI_ELEMENT,ID_LIFELINE_SOURCE);
            VerifyMessageOccurrenceSpecElement(ID_RECEIVE_EVENT_ELEMENT_CASE_MESSAGE,ID_OF_FIRST_XMI_ELEMENT,ID_LIFELINE_DESTINATION);
            AssertXML.AssertIsUmlAttributeOf(createdMessageElement,UmlModelElements.MESSAGE_SORT_ATTR_NAME,this.namespaceManager);
            AssertXML.AssertValueOfUmlAttribute(createdMessageElement,UmlModelElements.MESSAGE_SORT_ATTR_NAME,this.namespaceManager,UmlModelElements.MESSAGE_SORT_SYNCH_CALL);
            AssertXML.AssertIsUmlAttributeOf(createdMessageElement,UmlModelElements.MESSAGE_KIND_ATTR_NAME,this.namespaceManager);
            AssertXML.AssertValueOfUmlAttribute(createdMessageElement,UmlModelElements.MESSAGE_KIND_ATTR_NAME,this.namespaceManager,UmlModelElements.MESSAGE_KIND_COMPLETE);

            AssertXML.AssertIsUmlAttributeOf(createdMessageElement,UmlModelElements.RECEIVE_EVENT_ATTR_NAME,this.namespaceManager);
            AssertXML.AssertValueOfUmlAttribute(createdMessageElement,UmlModelElements.RECEIVE_EVENT_ATTR_NAME,this.namespaceManager,ID_RECEIVE_EVENT_ELEMENT_CASE_MESSAGE);
            AssertXML.AssertIsUmlAttributeOf(createdMessageElement,UmlModelElements.SEND_EVENT_ATTR_NAME,this.namespaceManager);
            AssertXML.AssertValueOfUmlAttribute(createdMessageElement,UmlModelElements.SEND_EVENT_ATTR_NAME,this.namespaceManager,ID_SEND_EVENT_ELEMENT_CASE_MESSAGE);

            uint newIdCount=documentBuilder.CurrentXmiIdCount;
            Assert.IsTrue(EXPECTED_ID_COUNT==2);*/
        }