public RunnerServiceHandler(IStaticLoader loader, Server server)
 {
     _loader            = loader;
     this._server       = server;
     this._stepRegistry = loader.GetStepRegistry();
     this.InitializeMessageProcessors();
 }
示例#2
0
 public StaticLoader(IAttributesLoader attributesLoader, IDirectoryWrapper directoryWrapper)
 {
     _stepRegistry     = new StepRegistry();
     _attributesLoader = attributesLoader;
     _directoryWrapper = directoryWrapper;
     LoadImplementations();
 }
示例#3
0
        public IMessageProcessor GetProcessor(Message.Types.MessageType messageType, bool scan = false)
        {
            if (!scan)
            {
                return(!_messageProcessorsDictionary.ContainsKey(messageType)
                    ? new DefaultProcessor()
                    : _messageProcessorsDictionary[messageType]);
            }
            var activatorWrapper  = new ActivatorWrapper();
            var reflectionWrapper = new ReflectionWrapper();
            var assemblyLoader    = new AssemblyLoader(new AssemblyWrapper(),
                                                       new AssemblyLocater(new DirectoryWrapper(), new FileWrapper()).GetAllAssemblies(),
                                                       reflectionWrapper);

            _stepRegistry = assemblyLoader.GetStepRegistry();
            var tableFormatter       = new TableFormatter(assemblyLoader, activatorWrapper);
            var classInstanceManager = assemblyLoader.GetClassInstanceManager(activatorWrapper);

            InitializeExecutionMessageHandlers(reflectionWrapper, assemblyLoader, activatorWrapper, tableFormatter,
                                               classInstanceManager);

            return(!_messageProcessorsDictionary.ContainsKey(messageType)
                ? new DefaultProcessor()
                : _messageProcessorsDictionary[messageType]);
        }
示例#4
0
 public ExecuteStepProcessor(IStepRegistry registry, IExecutionOrchestrator executionOrchestrator,
                             ITableFormatter tableFormatter)
 {
     _stepRegistry          = registry;
     _tableFormatter        = tableFormatter;
     _executionOrchestrator = executionOrchestrator;
 }
示例#5
0
 public ExecuteStepProcessor(IStepRegistry stepRegistry, IMethodExecutor methodExecutor, ISandbox sandbox)
 {
     _stepRegistry   = stepRegistry;
     _methodExecutor = methodExecutor;
     _sandbox        = sandbox;
     InitializeConverter();
 }
        private void InitializeExecutionMessageHandlers()
        {
            var activatorWrapper  = new ActivatorWrapper();
            var reflectionWrapper = new ReflectionWrapper();
            var assemblies        = new AssemblyLocater(new DirectoryWrapper(), new FileWrapper()).GetAllAssemblies();
            var assemblyLoader    = new AssemblyLoader(new AssemblyWrapper(), assemblies, reflectionWrapper, activatorWrapper);

            _stepRegistry = assemblyLoader.GetStepRegistry();
            var tableFormatter        = new TableFormatter(assemblyLoader, activatorWrapper);
            var classInstanceManager  = assemblyLoader.GetClassInstanceManager();
            var executionOrchestrator = new ExecutionOrchestrator(reflectionWrapper, assemblyLoader, activatorWrapper,
                                                                  classInstanceManager,
                                                                  new HookExecutor(assemblyLoader, reflectionWrapper, classInstanceManager),
                                                                  new StepExecutor(assemblyLoader, reflectionWrapper, classInstanceManager));

            this.executionStartingProcessor         = new ExecutionStartingProcessor(executionOrchestrator);
            this.executionEndingProcessor           = new ExecutionEndingProcessor(executionOrchestrator);
            this.specExecutionStartingProcessor     = new SpecExecutionStartingProcessor(executionOrchestrator);
            this.specExecutionEndingProcessor       = new SpecExecutionEndingProcessor(executionOrchestrator);
            this.scenarioExecutionStartingProcessor = new ScenarioExecutionStartingProcessor(executionOrchestrator);
            this.scenarioExecutionEndingProcessor   = new ScenarioExecutionEndingProcessor(executionOrchestrator);
            this.stepExecutionStartingProcessor     = new StepExecutionStartingProcessor(executionOrchestrator);
            this.stepExecutionEndingProcessor       = new StepExecutionEndingProcessor(executionOrchestrator);
            this.executeStepProcessor           = new ExecuteStepProcessor(_stepRegistry, executionOrchestrator, tableFormatter);
            this.scenarioDataStoreInitProcessor = new ScenarioDataStoreInitProcessor(assemblyLoader);
            this.specDataStoreInitProcessor     = new SpecDataStoreInitProcessor(assemblyLoader);
            this.suiteDataStoreInitProcessor    = new SuiteDataStoreInitProcessor(assemblyLoader);
        }
 public AuthoringRunnerServiceHandler(IStaticLoader loader, ExecutorPool pool, IHostApplicationLifetime lifetime)
 {
     this._pool    = pool;
     this.lifetime = lifetime;
     this._loader  = loader;
     _stepRegistry = loader.GetStepRegistry();
     this.InitializeMessageProcessors();
 }
 public RunnerServiceHandler(IActivatorWrapper activationWrapper, IReflectionWrapper reflectionWrapper, IAssemblyLoader assemblyLoader, IStaticLoader loader, Server server)
 {
     this._loader            = loader;
     this._server            = server;
     this._activatorWrapper  = activationWrapper;
     this._reflectionWrapper = reflectionWrapper;
     this._assemblyLoader    = assemblyLoader;
     _stepRegistry           = assemblyLoader.GetStepRegistry();
     this.InitializeMessageProcessors();
 }
