changeset 1298:019908df0313

6845805: Test for CR 6713352 is failed under Linux Reviewed-by: malenkov
author rupashka
date Thu, 28 May 2009 18:11:07 +0400
parents 993a5f0fe2e0
children 951ecbad4068 1bbbd0ef5d04
files test/javax/swing/JFileChooser/6713352/bug6713352.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/javax/swing/JFileChooser/6713352/bug6713352.java	Fri May 15 17:26:45 2009 +0400
+++ b/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);
                     }