mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 18:14:38 +02:00
8269929: (test) Add diagnostic info to ProceessBuilder/Basic.java for unexpected output
Reviewed-by: iris, bpb, naoto
This commit is contained in:
parent
6000950b33
commit
c812bbbe8f
1 changed files with 7 additions and 2 deletions
|
@ -899,6 +899,7 @@ public class Basic {
|
||||||
} catch (Throwable t) { unexpected(t); return ""; }
|
} catch (Throwable t) { unexpected(t); return ""; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("removal")
|
||||||
static void testIORedirection() throws Throwable {
|
static void testIORedirection() throws Throwable {
|
||||||
final File ifile = new File("ifile");
|
final File ifile = new File("ifile");
|
||||||
final File ofile = new File("ofile");
|
final File ofile = new File("ofile");
|
||||||
|
@ -1303,6 +1304,7 @@ public class Basic {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("removal")
|
||||||
private static void realMain(String[] args) throws Throwable {
|
private static void realMain(String[] args) throws Throwable {
|
||||||
if (Windows.is())
|
if (Windows.is())
|
||||||
System.out.println("This appears to be a Windows system.");
|
System.out.println("This appears to be a Windows system.");
|
||||||
|
@ -2184,7 +2186,9 @@ public class Basic {
|
||||||
}
|
}
|
||||||
if (r >= 0) {
|
if (r >= 0) {
|
||||||
// The child sent unexpected output; print it to diagnose
|
// The child sent unexpected output; print it to diagnose
|
||||||
System.out.println("Unexpected child output:");
|
System.out.println("Unexpected child output, to: " +
|
||||||
|
((action & 0x1) == 0 ? "getInputStream" : "getErrorStream"));
|
||||||
|
System.out.println("Child args: " + childArgs);
|
||||||
if ((action & 0x2) == 0) {
|
if ((action & 0x2) == 0) {
|
||||||
System.out.write(r); // Single character
|
System.out.write(r); // Single character
|
||||||
|
|
||||||
|
@ -2205,7 +2209,7 @@ public class Basic {
|
||||||
|
|
||||||
thread.start();
|
thread.start();
|
||||||
latch.await();
|
latch.await();
|
||||||
Thread.sleep(10);
|
Thread.sleep(30);
|
||||||
|
|
||||||
if (s instanceof BufferedInputStream) {
|
if (s instanceof BufferedInputStream) {
|
||||||
// Wait until after the s.read occurs in "thread" by
|
// Wait until after the s.read occurs in "thread" by
|
||||||
|
@ -2662,6 +2666,7 @@ public class Basic {
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
// A Policy class designed to make permissions fiddling very easy.
|
// A Policy class designed to make permissions fiddling very easy.
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
@SuppressWarnings("removal")
|
||||||
private static class Policy extends java.security.Policy {
|
private static class Policy extends java.security.Policy {
|
||||||
static final java.security.Policy DEFAULT_POLICY = java.security.Policy.getPolicy();
|
static final java.security.Policy DEFAULT_POLICY = java.security.Policy.getPolicy();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue