public static void Abort(string uutName, string reason) { if (string.IsNullOrEmpty(uutName)) { throw new ArgumentNullException("uutName", "A unique UUT name must be provided."); } if (string.IsNullOrEmpty(reason)) { throw new ArgumentNullException("reason", "An abort reason must be provided."); } if (!manager.activeUUTs.ContainsKey(uutName)) { throw new InvalidOperationException("An ActiveUUT must first be loaded."); } qf4net.QF.Instance.Publish(new TestEvent(QFSignal.TestAbort, uutName, reason)); ActiveUUT aUUT = manager.activeUUTs[uutName]; while (!aUUT.IsInState(aUUT.m_StateEnded)) { System.Threading.Thread.Sleep(1); } manager.activeUUTs[uutName].Dispose(); manager.activeUUTs.Remove(uutName); }
public static void Run(string uutName) { ActiveUUT aUUT = manager.activeUUTs[uutName]; if (string.IsNullOrEmpty(uutName)) { throw new ArgumentNullException("uutName", "A unique Test name must be provided."); } if (!manager.activeUUTs.ContainsKey(uutName)) { throw new InvalidOperationException("An activeUUT must first be loaded."); } if (!aUUT.IsInState(aUUT.m_StateLoaded)) { throw new InvalidOperationException("The Test cannot be ran. It has not been loaded."); } if (manager.activeUUTs[uutName].CurrentStateName == "ActiveTest_Loaded") { qf4net.QF.Instance.Publish(new TestEvent(QFSignal.TestRun, uutName)); while ((!aUUT.IsInState(aUUT.m_StateEnded)) && (!aUUT.IsInState(aUUT.m_StateRunning))) { System.Threading.Thread.Sleep(1); } } }
public static void Load(string uutName, string responseFilePath, DataLayer.Test test, UUTTestMode mode) { if (test == null) { throw new ArgumentNullException("test", "A valid Test must be provided."); } if ((string.IsNullOrEmpty(uutName) || manager.activeUUTs.ContainsKey(uutName))) { throw new ArgumentNullException("Test.Name", "An ActiveUUT must have a unique name."); } manager.activeUUTs.Add(uutName, new ActiveUUT(uutName, responseFilePath, test, mode)); manager.activeUUTs[uutName].Start(manager.priority++); ActiveUUT aUUT = manager.activeUUTs[uutName]; while ((!aUUT.IsInState(aUUT.m_StateEnded)) && (!aUUT.IsInState(aUUT.m_StateLoaded))) { System.Threading.Thread.Sleep(1); } }
public static void End(string name) { if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException("uutName", "A unique Test name must be provided."); } if (!manager.activeUUTs.ContainsKey(name)) { throw new InvalidOperationException("An ActiveUUT must first be loaded."); } ActiveUUT aUUT = manager.activeUUTs[name]; if (!aUUT.IsInState(aUUT.m_StateEnded)) { throw new InvalidOperationException("ActiveUUT cannot be ended. It is not in the ended state. Use Abort instead."); } manager.activeUUTs[name].Dispose(); manager.activeUUTs.Remove(name); }