RFE 4519026: (process) Process should support Unicode on Win NT, request for review
martinrb at google.com
Fri Mar 27 18:10:54 UTC 2009
I mostly agree with Alan's comments, and add to them as follows:
Please remove trailing whitespace, in accordance with Sun coding standards.
I agree we should not be trying to invoke our own JDK in a subprocess
in a test with Unicode arguments until we fix the launcher.
In the meantime, I suggest this testing strategy:
- Create a subdirectory named X
- Create a bat file in X named Y.BAT which does something like MKDIR %1
- Have the test invoke X/Y.BAT with current dir X, and argument Z.
- After the subprocess returns, check that directory X/Z has been created.
- Have X, Y, and Z contain the most troublesome Unicode characters available.
This avoids encoding issues on any pipes between the process and the subprocess.
Communicate only through arguments, working directory, and the file system!
On Wed, Mar 25, 2009 at 02:22, Heiko Wagner <heiko.wagner at apis.de> wrote:
> Hi Martin,
> I have updated http://www.apis.de/pub/jdk7/ProcessImpl_md.c and
> - fix block comment style
> - remove note about Win95, since minumum system requirement is Win2000
> - replace comment "selected based on exe type" with "creation flags"
> I have also been thinking about adding tests to ProcessBuilder/Basic.java.
> My suggestion would be to start from the version Alan made, to get the
> environment issue working. I would like to stick with your test pattern of
> starting a java process in the test. To show that we are now using
> CreateProcessW, I would start a java with Runtime.getRuntime().exec()
> having its working dir set to a, previously created, directory containing
> unicode characters and do a "pwd" operation in the java child.
> Although it is also possible to have the actual exe reside on a unicode path
> and pass unicode command line args, currently it is not possible to use this
> test pattern, as it needs additional modifications to the java launcher and
> java vm. What would you suggest to test this features, until we have a fully
> unicode aware version of java.exe?
> -----Original Message-----
> From: Martin Buchholz [mailto:martinrb at google.com]
> Sent: Montag, 23. März 2009 04:24
> To: Heiko Wagner
> Cc: core-libs-dev at openjdk.java.net; Xueming Shen; Alan Bateman
> Subject: Re: RFE 4519026: (process) Process should support Unicode on
> Win NT, request for review
> Thanks for your continuing work on this.
> ProcessBuilder/Basic.java has most of the tests related to
> subprocesses. I can't explain a return code of 6,
> since the test uses 5, 7, and 8.
> ProcessBuilder has a lot of infrastructure to help you write
> a test in this area, but it can be intimidating to newcomers
> (i.e. anyone but myself).
> The JDK C code is quite inconsistent, but please use the style
> * comments
> * here
> for block comments, and /* inline comments */ like this.
> You need to remove the comment
> /* selected based on exe type */
> which is no longer correct.
> If you fix the style things, and get the tests to pass,
> and add a test for what you're actually trying to fix,
> I am ready to approve the change.
More information about the core-libs-dev