Exemplo n.º 1
0
        internal void ExecuteValidator(Stream data, XmlNode validatorConfig, Context ctx)
        {
            if (null == validatorConfig)
            {
                return;
            }

            XmlNode assemblyPath = validatorConfig.SelectSingleNode("@assemblyPath");
            XmlNode typeName = validatorConfig.SelectSingleNode("@typeName");

            _logger.ValidatorStart(typeName.Value, DateTime.Now);

            try
            {
                IValidationStep v = CreateValidatorStep(typeName.Value, assemblyPath.Value);
                v.ExecuteValidation(data, validatorConfig, ctx);
            }
            catch(Exception ex)
            {
                _logger.ValidatorEnd(typeName.Value, DateTime.Now, ex);
                var vsee = new ValidationStepExecutionException("BizUnit encountered an error executing a validation step", ex, _testName);
                throw vsee;
            }

            _logger.ValidatorEnd(typeName.Value, DateTime.Now, null);
        }
Exemplo n.º 2
0
        internal void ExecuteValidator(Stream data, IValidationStepOM validationStep, Context ctx)
        {
            if (null == validationStep)
            {
                return;
            }

            _logger.ValidatorStart(validationStep.GetType().ToString(), DateTime.Now);

            try
            {
                validationStep.ExecuteValidation(data, ctx);
            }
            catch(Exception ex)
            {
                _logger.ValidatorEnd(validationStep.GetType().ToString(), DateTime.Now, ex);

                var vsee = new ValidationStepExecutionException("BizUnit encountered an error executing a validation step", ex, _testName);
                throw vsee;
            }

            _logger.ValidatorEnd(validationStep.GetType().ToString(), DateTime.Now, null);
        }