示例#1
0
 private void Killing(ProcessEvent pEvent)
 {
     if (Name == pEvent.Name)
     {
         TransitionTo(m_StateKilling, s_TranIdx_Launched_Killing);
         PostFIFO(new ProcessEvent(InternalSignal.ProcessKilling, pEvent));
     }
 }
示例#2
0
 private void Launching(ProcessEvent pEvent)
 {
     if (Name == pEvent.Name)
     {
         TransitionTo(m_StateLaunching, s_TranIdx_Created_Launching);
         PostFIFO(new ProcessEvent(InternalSignal.ProcessLaunching, pEvent));
     }
 }
示例#3
0
 protected virtual void ProcessTimeout(ProcessEvent tEvent)
 {
     if ((Retries + 1) <= Test.Steps[CurrentStep].Retries)
     {
         Step(new TestEvent(InternalSignal.TestStep, Name), Retries + 1);
     }
     else
     {
         TransitionToFailed("Process did not launch successfully within timeout.");
     }
 }
示例#4
0
 private void Kill(ProcessEvent pEvent)
 {
     if (Name == pEvent.Name)
     {
         try
         {
             Process.Kill();
             TransitionTo(m_StateKilled, s_TranIdx_Killing_Killed);
         }
         catch (Exception ex)
         {
             TransitionTo(m_StateFaulted, s_TranIdx_Killing_Faulted);
         }
     }
 }
示例#5
0
 private void Launch(ProcessEvent pEvent)
 {
     if (Name == pEvent.Name)
     {
         try
         {
             Process.Launch(pEvent.CommandLine);
             TransitionTo(m_StateLaunched, s_TranIdx_Launching_Launched);
         }
         catch (Exception ex)
         {
             TransitionTo(m_StateFaulted, s_TranIdx_Launching_Faulted);
         }
     }
 }
示例#6
0
        internal ProcessEvent(InternalSignal signal, ProcessEvent source)
            : base((int)signal)
        {
            switch (signal)
            {
            case InternalSignal.ProcessKilling:
            case InternalSignal.ProcessLaunching:
                Name                  = source.Name;
                CommandLine           = source.CommandLine;
                Timeout               = source.Timeout;
                Error                 = source.Error;
                AdditionalDescription = source.AdditionalDescription;
                break;

            default:
                throw new ArgumentException("Invalid internal process signal.", "signal");
            }
        }