/// <summary> /// Describes a specific Subset-076 specification issue /// </summary> /// <param name="paragraph"></param> private void DescribeSpecIssue(Paragraph paragraph) { if (paragraph.SubParagraphs.Count > 0) { Report.AddSubParagraph(paragraph.Name); Report.AddTable(new[] { "SubSequence", "Test case", "Step", "Comment" }, new[] { 60, 20, 10, 80 }); foreach (Paragraph subParagraph in paragraph.SubParagraphs) { DescribeSpecIssue(subParagraph); } Report.CloseSubParagraph(); } else { Report.AddRow(paragraph.ExpressionText); Report.SetLastRowColor(IssueColor(paragraph)); if (paragraph.Implementations.Count > 0) { foreach (ReqRef reqRef in paragraph.Implementations) { SubSequence subSequence = EnclosingFinder <SubSequence> .find(reqRef, true); TestCase testCase = EnclosingFinder <TestCase> .find(reqRef, true); Step step = EnclosingFinder <Step> .find(reqRef, true); Report.AddRow( subSequence != null ? subSequence.Name : "", testCase != null ? testCase.getFeature().ToString(CultureInfo.InvariantCulture) : "", step != null ? step.getTCS_Order().ToString(CultureInfo.InvariantCulture) : "", reqRef.Comment); } } } }
/// <summary> /// Imports all the messages used by this step /// </summary> /// <param name="aStep"></param> private void importStepMessages(DataDictionary.Tests.Step aStep) { string sql = "SELECT TCSOrder, MessageOrder, MessageType, Var_Name, Var_Value FROM TSW_MessageHeader ORDER BY MessageOrder, Var_Row"; OleDbDataAdapter adapter = new OleDbDataAdapter(sql, Connection); DataSet dataSet = new DataSet(); adapter.Fill(dataSet); if (dataSet.Tables.Count > 0) { int messageNumber = 0; DataDictionary.Tests.DBElements.DBMessage message = null; int order = -1; foreach (DataRow dataRow in dataSet.Tables[0].Rows) { object[] items = dataRow.ItemArray; order = (int)items[0]; if (order == aStep.getTCS_Order()) { short messageOrder = (short)items[1]; if (messageNumber != messageOrder) // we create a new Message { if (messageNumber != 0) { aStep.AddMessage(message); importPackets(message, order); } short messageTypeNumber = (short)items[2]; DataDictionary.Generated.acceptor.DBMessageType messageType = DataDictionary.Generated.acceptor.DBMessageType.defaultDBMessageType; switch (messageTypeNumber) { case 0: messageType = DataDictionary.Generated.acceptor.DBMessageType.aEUROBALISE; break; case 1: messageType = DataDictionary.Generated.acceptor.DBMessageType.aEUROLOOP; break; case 2: messageType = DataDictionary.Generated.acceptor.DBMessageType.aEURORADIO; break; } message = (DataDictionary.Tests.DBElements.DBMessage)DataDictionary.Generated.acceptor.getFactory().createDBMessage(); message.MessageOrder = messageOrder; message.MessageType = messageType; messageNumber = messageOrder; } DataDictionary.Tests.DBElements.DBField field = (DataDictionary.Tests.DBElements.DBField)DataDictionary.Generated.acceptor.getFactory().createDBField(); string variable = items[3] as string; if (variable != null) { field.Variable = variable; } string value = items[4] as string; if (value != null) { field.Value = DataDictionary.Tests.Translations.Translation.format_decimal(value); } message.AddField(field); } } if (message != null) { aStep.AddMessage(message); importPackets(message, aStep.getTCS_Order()); } } }
/// <summary> /// Imports all the messages used by this step /// </summary> /// <param name="aStep"></param> private void importStepMessages(Step aStep) { string sql = "SELECT TCSOrder, MessageOrder, MessageType, Var_Name, Var_Value FROM TSW_MessageHeader ORDER BY MessageOrder, Var_Row"; OleDbDataAdapter adapter = new OleDbDataAdapter(sql, Connection); DataSet dataSet = new DataSet(); adapter.Fill(dataSet); if (dataSet.Tables.Count > 0) { int messageNumber = 0; DBMessage message = null; int order = -1; foreach (DataRow dataRow in dataSet.Tables[0].Rows) { object[] items = dataRow.ItemArray; order = (int) items[0]; if (order == aStep.getTCS_Order()) { short messageOrder = (short) items[1]; if (messageNumber != messageOrder) // we create a new Message { if (messageNumber != 0) { aStep.AddMessage(message); importPackets(message, order); } short messageTypeNumber = (short) items[2]; acceptor.DBMessageType messageType = acceptor.DBMessageType.defaultDBMessageType; switch (messageTypeNumber) { case 0: messageType = acceptor.DBMessageType.aEUROBALISE; break; case 1: messageType = acceptor.DBMessageType.aEUROLOOP; break; case 2: messageType = acceptor.DBMessageType.aEURORADIO; break; } message = (DBMessage) acceptor.getFactory().createDBMessage(); message.MessageOrder = messageOrder; message.MessageType = messageType; messageNumber = messageOrder; } DBField field = (DBField) acceptor.getFactory().createDBField(); string variable = items[3] as string; if (variable != null) { field.Variable = variable; } string value = items[4] as string; if (value != null) { field.Value = VariableConverter.INSTANCE.Convert(variable, value).ToString(); } message.AddField(field); } } if (message != null) { aStep.AddMessage(message); importPackets(message, aStep.getTCS_Order()); } } }