示例#9
0
        public AssemblyLoader(AssemblyPath assemblyPath, IGaugeLoadContext gaugeLoadContext,
                              IReflectionWrapper reflectionWrapper, IActivatorWrapper activatorWrapper, IStepRegistry registry)
        {
            _reflectionWrapper            = reflectionWrapper;
            _activatorWrapper             = activatorWrapper;
            AssembliesReferencingGaugeLib = new List <Assembly>();
            _registry = registry;

            Logger.Debug($"Loading assembly from : {assemblyPath}");
            _gaugeLoadContext       = gaugeLoadContext;
            this._targetLibAssembly = _gaugeLoadContext.LoadFromAssemblyName(new AssemblyName(GaugeLibAssemblyName));
            ScanAndLoad(assemblyPath);
            AssembliesReferencingGaugeLib = _gaugeLoadContext.GetAssembliesReferencingGaugeLib().ToList();
            Logger.Debug($"Number of AssembliesReferencingGaugeLib : {AssembliesReferencingGaugeLib.Count()}");
            SetDefaultTypes();
        }
示例#10
0
        public AssemblyLoader(IAssemblyWrapper assemblyWrapper, IEnumerable <string> assemblyLocations,
                              IReflectionWrapper reflectionWrapper, IActivatorWrapper activatorWrapper, IStepRegistry registry)
        {
            _assemblyWrapper              = assemblyWrapper;
            _reflectionWrapper            = reflectionWrapper;
            _activatorWrapper             = activatorWrapper;
            AssembliesReferencingGaugeLib = new List <Assembly>();
            _registry = registry;
            foreach (var location in assemblyLocations)
            {
                ScanAndLoad(location);
            }

            LoadTargetLibAssembly();
            SetDefaultTypes();
        }
        private Dictionary <Message.Types.MessageType, IMessageProcessor> InitializeMessageHandlers(
            IStepRegistry stepRegistry)
        {
            var methodExecutor  = new MethodExecutor(_sandbox);
            var messageHandlers = new Dictionary <Message.Types.MessageType, IMessageProcessor>
            {
                { Message.Types.MessageType.ExecutionStarting, new ExecutionStartingProcessor(methodExecutor) },
                { Message.Types.MessageType.ExecutionEnding, new ExecutionEndingProcessor(methodExecutor) },
                {
                    Message.Types.MessageType.SpecExecutionStarting,
                    new SpecExecutionStartingProcessor(methodExecutor, _sandbox)
                },
                {
                    Message.Types.MessageType.SpecExecutionEnding,
                    new SpecExecutionEndingProcessor(methodExecutor, _sandbox)
                },
                {
                    Message.Types.MessageType.ScenarioExecutionStarting,
                    new ScenarioExecutionStartingProcessor(methodExecutor, _sandbox)
                },
                {
                    Message.Types.MessageType.ScenarioExecutionEnding,
                    new ScenarioExecutionEndingProcessor(methodExecutor, _sandbox)
                },
                { Message.Types.MessageType.StepExecutionStarting, new StepExecutionStartingProcessor(methodExecutor) },
                { Message.Types.MessageType.StepExecutionEnding, new StepExecutionEndingProcessor(methodExecutor) },
                { Message.Types.MessageType.ExecuteStep, new ExecuteStepProcessor(stepRegistry, methodExecutor) },
                { Message.Types.MessageType.KillProcessRequest, new KillProcessProcessor() },
                { Message.Types.MessageType.StepNamesRequest, new StepNamesProcessor(_stepScanner) },
                { Message.Types.MessageType.StepValidateRequest, new StepValidationProcessor(stepRegistry) },
                { Message.Types.MessageType.ScenarioDataStoreInit, new ScenarioDataStoreInitProcessor(_sandbox) },
                { Message.Types.MessageType.SpecDataStoreInit, new SpecDataStoreInitProcessor(_sandbox) },
                { Message.Types.MessageType.SuiteDataStoreInit, new SuiteDataStoreInitProcessor(_sandbox) },
                { Message.Types.MessageType.StepNameRequest, new StepNameProcessor(stepRegistry) },
                { Message.Types.MessageType.RefactorRequest, new RefactorProcessor(stepRegistry, _sandbox) }
            };

            return(messageHandlers);
        }
 public StepNameProcessor(IStepRegistry stepRegistry)
 {
     _stepRegistry = stepRegistry;
 }
