6845805: Test for CR 6713352 is failed under Linux
authorrupashka
Thu, 28 May 2009 18:11:07 +0400
changeset 2818 c59bda501419
parent 2817 f171f2417978
child 2819 9a263275119d
child 2956 931f209e57a9
6845805: Test for CR 6713352 is failed under Linux Reviewed-by: malenkov
jdk/test/javax/swing/JFileChooser/6713352/bug6713352.java
--- a/jdk/test/javax/swing/JFileChooser/6713352/bug6713352.java	Fri May 15 17:26:45 2009 +0400
+++ b/jdk/test/javax/swing/JFileChooser/6713352/bug6713352.java	Thu May 28 18:11:07 2009 +0400
@@ -40,6 +40,12 @@
     public static void main(String[] args) throws Exception {
         SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
+                String tempDir = System.getProperty("java.io.tmpdir");
+
+                if (tempDir == null || !new File(tempDir).isDirectory()) {
+                    tempDir = System.getProperty("user.home");
+                }
+
                 MyFileSystemView systemView = new MyFileSystemView();
 
                 synchronized (systemView) { // Get SystemView lock
@@ -56,7 +62,7 @@
                     try {
                         System.out.println("Try to get Invokers lock");
 
-                        ShellFolder.getShellFolder(new File("c:/")).listFiles(true);
+                        ShellFolder.getShellFolder(new File(tempDir)).listFiles(true);
                     } catch (FileNotFoundException e) {
                         throw new RuntimeException(e);
                     }