Example #1
0
        public static MessageSent SendStep(TestStep step, string correlation = null)
        {
            if (!string.IsNullOrEmpty(correlation))
            {
                var n = Utils.SelectNode(step.Message.xml, "correlationNPU");
                if (n != null)
                {
                    n.InnerText = correlation;
                }
                else
                {
                    n = Utils.SelectNode(step.Message.xml, "correlationNpu");
                    if (n != null)
                    {
                        n.InnerText = correlation;
                    }
                }
            }

            var nNpu = Utils.SelectNode(step.Message.xml, "npu");
            nNpu.InnerText = Messaging.createNpu(step.Message.Operation, step.Message.System);

            step.Message.Payload = step.Message.xml.OuterXml;

            var msg = Messaging.SendMsg(step.Message);

            return msg;
        }
Example #2
0
        public void LoadTestStep(TestStep step)
        {
            _step = step;

            if (step != null)
            {
                tbStepName.Enabled = true;
                xmlEditor.Enabled = true;
                cbStepTrigger.Enabled = true;
                tbInterface.Enabled = true;
                tbOperation.Enabled = true;
                cbOnlyOneUse.Enabled = true;
                btnSave.Enabled = true;

                tbStepName.Text = step.Name;
                xmlEditor.Text = Utils.PrettyPrint(step.Message.xml);
                cbStepTrigger.SelectedIndex = ((int)step.Trigger.Type - 1);
                tbInterface.Text = step.Message.InterfaceToInvoke;
                tbOperation.Text = step.Message.Operation;
                cbOnlyOneUse.Checked = step.Trigger.OnlyOneUse;
            }
            else
            {
                tbStepName.Enabled = false;
                xmlEditor.Enabled = false;
                cbStepTrigger.Enabled = false;
                tbInterface.Enabled = false;
                tbOperation.Enabled = false;
                cbOnlyOneUse.Enabled = false;
                btnSave.Enabled = false;
            }
        }
Example #3
0
        public MsgSentForm(TestStep  testStep, string url)
        {
            InitializeComponent();
            _step = testStep;

            LoadSend();
            tbUrl.Text = url;
        }
Example #4
0
 public void UpdateStep(TestStep step)
 {
     if (this.treeVewProject1.InvokeRequired)
     {
         var a = new OnUpdateStep(UpdateStep);
         this.Invoke(a, new object[] { step });
     }
     else
     {
         if (_currentProject != null)
         {
             treeVewProject1.UpdateStep();
         }
     }
 }
Example #5
0
        private void btnLoadMsg_Click(object sender, EventArgs e)
        {
            ValidatePass();

            ShowLoading.Show();

            _project.Steps.Clear();

            var connection = cbxConnections.SelectedItem as DBConnection;

            var reqNumber = tbReqNumber.Text;
            var messages = DBAccess.GetMessages(reqNumber, connection);

            var i = 0;
            foreach (var msg in messages)
            {

                var step = new TestStep();
                step.Index = i++;

                if (string.IsNullOrEmpty(msg.CorrelationNPU))
                    step.Trigger = new TriggerNone(msg);
                else
                    step.Trigger = new TriggerOperation(msg);

                step.Message = msg;
                step.Name = msg.Name;
                step.UrlResponse = CommunicationWS.GetUrl(msg.InterfaceToInvoke);

                _project.Steps.Add(step);

            }

            _project.BusinessId = reqNumber;

            if (string.IsNullOrEmpty(tbName.Text))
                tbName.Text = reqNumber;

            _project.Name = tbName.Text;

            FillTreeView(_project.Steps);

            ShowLoading.Hide();
        }
Example #6
0
        private void createMsgToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var step = new TestStep();
            step.Name = "New";
            step.Index = 999;
            step.Message = new MessageInfo();

            _project.Steps.Add(step);

            FillTreeView(_project.Steps);
        }