jdk/test/javax/swing/JFileChooser/6396844/TwentyThousandTest.java
author dbuck
Tue, 18 Aug 2015 04:29:28 -0700
changeset 32417 6859107fc6c3
parent 31448 1066345d2a8a
child 40128 e635645d2a8a
permissions -rw-r--r--
8133666: OperatingSystemMXBean reports abnormally high machine CPU consumption on Linux Reviewed-by: sla, mgronlun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
     1
/*
31448
1066345d2a8a 8076468: Add @modules to tests in jdk_desktop test group
yan
parents: 11808
diff changeset
     2
 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
     4
 *
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
     7
 * published by the Free Software Foundation.
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
     8
 *
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    13
 * accompanied this code).
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    14
 *
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    18
 *
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    21
 * questions.
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    22
 */
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    23
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    24
/*
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    25
 * @test
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    26
 * @bug 6396844
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    27
 * @summary Tests memory leak for 20000 files
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    28
 * @author Sergey Malenkov
11808
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
    29
 * @library ../../regtesthelpers
31448
1066345d2a8a 8076468: Add @modules to tests in jdk_desktop test group
yan
parents: 11808
diff changeset
    30
 * @modules java.desktop/sun.java2d
11808
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
    31
 * @build Util
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
    32
 * @run main/othervm/timeout=1000 -mx128m TwentyThousandTest
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    33
 */
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    34
11808
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
    35
import sun.java2d.Disposer;
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
    36
import sun.java2d.DisposerRecord;
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
    37
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    38
import javax.swing.*;
11808
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
    39
import java.awt.event.HierarchyEvent;
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
    40
import java.awt.event.HierarchyListener;
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    41
import java.io.File;
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    42
import java.io.FileWriter;
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    43
11808
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
    44
public class TwentyThousandTest {
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    45
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    46
    private static final int FILES = 20000;
11808
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
    47
    private static final int ATTEMPTS = 20;
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    48
    private static final int INTERVAL = 100;
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    49
11808
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
    50
    private static String tmpDir;
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    51
11808
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
    52
    private static volatile boolean disposerComplete;
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    53
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    54
    public static void main(String[] args) throws Exception {
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    55
        tmpDir = System.getProperty("java.io.tmpdir");
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    56
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    57
        if (tmpDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    58
            tmpDir = System.getProperty("user.home");
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    59
        }
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    60
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    61
        System.out.println("Temp directory: " + tmpDir);
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    62
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    63
        System.out.println("Creating " + FILES + " files");
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    64
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    65
        for (int i = 0; i < FILES; i++) {
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    66
            File file = getTempFile(i);
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    67
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    68
            FileWriter writer = new FileWriter(file);
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    69
            writer.write("File " + i);
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    70
            writer.close();
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    71
        }
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    72
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    73
        for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    74
            if (laf.getClassName().contains("Motif")) {
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    75
                continue;
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    76
            }
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    77
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    78
            UIManager.setLookAndFeel(laf.getClassName());
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    79
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    80
            System.out.println("Do " + ATTEMPTS + " attempts for " + laf.getClassName());
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    81
11808
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
    82
            for (int i = 0; i < ATTEMPTS; i++) {
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    83
                System.out.print(i + " ");
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    84
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    85
                doAttempt();
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    86
            }
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    87
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    88
            System.out.println();
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    89
        }
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    90
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    91
        System.out.println("Removing " + FILES + " files");
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    92
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    93
        for (int i = 0; i < FILES; i++) {
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    94
            getTempFile(i).delete();
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    95
        }
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    96
11808
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
    97
        System.out.println("Test passed successfully");
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    98
    }
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
    99
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   100
    private static File getTempFile(int i) {
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   101
        return new File(tmpDir, "temp" + i + ".txt");
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   102
    }
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   103
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   104
    private static void doAttempt() throws Exception {
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   105
        SwingUtilities.invokeAndWait(new Runnable() {
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   106
            public void run() {
11808
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   107
                final JFileChooser chooser = new JFileChooser(tmpDir);
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   108
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   109
                chooser.updateUI();
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   110
11808
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   111
                // Postpone JFileChooser closing until it becomes visible
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   112
                chooser.addHierarchyListener(new HierarchyListener() {
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   113
                    @Override
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   114
                    public void hierarchyChanged(HierarchyEvent e) {
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   115
                        if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   116
                            if (chooser.isShowing()) {
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   117
                                Thread thread = new Thread(new Runnable() {
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   118
                                    public void run() {
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   119
                                        try {
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   120
                                            Thread.sleep(INTERVAL);
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   121
11808
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   122
                                            // Close JFileChooser
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   123
                                            SwingUtilities.invokeLater(new Runnable() {
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   124
                                                public void run() {
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   125
                                                    chooser.cancelSelection();
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   126
                                                }
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   127
                                            });
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   128
                                        } catch (InterruptedException e) {
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   129
                                            throw new RuntimeException(e);
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   130
                                        }
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   131
                                    }
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   132
                                });
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   133
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   134
                                thread.start();
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   135
                            }
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   136
                        }
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   137
                    }
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   138
                });
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   139
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   140
                chooser.showOpenDialog(null);
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   141
            }
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   142
        });
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   143
11808
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   144
        DisposerRecord disposerRecord = new DisposerRecord() {
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   145
            public void dispose() {
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   146
                disposerComplete = true;
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   147
            }
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   148
        };
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   149
11808
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   150
        disposerComplete = false;
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   151
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   152
        Disposer.addRecord(new Object(), disposerRecord);
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   153
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   154
        while (!disposerComplete) {
2cb1b29556f2 7071775: javax/swing/JFileChooser/6396844/TwentyThousandTest.java failed on winxp
rupashka
parents: 6831
diff changeset
   155
            Util.generateOOME();
6831
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   156
        }
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   157
    }
909ae26cecce 6979793: closed/javax/swing/JFileChooser/6396844/TwentyThousandTest fails due FileNotFound exc.
rupashka
parents:
diff changeset
   158
}