harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r680991 - /harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/ProcessBuilderTest.java
Date Wed, 30 Jul 2008 12:01:42 GMT
Author: tellison
Date: Wed Jul 30 05:01:40 2008
New Revision: 680991

URL: http://svn.apache.org/viewvc?rev=680991&view=rev
Log:
Make the ProcessBuilder test more robust.
Wait until the process has run to completion before looking for its output.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/ProcessBuilderTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/ProcessBuilderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/ProcessBuilderTest.java?rev=680991&r1=680990&r2=680991&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/ProcessBuilderTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/ProcessBuilderTest.java
Wed Jul 30 05:01:40 2008
@@ -154,6 +154,16 @@
         Process process = pb.start();
         InputStream in = process.getInputStream();
         InputStream err = process.getErrorStream();
+
+        while (true) {
+            try {
+                process.waitFor();
+                break;
+            } catch (InterruptedException e) {
+                // Ignored
+            }
+        }
+
         byte[] buf = new byte[1024];
         if (in.available() > 0) {
             assertTrue(in.read(buf) > 0);



Mime
View raw message