public class TestCommand extends TestCase {
public void testEchoCommand() throws Exception{
String cmd = "cmd /c echo lee";
Process process = Runtime.getRuntime().exec(cmd);
process.waitFor();
int ret = process.exitValue();
System.out.println("exit value is " + ret);
InputStream is = process.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String line = br.readLine();
br.close();
is.close();
assertEquals("lee", line);
}
}