Пример #1
0
        protected override IGrinderWorker OnCreateWorkerRunnable()
        {
            Logger.Trace("OnCreateWorkerRunnable: Enter");
            var result = ScriptEngine.CreateWorkerRunnable();

            ProcessContext.InitializeAwareness(result);
            result.Initialize();
            Logger.Trace(m => m("OnCreateWorkerRunnable: Exit, Result = {0}", result));
            return(result);
        }
Пример #2
0
 protected override void OnInitialize()
 {
     Logger.Trace("OnInitialize: Enter");
     InitializeDebugger();
     InitializeBinPath();
     InitializeProcessContext();
     AppDomain.CurrentDomain.AssemblyResolve += OnAssemblyResolve;
     ScriptEngine = TypeHelper.CreateTargetTypeFromProperty <IGrinderScriptEngine>(Constants.ScriptEngineTypeKey, typeof(DefaultScriptEngine));
     ProcessContext.InitializeAwareness(ScriptEngine);
     ScriptEngine.Initialize();
     ProcessContext.DatapoolFactory.CreateMissingDatapoolsFromProperties();
     Logger.Trace("OnInitialize: Exit");
 }
Пример #3
0
        private void InitializeProcessContext()
        {
            Logger.Trace("InitializeProcessContext: Enter");
            var processContext = new ProcessContext
            {
                BinFolder       = BinPath[0],
                GrinderContext  = GrinderContext,
                DatapoolManager = new DatapoolManager(GrinderContext)
            };

            processContext.DatapoolFactory = new DatapoolFactory(GrinderContext, processContext.DatapoolManager);
            processContext.Freeze();
            ProcessContext = processContext;
            Logger.Trace("InitializeProcessContext: Exit");
        }
Пример #4
0
        internal static ProcessContext CreateProcessContext(
            string binFolder = null, 
            IDatapoolFactory datapoolFactory = null, 
            IDatapoolManager datapoolManager = null, 
            IGrinderContext grinderContext = null)
        {
            var processContext = new ProcessContext
            {
                BinFolder = binFolder,
                DatapoolFactory = datapoolFactory ?? new Mock<IDatapoolFactory>().Object,
                DatapoolManager = datapoolManager ?? new Mock<IDatapoolManager>().Object,
                GrinderContext = grinderContext ?? CreateContextMock().Object
            };

            processContext.Freeze();
            return processContext;
        }
Пример #5
0
        private void InitializeAndLogWorkers()
        {
            Logger.Trace("InitializeWorkers: Enter");
            int index = 0;

            foreach (var worker in workers)
            {
                index++;
                var logIndex  = index;
                var logWorker = worker;
                Logger.Info(m => m("Worker[{0}] = '{1}'", logIndex, logWorker.GetType().FullName));
                ProcessContext.InitializeAwareness(worker);
                worker.Initialize();
            }

            Logger.Trace("InitializeWorkers: Exit");
        }
        private ProcessContext CreateEditableProcessContext()
        {
            var processContext = new ProcessContext
            {
                BinFolder = binFolder,
                DatapoolFactory = datapoolFactoryMock.Object,
                DatapoolManager = datapoolManagerMock.Object,
                GrinderContext = grinderContextMock.Object,
            };

            return processContext;
        }
 private void InitializeProcessContext()
 {
     Logger.Trace("InitializeProcessContext: Enter");
     var processContext = new ProcessContext
     {
         BinFolder = BinPath[0],
         GrinderContext = GrinderContext,
         DatapoolManager = new DatapoolManager(GrinderContext)
     };
     processContext.DatapoolFactory = new DatapoolFactory(GrinderContext, processContext.DatapoolManager);
     processContext.Freeze();
     ProcessContext = processContext;
     Logger.Trace("InitializeProcessContext: Exit");
 }