[prev in list] [next in list] [prev in thread] [next in thread]
List: jakarta-commons-dev
Subject: svn commit: r1098095 -
From: mturk () apache ! org
Date: 2011-04-30 10:33:54
Message-ID: 20110430103354.CAE962388A19 () eris ! apache ! org
[Download RAW message or body]
Author: mturk
Date: Sat Apr 30 10:33:54 2011
New Revision: 1098095
URL: http://svn.apache.org/viewvc?rev=1098095&view=rev
Log:
Add exec I/O test
Modified:
commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestExec.java
Modified: commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestExec.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestExec.java?rev=1098095&r1=1098094&r2=1098095&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestExec.java \
(original)
+++ commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestExec.java \
Sat Apr 30 10:33:54 2011 @@ -46,6 +46,23 @@ public class TestExec extends Assert
System.out.println(new String(os.toByteArray()));
}
+ @Test(groups = { "posix" })
+ public void runCat()
+ throws Exception
+ {
+ Exec e = Exec.newInstance();
+ assertNotNull(e);
+ ArrayList<String> args = new ArrayList<String>();
+ args.add("/bin/cat");
+ e.setInput("hello world".getBytes());
+ e.redirectOutputStream(true);
+ int r = e.run(args);
+ assertEquals(r, Status.CHILD_DONE);
+ ByteArrayOutputStream os = (ByteArrayOutputStream)e.getOutputStream();
+ String rs = new String(os.toByteArray());
+ assertEquals(rs, "hello world");
+ }
+
@Test(groups = { "windows" })
public void runWindows()
throws Exception
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic