public override void Initialize() { switch (Option.Mode) { case RunMode.Full: ConfigurationManager = new PlatformConfigManager(); LogService = new LogService(); ParameterChecker = new ParameterChecker.ParameterChecker(); ResultManager = new ResultManager.ResultManager(); ComInterfaceManager = new InterfaceManager(); SequenceManager = new SequenceManager.SequenceManager(); DataMaintainer = new DataMaintainer.DataMaintainer(); EngineController = new EngineHandle(); DesignTimeService = new DesignTimeService(); RuntimeService = new RuntimeService.RuntimeService(); break; case RunMode.Minimal: ConfigurationManager = new PlatformConfigManager(); LogService = new LogService(); ResultManager = new ResultManager.ResultManager(); SequenceManager = new SequenceManager.SequenceManager(); DataMaintainer = new DataMaintainer.DataMaintainer(); EngineController = new EngineHandle(); RuntimeService = new RuntimeService.RuntimeService(); break; default: throw new ArgumentOutOfRangeException(); } }
public SequenceDeserializeTest() { Type runnerType = typeof(TestflowRunner); TestflowRunnerOptions option = new TestflowRunnerOptions(); FieldInfo fieldInfo = runnerType.GetField("_runnerInst", BindingFlags.Static | BindingFlags.NonPublic); FakeTestflowRunner fakeTestflowRunner = new FakeTestflowRunner(option); fieldInfo.SetValue(null, fakeTestflowRunner); _sequenceManager = new SequenceManager.SequenceManager(); _configData = new TestConfigData(); _configData.InitExtendProperties(); _sequenceManager.ApplyConfig(_configData); Directory.CreateDirectory("Test"); }
protected override void FlowTaskAction() { Context.State = RuntimeState.Idle; // 打印状态日志 Context.LogSession.Print(LogLevel.Debug, Context.SessionId, "Wait for RmtGenMessage."); RmtGenMessage rmtGenMessage; // 等待接收到RmtGenMessage为止 while (null == (rmtGenMessage = Context.RmtGenMessage) && !Context.Cancellation.IsCancellationRequested) { Thread.Sleep(10); } // 如果被取消则直接返回 if (Context.Cancellation.IsCancellationRequested) { return; } // 打印状态日志 Context.LogSession.Print(LogLevel.Debug, Context.SessionId, "RmtGenMessage received."); SequenceManager.SequenceManager sequenceManager = new SequenceManager.SequenceManager(); Context.SequenceType = rmtGenMessage.SequenceType; if (rmtGenMessage.SequenceType == RunnerType.TestProject) { ITestProject testProject = sequenceManager.RuntimeDeserializeTestProject(rmtGenMessage.Sequence); Context.Sequence = testProject; Context.ExecutionModel = ExecutionModel.SequentialExecution; } else { ISequenceGroup sequenceGroup = sequenceManager.RuntimeDeserializeSequenceGroup(rmtGenMessage.Sequence); Context.Sequence = sequenceGroup; Context.ExecutionModel = sequenceGroup.ExecutionModel; } sequenceManager.Dispose(); Context.RmtGenMessage = null; this.Next = new TestGenerationFlowTask(Context); }