equal
deleted
inserted
replaced
21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
24 /* |
24 /* |
25 * @test |
25 * @test |
26 * @bug 8013827 8011950 |
26 * @bug 8013827 8011950 8017212 |
27 * @summary Check whether File.createTempFile can handle special parameters |
27 * @summary Check whether File.createTempFile can handle special parameters |
28 * on Windows platforms |
|
29 * @author Dan Xu |
28 * @author Dan Xu |
30 */ |
29 */ |
31 |
30 |
32 import java.io.File; |
31 import java.io.File; |
33 import java.io.IOException; |
32 import java.io.IOException; |
62 throw new RuntimeException(errMsg); |
61 throw new RuntimeException(errMsg); |
63 } |
62 } |
64 } |
63 } |
65 |
64 |
66 public static void main(String[] args) throws Exception { |
65 public static void main(String[] args) throws Exception { |
|
66 // Common test |
|
67 final String name = "SpecialTempFile"; |
|
68 File f = new File(System.getProperty("java.io.tmpdir"), name); |
|
69 if (!f.exists()) { |
|
70 f.createNewFile(); |
|
71 } |
|
72 String[] nulPre = { name + "\u0000" }; |
|
73 String[] nulSuf = { ".test" }; |
|
74 test("NulName", nulPre, nulSuf); |
|
75 |
|
76 // Windows tests |
67 if (!System.getProperty("os.name").startsWith("Windows")) |
77 if (!System.getProperty("os.name").startsWith("Windows")) |
68 return; |
78 return; |
69 |
79 |
70 // Test JDK-8013827 |
80 // Test JDK-8013827 |
71 String[] resvPre = { "LPT1.package.zip", "com7.4.package.zip" }; |
81 String[] resvPre = { "LPT1.package.zip", "com7.4.package.zip" }; |