File tree 1 file changed +6
-4
lines changed
test/lib-test/jdk/test/lib/process
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 23
23
24
24
/*
25
25
* @test
26
- * @bug 8265227
26
+ * @bug 8265227 8266753
27
27
* @summary Test Proc
28
28
* @library /test/lib
29
29
*/
36
36
public class ProcTest {
37
37
public static void main (String [] args ) throws Exception {
38
38
if (args .length == 0 ) {
39
+ // Test launcher
39
40
Proc p1 = Proc .create ("ProcTest" )
40
- .args ("p1 " )
41
+ .args ("1 " )
41
42
.debug ("p1" )
42
43
.start ();
43
44
Proc p2 = Proc .create ("ProcTest" )
44
- .args ("p2 " )
45
+ .args ("2 " )
45
46
.debug ("p2" )
46
47
.start ();
47
48
while (true ) {
@@ -54,9 +55,10 @@ public static void main(String[] args) throws Exception {
54
55
p1 .waitFor ();
55
56
p2 .waitFor ();
56
57
} else {
58
+ // Sub process, args[0] is random seed.
57
59
List <String > gestures = List .of ("Rock" , "Paper" , "Scissors" );
58
60
int wins = 0 ;
59
- Random r = new Random ();
61
+ Random r = new Random (Long . parseLong ( args [ 0 ]) );
60
62
while (true ) {
61
63
String my = gestures .get (r .nextInt (3 ));
62
64
Proc .textOut (my ); // show first, next line might block
You can’t perform that action at this time.
0 commit comments