private void HandleError(object sender, QaErrorEventArgs e)
 {
     if (!ProcessQaError(e.QaError))
     {
         e.Cancel = true;
     }
 }
Beispiel #2
0
        private void test_QaError(object sender, QaErrorEventArgs errorEventArgs)
        {
            _errorEventCount++;

            bool cancel = _errorAdministrator.IsDuplicate(errorEventArgs.QaError);

            if (!cancel)
            {
                OnQaError(errorEventArgs);
                cancel = errorEventArgs.Cancel;
            }

            if (!cancel)
            {
                _errorAdministrator.Add(errorEventArgs.QaError, isKnonwnNotDuplicate: true);
            }
            else
            {
                _cancelledErrorCount++;
            }

            if (!_keepErrorGeometry)
            {
                errorEventArgs.QaError.ReduceGeometry();
            }
        }
Beispiel #3
0
 private void OnQaError(QaErrorEventArgs e)
 {
     if (QaError != null)
     {
         QaError(this, e);
     }
 }
Beispiel #4
0
        private void Test_QaFormatError(object sender, QaErrorEventArgs e)
        {
            string expected = string.Format("Segment length {0}  < {1} ", 0.3, 0.5);

            Assert.AreEqual(expected, e.QaError.Description);
            _errorCount++;
        }
        private bool ProcessQaError([NotNull] QaError qaError)
        {
            Assert.ArgumentNotNull(qaError, nameof(qaError));

            if (_msg.IsVerboseDebugEnabled)
            {
                _msg.DebugFormat("Issue found: {0}", qaError);
            }

            // TODO: Consider checking basic relevance (inside test perimeter?) here

            var eventArgs = new QaErrorEventArgs(qaError);

            QaError?.Invoke(this, eventArgs);

            if (eventArgs.Cancel)
            {
                return(false);
            }

            ITest test = qaError.Test;
            QualityConditionVerification conditionVerification =
                GetQualityConditionVerification(test);
            QualityCondition qualityCondition = conditionVerification.QualityCondition;

            Assert.NotNull(qualityCondition, "no quality condition for verification");

            StopInfo stopInfo = null;

            if (conditionVerification.StopOnError)
            {
                stopInfo = new StopInfo(qualityCondition, qaError.Description);

                foreach (InvolvedRow involvedRow in qaError.InvolvedRows)
                {
                    RowsWithStopConditions.Add(involvedRow.TableName,
                                               involvedRow.OID, stopInfo);
                }
            }

            if (!conditionVerification.AllowErrors)
            {
                conditionVerification.Fulfilled = false;

                if (stopInfo != null)
                {
                    // it's a stop condition, and it is a 'hard' condition, and the error is
                    // relevant --> consider the stop situation as sufficiently reported
                    // (no reporting in case of stopped tests required)
                    stopInfo.Reported = true;
                }
            }

            return(true);
        }
Beispiel #6
0
        public void Process([NotNull] QaErrorEventArgs args)
        {
            Assert.ArgumentNotNull(args, nameof(args));

            QaError qaError = args.QaError;

            QualitySpecificationElement element = _elementsByTest[qaError.Test];

            QualityCondition qualityCondition = element.QualityCondition;

            if (element.StopOnError)
            {
                foreach (InvolvedRow involvedRow in qaError.InvolvedRows)
                {
                    var stopInfo = new StopInfo(qualityCondition, qaError.Description);
                    _rowsWithStopConditions.Add(involvedRow.TableName, involvedRow.OID,
                                                stopInfo);
                }
            }

            if (IsIssueGeometryOutsideTestPerimeter(qaError, qualityCondition))
            {
                args.Cancel = true;
                return;
            }

            IssueStats issueStats = GetIssueStats(qualityCondition);

            if (ExistsExceptionFor(qaError, element))
            {
                issueStats.AddException();
                return;
            }

            issueStats.AddIssue();

            if (element.AllowErrors)
            {
                WarningCount++;
            }
            else
            {
                ErrorCount++;
                Fulfilled = false;
            }

            _issueWriter.WriteIssue(qaError, element);
        }
        protected void ProcessError(object sender, QaErrorEventArgs e)
        {
            QaError error = e.QaError;

            _errors.Add(error);

            if (KeepGeometry)
            {
                _errorGeometries.Add(error.Geometry);
            }

            if (LogErrors)
            {
                TestRunnerUtils.PrintError(error);
            }
        }
Beispiel #8
0
        public void TestContainer_QaError(object sender, QaErrorEventArgs e)
        {
            esriGeometryType geomType;

            if (e.QaError.Geometry != null)
            {
                geomType = e.QaError.Geometry.GeometryType;
            }
            else
            {
                geomType = esriGeometryType.esriGeometryNull;
            }

            ErrorTable errorTable;

            if (!_errorTables.TryGetValue(geomType, out errorTable))
            {
                errorTable = new ErrorTable(_ws, geomType.ToString(), geomType);
                _errorTables.Add(geomType, errorTable);
            }

            errorTable.Add(e.QaError);
        }
Beispiel #9
0
 private void Test_QaError(object sender, QaErrorEventArgs e)
 {
     _lastErrorPoint = (IPoint)e.QaError.Geometry;
     _errorCount++;
 }