示例#13
0
 public StepValidationProcessor(IStepRegistry stepRegistry)
 {
     _stepRegistry = stepRegistry;
 }
示例#14
0
 public MessageProcessorFactory(IStepRegistry registry)
 {
     _stepRegistry = registry;
     _messageProcessorsDictionary = InitializeMessageHandlers();
 }
示例#15
0
 public StaticLoader()
 {
     _stepRegistry = new StepRegistry();
 }
示例#16
0
 public RefactorProcessor(IStepRegistry stepRegistry, ISandbox sandbox)
 {
     _stepRegistry = stepRegistry;
     _sandbox      = sandbox;
 }
示例#17
0
 public MessageProcessorFactory(IStaticLoader loader)
 {
     _loader       = loader;
     _stepRegistry = loader.GetStepRegistry();
     _messageProcessorsDictionary = InitializeMessageHandlers();
 }
示例#18
0
 public RefactorProcessor(IStepRegistry stepRegistry)
 {
     _stepRegistry = stepRegistry;
 }
示例#19
0
 public ExecuteStepProcessor(IStepRegistry stepRegistry, IMethodExecutor methodExecutor, ITableFormatter tableFormatter)
 {
     _tableFormatter = tableFormatter;
     _stepRegistry   = stepRegistry;
     _methodExecutor = methodExecutor;
 }
示例#20
0
 public StepPositionsProcessor(IStepRegistry stepRegistry)
 {
     _stepRegistry = stepRegistry;
 }
 public StepValidationProcessor(IStepRegistry stepMethodTable)
 {
     _stepMethodTable = stepMethodTable;
 }
示例#22
0
 public StaticLoader(IAttributesLoader attributesLoader)
 {
     _stepRegistry     = new StepRegistry();
     _attributesLoader = attributesLoader;
 }
示例#23
0
 public ExecuteStepProcessor(IStepRegistry stepRegistry, IMethodExecutor methodExecutor)
 {
     _stepRegistry   = stepRegistry;
     _methodExecutor = methodExecutor;
     InitializeConverter();
 }
示例#24
0
 public ExecuteStepProcessor(IStepRegistry stepRegistry, IMethodExecutor methodExecutor)
 {
     _stepRegistry   = stepRegistry;
     _methodExecutor = methodExecutor;
 }