public void testFileCreation() { ProcessUtil pu = new ProcessUtil("1234", devNull, devNull, dir); File winKill; winKill = pu.getWindowsKillFile(wk); assertTrue(winKill.exists()); winKill.delete(); assertFalse(winKill.exists()); winKill = pu.getWindowsKillFile(wk); assertTrue(winKill.exists()); } }
public void testFileCreation() { ProcessUtil pu = new ProcessUtil("1234", null, null); File winKill; winKill = pu.getWindowsKillFile(); assertTrue(winKill.exists()); winKill.delete(); assertFalse(winKill.exists()); winKill = pu.getWindowsKillFile(); assertTrue(winKill.exists()); } }
public void testKillCommandLineWindows() { Utils utils = new Utils(); utils.setFiles(new Files() { public boolean isWindows() { return true; } }); String pid = "2342"; ProcessUtil kp = new ProcessUtil(pid, devNull, devNull, dir, utils, wk); String[] args = kp.killArgs(false); assertTrue(args[0], args[0].endsWith("kill.exe")); assertEquals(pid, args[args.length - 1]); }
public void testKillCommandLineWindows() { FileUtil fu = new FileUtil() { public boolean isWindows() { return true; } }; String pid = "2342"; ProcessUtil kp = new ProcessUtil(fu, pid, null, null, new Str(), null, new Streams(), null); String[] args = kp.killArgs(false); assertTrue(args[0], args[0].endsWith("kill.exe")); assertEquals(pid, args[args.length - 1]); }