Amy,
thanks for the comments.
On 2017/6/6 10:37, Amy Lu wrote:
sun/net/www/protocol/file/DirPermissionDenied.java
+
+ @BeforeTest
+ public void setup() throws Throwable {
+ // mkdir and chmod "333"
+ Files.createDirectories(TEST_DIR);
+ ProcessTools.executeCommand("chmod", "333", TEST_DIR.toString()) Maybe just
do this with java api instead run chmod command?
As I know, there is no straight and exact replacement for chmod in java.
Java provides PosixFilePermissions on Unix/Linux platforms. But on
windows, File.set* looks a bit different. So, IMO, chmod is probably a
nature choice.
-Felix
+
+ @AfterTest
+ public void tearDown() throws IOException {
+ if (Files.exists(TEST_DIR)) {
+ Files.delete(TEST_DIR);
+ }
+ }
Missed "Add back read access" before trying to delete it?
Based on my test results (local and JPRT), it deleted w/o any
exceptions. This was originally added by Max in
https://bugs.openjdk.java.net/browse/JDK-7078355.
TO Max, could you comment if such chmod is still necessary?
If yes, since this is just for test clean-up rather than a part of test
logic, is it enough with "File.setReadable(...)"?
-Felix
Thanks,
Amy
On 6/6/17 9:33 AM, Felix Yang wrote:
Thanks:-)
-Felix
On 2017/6/1 16:32, Felix Yang wrote:
Hi there,
please review the patch convert several sun/net shell tests to
plain java tests.
Bug:
https://bugs.openjdk.java.net/browse/JDK-8181080
Webrev:
http://cr.openjdk.java.net/~xiaofeya/8181080/webrev.00/
Thanks,
Felix