/// <summary> /// ITestStep.Execute() implementation /// </summary> /// <param name='testConfig'>The Xml fragment containing the configuration for this test step</param> /// <param name='context'>The context for the test, this holds state that is passed beteen tests</param> public void Execute(XmlNode testConfig, Context context) { string queueManager = context.ReadConfigAsString(testConfig, "QueueManager"); string queue = context.ReadConfigAsString(testConfig, "Queue"); int waitTimeout = context.ReadConfigAsInt32(testConfig, "WaitTimeout"); XmlNode validationConfig = testConfig.SelectSingleNode("ValidationStep"); string message = MQSeriesHelper.ReadMessage(queueManager, queue, waitTimeout, context); context.LogData("MQSeries output message:", message); context.ExecuteValidator(StreamHelper.LoadMemoryStream(message), validationConfig); }
/// <summary> /// ITestStep.Execute() implementation /// </summary> /// <param name='testConfig'>The Xml fragment containing the configuration for this test step</param> /// <param name='context'>The context for the test, this holds state that is passed beteen tests</param> public void Execute(System.Xml.XmlNode testConfig, Context context) { string queueManager = testConfig.SelectSingleNode("QueueManager").InnerText; string queue = testConfig.SelectSingleNode("Queue").InnerText; string path = testConfig.SelectSingleNode("SourcePath").InnerText; var reader = new StreamReader(path); string testData = reader.ReadToEnd(); context.LogData("MSMQ input message:", testData); MQSeriesHelper.WriteMessage(queueManager, queue, testData, context); }