@Test public void executeCommand() { AppInfo app = new AppInfo(); if (SystemUtil.getOsInfo().isWindows()) { app.setProcessable(new ProcessClosure()); String cmd = "ipconfig"; String result = app.executeCommand(cmd); assertTrue(ObjectUtil.isNotEmpty(result)); return; } app.setProcessable(new ShellClosure()); String cmd = "/sbin/ifconfig"; String result = app.executeCommand(cmd); assertTrue(ObjectUtil.isNotEmpty(result)); }
public String executeCommand(String command) { processable.execute(command); return processable.getInfo(); }
AppInfo { public String executeCommand(String command) { processable.execute(command); return processable.getInfo(); } }
AppInfo { public String executeCommand(String command) { processable.execute(command); return processable.getInfo(); } AppInfo(); }
AppInfo { public String executeCommand(String command) { processable.execute(command); return processable.getInfo(); } AppInfo(); String executeCommand(String command); String executeCommands(String commands); String executeCommands(String commands, String separator); void setLocation(String location); String getAppVersion(); static Logger getLogger(); String getSpecificationTitle(); String getSpecificationVersion(); String getSpecificationVendor(); String getImplementationTitle(); String getImplementationVersion(); String getImplementationVendor(); void setAppVersion(String appVersion); String toString(); void setProcessable(Processable processable); }
AppInfo { public String executeCommand(String command) { processable.execute(command); return processable.getInfo(); } AppInfo(); String executeCommand(String command); String executeCommands(String commands); String executeCommands(String commands, String separator); void setLocation(String location); String getAppVersion(); static Logger getLogger(); String getSpecificationTitle(); String getSpecificationVersion(); String getSpecificationVendor(); String getImplementationTitle(); String getImplementationVersion(); String getImplementationVendor(); void setAppVersion(String appVersion); String toString(); void setProcessable(Processable processable);  }