Hi,
I would keep it simple and use the current form. It make it easy to run
the tests standalone.
dir = System.getProperty("test.dir", ".")
Adding in the additional "user.dir" variant just complicates the code
and understanding without improving the use cases. (by default
user.dir is set to the absolute pathname of ".").
$.02, Roger
On 4/26/17 5:51 AM, Daniel Fuchs wrote:
Hi,
Looking at the test - is it possible that "test.dir" is used here
simply to make it easier to run the test outside of jtreg - e.g. from
within an IDE like e.g. NetBeans? Then if so "test.dir" has probably
nothing to do with jtreg...
If you run a test (I mean its main() method) from within NetBeans, then
by default user.dir is set by NetBeans to the project's root directory.
That's usually not where you want to put your temporary test files.
So maybe the intent was to make it possible to specify something like
-Dtest.dir=build/scratch to the run environment when running the
test in standalone from within an IDE;
For practical purposes I suspect that using
System.getProperty("user.dir", ".") or directly using "." have the same
effect when running with jtreg.
So:
dir = System.getProperty("test.dir", ".")
dir = System.getProperty("test.dir", System.getProperty("user.dir",
"."));
dir = ".";
are probably all equivalent when running the test in jtreg.
hope this helps,
-- daniel
On 26/04/2017 06:49, Brian Burkhalter wrote:
Hi Amy,
The status of test.dir is a little vague to some of us right now.
Your comments are appreciated.
Brian
On Apr 25, 2017, at 6:32 PM, Amy Lu <amy...@oracle.com> wrote:
On 4/26/17 12:06 AM, Brian Burkhalter wrote:
Hi Amy,
I think test.dir is preferred in case the folder location is
specified to the harness.
Yes, makes sense.
(I'm not a reviewer.)
Thanks,
Amy
Brian
On Apr 24, 2017, at 8:22 PM, Amy Lu <amy...@oracle.com> wrote:
I noticed something else:
148 Path zpath = Paths.get(System.getProperty("test.dir",
"."),
272 Path zpath = Paths.get(System.getProperty("test.dir",
"."),
Is it better to use "user.dir" instead of "test.dir" here?
Thanks,
Amy
On 4/25/17 6:08 AM, Brian Burkhalter wrote:
This might not be enough or might be totally unnecessary but
could prove useful.
https://bugs.openjdk.java.net/browse/JDK-8179247
http://cr.openjdk.java.net/~bpb/8179247/webrev.00/
Thanks,
Brian