harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r520880 - /harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/RuntimeTest2.java
Date Wed, 21 Mar 2007 13:29:37 GMT
Author: gshimansky
Date: Wed Mar 21 06:29:34 2007
New Revision: 520880

URL: http://svn.apache.org/viewvc?view=rev&rev=520880
Log:
Applied HARMONY-3456 [drlvm][kernel tests] java.lang.RuntimeTest2 fails intermittently


Modified:
    harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/RuntimeTest2.java

Modified: harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/RuntimeTest2.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/RuntimeTest2.java?view=diff&rev=520880&r1=520879&r2=520880
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/RuntimeTest2.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/RuntimeTest2.java Wed Mar 21 06:29:34
2007
@@ -386,9 +386,8 @@
                     } catch (Exception e) {
                     }
                 }
-                if (count == 0) {
-                    fail("exec(String[], String[], File).check001: where is " +
-                            "the date's answer/request?");
+                if (count < 0) {
+                    fail("check001: the date's reply has not been received");
                 }
 
                 int ia = is.available();
@@ -406,17 +405,6 @@
                     bb[ii] = (byte) 0;
                 }
 
-                // byte[] ans = {'1','1','-','1','3','-','0','4','\n'};
-                // os.write(ans);
-                // os.write('1');
-                // os.write('3');
-                // os.write('-');
-                // os.write('1');
-                // os.write('3');
-                // os.write('-');
-                // os.write('1');
-                // os.write('3');
-                // os.write('\n');
                 os.write('x');
                 os.write('x');
                 os.write('-');
@@ -428,17 +416,18 @@
                 os.write('\n');
                 os.flush();
 
-                // wait for is.available != 0
-                count = 100;
-                while (is.available() < 1 && count-- > 0) {
+                // wait for is.available > 9 which means that 'is' contains
+                // both the above written value and the consequent 
+                // 'date' command's reply
+                count = 300;
+                while (is.available() < 10 && count-- > 0) {
                     try {
                         Thread.sleep(200);
                     } catch (Exception e) {
                     }
                 }
-                if (count == 0) {
-                    fail("exec(String[], String[], File).check003: where is " +
-                            "the date's reaction on the incorrect entering?");
+                if (count < 0) {
+                    fail("check003: the date's reply has not been received");
                 }
                 ia = is.available();
                 byte[] bbb = new byte[ia];
@@ -446,8 +435,7 @@
                 r1 = new String(bbb);
                 if (r1.indexOf("The system cannot accept the date entered") == -1
                         && r1.indexOf("Enter the new date") == -1) {
-                    fail("exec(String[], String[], File).check004: where is " +
-                            "the date's reaction on the incorrect enterring?");
+                    fail("check004: unexpected output: " + r1);
                 }
                 os.write('\n');
                 try {



Mime
View raw message