Exemple #1
0
        public void ProductToString()
        {
            BugTrackerProduct product = new BugTrackerProduct("StackHash", "1.2.3.4", 12345678);

            String result = product.ToString();

            Assert.AreEqual("Product: Id=12345678, Name=StackHash, Version=1.2.3.4\r\n", result);
        }
Exemple #2
0
        /// <summary>
        /// If the report type is automatic then this call indicates that a Product has been changed in the
        /// StackHash database by way of a Synchronize with the WinQual web site.
        /// The change may include the number of events stored has increased.
        ///
        /// This method is not currently called for manual reports.
        ///
        /// Note that it is possible that an Updated is reported when no Added has been invoked. This can happen if the
        /// plug-in has been installed after the StackHash database has been created. Performing a manual Bug Report of
        /// the entire database when the plug-in is installed will limit the likelihood of this case.
        ///
        /// Automatic reports may arrived interleaved with manual reports. This may happen when, say a WinQual sync
        /// is happening at the same time as a manual report is requested.
        /// </summary>
        /// <param name="reportType">Manual or automatic. If manual identifies what level of report is taking place.</param>
        /// <param name="product">The product being updated.</param>
        public void ProductUpdated(BugTrackerReportType reportType, BugTrackerProduct product)
        {
            if (product == null)
            {
                throw new ArgumentNullException("product");
            }

            // Note that all of the interface objects have a built in ToString() which formats the fields suitably.
            BugTrackerTrace.LogMessage(BugTrackerTraceSeverity.Information, m_Control.PlugInName, "Product Updated: " + product.ToString());
        }
Exemple #3
0
        /// <summary>
        /// If the report type is automatic then this call indicates that a Product has been added to the
        /// StackHash database by way of a Synchronize with the WinQual web site.
        ///
        /// If the report type is manual then this call indicates that a Product already exists in the
        /// StackHash database. This is the result of a BugReport task being run.
        ///
        /// Note that it is therefore possible that the product existence has already been reported, so the
        /// code here should check, if necessary, that this is not a duplicate before creating new items in
        /// the destination bug tracking system.
        ///
        /// Automatic reports may arrived interleaved with manual reports. This may happen when, say a WinQual sync
        /// is happening at the same time as a manual report is requested.
        /// </summary>
        /// <param name="reportType">Manual or automatic. If manual identifies what level of report is taking place.</param>
        /// <param name="product">The product being added.</param>
        public void ProductAdded(BugTrackerReportType reportType, BugTrackerProduct product)
        {
            if (product == null)
            {
                throw new ArgumentNullException("product");
            }

            if (reportType == BugTrackerReportType.Automatic)
            {
                // Do automatic processing here. i.e. the result of a WinQualSync Task.
            }
            else
            {
                // Do manual processing here. i.e. the result of a manual BugReport Task.
            }

            // Note that all of the interface objects have a built in ToString() which formats the fields suitably.
            BugTrackerTrace.LogMessage(BugTrackerTraceSeverity.Information, m_Control.PlugInName, "Product Added: " + product.ToString());
        }
Exemple #4
0
        public void ProductAdded(BugTrackerReportType reportType, BugTrackerProduct product)
        {
            m_ProductAddedCount++;

            if (product == null)
            {
                throw new ArgumentNullException("product");
            }

            if (m_Properties["ProductAddedException"] != null)
            {
                throw new ArgumentException("Test exception");
            }

            if (m_Properties["UnhandledException"] != null)
            {
                // Spawn a new thread to cause the exception.
                Thread exceptionThread = new Thread(delegate()
                {
                    throw new ArgumentException("Thread exception");
                });

                exceptionThread.Start();

                Thread.Sleep(2000);
                return;
            }

            BugTrackerTrace.LogMessage(BugTrackerTraceSeverity.Information, s_PlugInName, "Product Added: " + product.ToString());
        }
Exemple #5
0
        public void ProductUpdated(BugTrackerReportType reportType, BugTrackerProduct product)
        {
            if (product == null)
            {
                throw new ArgumentNullException("product");
            }

            BugTrackerTrace.LogMessage(BugTrackerTraceSeverity.Information, s_PlugInName, "Product Updated: " + product.ToString());
            if (product == null)
            {
                throw new ArgumentNullException("product");
            }

            m_ProductUpdatedCount++;
        }