public void PopulateKillProcessThrowsExceptionForUnknownPlatform() { var killProcess = new Process(); var operatingSystem = new OperatingSystem(PlatformID.Xbox, new Version(5, 0)); Assert.Throws <CruiseControlException>( () => ProcessExecutor.PopulateKillProcess(killProcess, 1, operatingSystem)); }
public void PopulateKillProcessHandlesUnix() { var killProcess = new Process(); var operatingSystem = new OperatingSystem(PlatformID.Unix, new Version(7, 0)); var platform = ProcessExecutor.PopulateKillProcess(killProcess, 1, operatingSystem); Assert.AreEqual("Unix", platform); Assert.AreEqual("/usr/bin/pkill", killProcess.StartInfo.FileName); Assert.AreEqual("-9 -g 1", killProcess.StartInfo.Arguments); }
public void PopulateKillProcessHandlesWindows2000() { var killProcess = new Process(); var operatingSystem = new OperatingSystem(PlatformID.Win32NT, new Version(5, 0)); var platform = ProcessExecutor.PopulateKillProcess(killProcess, 1, operatingSystem); Assert.AreEqual("Windows", platform); var expectedPath = Path.Combine( ProcessExecutor.Win2KSupportToolsDir, "kill.exe"); Assert.AreEqual(expectedPath, killProcess.StartInfo.FileName); Assert.AreEqual("-f 1", killProcess.StartInfo.Arguments); }
public void PopulateKillProcessHandlesWindows() { var killProcess = new Process(); var operatingSystem = new OperatingSystem(PlatformID.Win32NT, new Version(7, 0)); var platform = ProcessExecutor.PopulateKillProcess(killProcess, 1, operatingSystem); Assert.AreEqual("Windows", platform); var expectedPath = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.System), "taskkill.exe"); Assert.AreEqual(expectedPath, killProcess.StartInfo.FileName); Assert.AreEqual("/pid 1 /t /f", killProcess.StartInfo.Arguments); }