8010194: java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh fails with "Timed out waiting ..." (sol)

Reviewed-by: chegar
This commit is contained in:
Alan Bateman 2014-03-02 15:56:07 +00:00
parent 2b22a25617
commit 22bc40c071
2 changed files with 15 additions and 37 deletions
jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel

@ -22,8 +22,6 @@
*/
/*
*
*
* A Launcher to launch a java process with its standard input, output,
* and error streams connected to a socket.
*/
@ -40,24 +38,23 @@ public class Launcher {
private static native void launch0(String cmdarray[], int fd) throws IOException;
private static void launch(String className, String options[], String args[], int fd) throws IOException {
String[] javacmd = Util.javaCommand();
int options_len = (options == null) ? 0 : options.length;
int args_len = (args == null) ? 0 : args.length;
// java [-options] class [args...]
int len = javacmd.length + options_len + 1 + args_len;
int optsLen = (options == null) ? 0 : options.length;
int argsLen = (args == null) ? 0 : args.length;
int len = 1 + optsLen + 1 + argsLen;
String cmdarray[] = new String[len];
int pos = 0;
for (int i=0; i<javacmd.length; i++) {
cmdarray[pos++] = javacmd[i];
}
for (int i=0; i<options_len; i++) {
cmdarray[pos++] = options[i];
cmdarray[pos++] = Util.javaCommand();
if (options != null) {
for (String opt: options) {
cmdarray[pos++] = opt;
}
}
cmdarray[pos++] = className;
for (int i=0; i<args_len; i++) {
cmdarray[pos++] = args[i];
if (args != null) {
for (String arg: args) {
cmdarray[pos++] = arg;
}
}
launch0(cmdarray, fd);
}

@ -22,8 +22,6 @@
*/
/*
*
*
* A collection of utility methods used by the SelectorProvider.inheritedChannel
* unit tests.
*/
@ -91,26 +89,9 @@ public class Util {
/*
* Return the "java" command and any initial arguments to start the runtime
* in the current configuration.
*
* Typically it will return something like :-
* cmd[0] = "/usr/local/java/solaris-sparc/bin/java"
* or
* cmd[0] = "/usr/local/java/solaris-sparc/bin/sparcv9/java"
* cmd[1] = "-d64"
*/
public static String[] javaCommand() {
String exe = System.getProperty("java.home") + File.separator + "bin" +
File.separator;
String arch = System.getProperty("os.arch");
if (arch.equals("sparcv9")) {
String cmd[] = new String[2];
cmd[0] = exe + "sparcv9/java";
cmd[1] = "-d64";
return cmd;
} else {
String cmd[] = new String[1];
cmd[0] = exe += "java";
return cmd;
}
public static String javaCommand() {
return System.getProperty("java.home") + File.separator + "bin" +
File.separator + "java";
}
}