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);
        }
Esempio n. 2
0
 public void SequenceGroupDeserialize()
 {
     ISequenceGroup sequenceGroup = _sequenceManager.RuntimeDeserializeSequenceGroup(JsonStrResource.sequenceGroup1Json);
 }