Пример #1
0
        /// <summary>
        /// ContextLoaderStepBuilder constructor.
        /// </summary>
        ///
        /// <param name='typeName'>The type name of the test step to be created by the builder.</param>
        /// <param name='assemblyPath'>The assembly path name of the context loader sub step to
        /// be created by the builder.</param>
        public ContextLoaderStepBuilder(string typeName, string assemblyPath)
            : base(typeName, assemblyPath)
        {
            ArgumentValidation.CheckForEmptyString(typeName, "typeName");
            // assemblyPath - optional

            _contextLoaderStep = testStep as IContextLoaderStepOM;
            if (null == _contextLoaderStep)
            {
                throw new ArgumentException("The validation step created is invalid: IContextLoaderStepOM is not implemented");
            }
        }
Пример #2
0
        public void ExecuteContextLoader(Stream data, IContextLoaderStepOM contextLoaderStep, bool seekStream)
        {
            if (seekStream && null != data)
            {
                data.Seek(0, SeekOrigin.Begin);
            }

            _bizUnit.ExecuteContextLoader(data, contextLoaderStep, this);
        }
Пример #3
0
 public void ExecuteContextLoader(Stream data, IContextLoaderStepOM contextLoaderStep)
 {
     ExecuteContextLoader(data, contextLoaderStep, false);
 }
Пример #4
0
        public void ExecuteContextLoader(Stream data, XmlNode contextConfig, IContextLoaderStepOM contextLoaderStep, bool seekStream)
        {
            if (null != contextLoaderStep && null != contextConfig)
            {
                throw new ApplicationException(
                    "Cannot execute a context loader step using both Xml configuration and the BizUnit OM");
            }

            ExecuteContextLoader(data, contextLoaderStep, seekStream);
            ExecuteContextLoader(data, contextConfig, seekStream);
        }
Пример #5
0
 public void ExecuteContextLoader(Stream data, XmlNode contextConfig, IContextLoaderStepOM contextLoaderStep)
 {
     ExecuteContextLoader(data, contextConfig, contextLoaderStep, false);
 }
Пример #6
0
        internal void ExecuteContextLoader(Stream data, IContextLoaderStepOM contextLoaderStep, Context ctx)
        {
            if (null == contextLoaderStep)
            {
                return;
            }

            _logger.ContextLoaderStart(contextLoaderStep.GetType().ToString(), DateTime.Now);

            try
            {
                contextLoaderStep.ExecuteContextLoader(data, ctx);
            }
            catch (Exception ex)
            {
                _logger.ContextLoaderEnd(contextLoaderStep.GetType().ToString(), DateTime.Now, ex);
                throw;
            }

            _logger.ContextLoaderEnd(contextLoaderStep.GetType().ToString(), DateTime.Now, null);
        }