/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
@bug 4033560
@summary 4033560 limited args of exec to 198 on Solaris. We check
that we can actually exec more args than that.
@author Anand Palaniswamy
*/
public class ExecWithLotsOfArgs {
public static class EchoingHelper {
}
}
}
int n = 0;
/*
* The Java program to exec. This is slightly fragile. Works
* on Solaris and Win32.
*/
command[n++] = "-classpath";
}
/*
* The class with main() that the exec'd VM will run.
*/
command[n++] = "ExecWithLotsOfArgs$EchoingHelper";
/*
* Make a long set of args n, n + 1, ... , 300.
*/
}
/*
* Do the exec.
*/
(new InputStreamReader(p.getInputStream()));
/*
* Read back all the strings and that the same were returned.
*/
String s;
int count = n;
" strings to be echo'ed back, but got " +
}
failed("Exec'd process returned \"" +
s + "\", was expecting \"" +
}
count++;
}
/*
* Did we read anything at all?
*/
if (count == n) {
/* Try reading the error stream to see if we got any diagnostics */
}
failed("Exec'd process didn't writing anything to its stdout");
}
}
throw new RuntimeException("Failed: " + s);
}
}