private HPQualityCentreResultWriter()
 {
     _settings = new Settings();
 }
Ejemplo n.º 2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            Exception errorCatch = null;
            try
            {
                TestResultCollection allTestResults = new TestResultCollection();
                TrxFileParser trxparser = new TrxFileParser();
                this.Enabled = false;

                if (chkLstTrxFiles.CheckedItems.Count > 0)
                {
                    Settings _settings = new Settings();
                    if (ddlProvider.Text.ToLower() == "mercury")
                    {
                        //resultWriter = MercuryResultWriter.Instance();
                    }
                    else
                    {
                       resultWriter = TFS2010ResultWriter.Instance(_currentProjectContext, cbxCreateTestRun.Checked);
                    }
                    if (resultWriter.Cancelled)
                    {
                        ErrorReportingForm ef = new ErrorReportingForm();
                        ef.txtErrorDetails.Text = "User cancelled";
                        ef.Show();
                    }
                    else
                    {
                        //Show the output form
                        resultsForm = new PublishResults();
                        resultsForm.txtOutput.Text = "";
                        resultsForm.btnOk.Click += new EventHandler(resutlsForm_btnOk_click);
                        resultsForm.Show();
                        //Publish each of the selected trx files
                        resultsForm.SetOutputText("Processing results file...Start");
                        for (int i = 0; i < chkLstTrxFiles.CheckedItems.Count; i++)
                        {
                            allTestResults.Append(trxparser.processTrxFile(txtResultsFolder.Text + @"\" + chkLstTrxFiles.CheckedItems[i].ToString(), publishFailures.Checked, publishErrorInfo.Checked));
                        }
                        resultsForm.SetOutputText("Processing results file...Done.");

                        foreach (TestResult item in allTestResults)
                        {
                            resultsForm.AddResult(resultWriter.UpdateTestResult(item, this.publishFailures.Checked, this.publishInconclusive.Checked, this.publishErrorInfo.Checked));
                        }
                        resultsForm.btnOk.Enabled = true;
                    }
                    this.btnOk.Enabled = false;
                    this.btnCancel.Text = "Close";
                }
            }
            catch (Exception ex)
            {
                errorCatch = ex;
                ErrorReportingForm ef = new ErrorReportingForm();
                ef.txtErrorDetails.Text = errorCatch.Message + errorCatch.StackTrace;
                ef.Show();
                resultsForm.Close();
                this.Close();
            }
            finally
            {
                if (resultWriter != null)
                {
                    resultWriter.Disconnect();
                }
            }
        }
Ejemplo n.º 3
0
 private TFS2010ResultWriter()
 {
     _settings = new Settings();
 }