< prev index next >

test/javax/swing/JFileChooser/8152677/SelectAllFilesFilterTest.java

Print this page
rev 17561 : 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
Summary: Add new keyword 'printer'. Some minor test fixes to show headless exception. Add some @requires windows.
   1 /*
   2  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.awt.Component;
  25 import java.awt.Container;
  26 import java.awt.Robot;
  27 import javax.swing.JComboBox;
  28 import javax.swing.JFileChooser;
  29 import javax.swing.JLabel;
  30 import javax.swing.SwingUtilities;
  31 import javax.swing.filechooser.FileFilter;
  32 import javax.swing.filechooser.FileNameExtensionFilter;
  33 
  34 /*
  35  * @test

  36  * @bug 8152677
  37  * @requires (os.family == "mac")
  38  * @summary [macosx] All files filter can't be selected in JFileChooser
  39  * @run main SelectAllFilesFilterTest
  40  */
  41 
  42 public class SelectAllFilesFilterTest {
  43 
  44     private static final String LABEL_TEXT = "File Format:";
  45     private static volatile JFileChooser fileChooser;
  46     private static JComboBox comboBox;
  47 
  48     public static void main(String[] args) throws Exception {
  49 
  50         SwingUtilities.invokeLater(SelectAllFilesFilterTest::createAndShowGUI);
  51 
  52         while (fileChooser == null) {
  53             Thread.sleep(100);
  54         }
  55 


   1 /*
   2  * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.awt.Component;
  25 import java.awt.Container;
  26 import java.awt.Robot;
  27 import javax.swing.JComboBox;
  28 import javax.swing.JFileChooser;
  29 import javax.swing.JLabel;
  30 import javax.swing.SwingUtilities;
  31 import javax.swing.filechooser.FileFilter;
  32 import javax.swing.filechooser.FileNameExtensionFilter;
  33 
  34 /**
  35  * @test
  36  * @key headful
  37  * @bug 8152677
  38  * @requires (os.family == "mac")
  39  * @summary [macosx] All files filter can't be selected in JFileChooser
  40  * @run main SelectAllFilesFilterTest
  41  */
  42 
  43 public class SelectAllFilesFilterTest {
  44 
  45     private static final String LABEL_TEXT = "File Format:";
  46     private static volatile JFileChooser fileChooser;
  47     private static JComboBox comboBox;
  48 
  49     public static void main(String[] args) throws Exception {
  50 
  51         SwingUtilities.invokeLater(SelectAllFilesFilterTest::createAndShowGUI);
  52 
  53         while (fileChooser == null) {
  54             Thread.sleep(100);
  55         }
  56 


< prev index next >