jdk/test/javax/swing/Headless/HeadlessBox.java
author yan
Fri, 20 Jun 2014 16:48:30 +0400
changeset 25203 ea684628f900
child 30469 bac0a7ff7e1e
permissions -rw-r--r--
8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository Reviewed-by: pchelko, alexsch Contributed-by: Dmitriy Ermashov <dmitriy.ermashov@oracle.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25203
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     1
/*
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     2
 * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     4
 *
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     8
 *
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    13
 * accompanied this code).
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    14
 *
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    18
 *
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    21
 * questions.
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    22
 */
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    23
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    24
import javax.swing.*;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    25
import java.awt.*;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    26
import java.util.Locale;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    27
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    28
/*
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    29
 * @test
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    30
 * @summary Check that Box constructors and methods do not throw
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    31
 *          unexpected exceptions in headless mode
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    32
 * @run main/othervm -Djava.awt.headless=true HeadlessBox
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    33
 */
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    34
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    35
public class HeadlessBox {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    36
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    37
    public static void main(String args[]) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    38
        for (Box b : new Box[]{new Box(BoxLayout.X_AXIS), new Box(BoxLayout.Y_AXIS)}) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    39
            b = Box.createHorizontalBox();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    40
            b = Box.createVerticalBox();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    41
            b = new Box(BoxLayout.Y_AXIS);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    42
            b.getAccessibleContext();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    43
            b.requestFocus();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    44
            b.requestFocusInWindow();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    45
            b.getPreferredSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    46
            b.getMaximumSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    47
            b.getMinimumSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    48
            b.contains(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    49
            Component c1 = b.add(new Component() {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    50
            });
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    51
            Component c2 = b.add(new Component() {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    52
            });
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    53
            Component c3 = b.add(new Component() {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    54
            });
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    55
            b.getComponentCount();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    56
            b.countComponents();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    57
            b.getComponent(1);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    58
            b.getComponent(2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    59
            Component[] cs = b.getComponents();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    60
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    61
            boolean exceptions = false;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    62
            try {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    63
                b.setLayout(new BoxLayout(new Container(), BoxLayout.Y_AXIS));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    64
            } catch (AWTError e) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    65
                exceptions = true;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    66
            }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    67
            if (!exceptions)
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    68
                throw new RuntimeException("AWTError did not occur when expected");
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    69
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    70
            exceptions = false;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    71
            try {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    72
                b.setLayout(new BoxLayout(new Container(), BoxLayout.X_AXIS));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    73
            } catch (AWTError e) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    74
                exceptions = true;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    75
            }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    76
            if (!exceptions)
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    77
                throw new RuntimeException("AWTError did not occur when expected");
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    78
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    79
            b.getLayout();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    80
            b.invalidate();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    81
            b.validate();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    82
            b.revalidate();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    83
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    84
            Insets ins = b.getInsets();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    85
            b.getAlignmentY();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    86
            b.getAlignmentX();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    87
            b.getGraphics();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    88
            b.setVisible(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    89
            b.setVisible(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    90
            b.setEnabled(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    91
            b.setEnabled(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    92
            b.setForeground(Color.red);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    93
            b.setBackground(Color.red);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    94
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    95
            for (String font : Toolkit.getDefaultToolkit().getFontList()) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    96
                for (int j = 8; j < 17; j++) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    97
                    Font f1 = new Font(font, Font.PLAIN, j);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    98
                    Font f2 = new Font(font, Font.BOLD, j);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    99
                    Font f3 = new Font(font, Font.ITALIC, j);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   100
                    Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   101
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   102
                    b.setFont(f1);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   103
                    b.setFont(f2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   104
                    b.setFont(f3);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   105
                    b.setFont(f4);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   106
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   107
                    b.getFontMetrics(f1);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   108
                    b.getFontMetrics(f2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   109
                    b.getFontMetrics(f3);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   110
                    b.getFontMetrics(f4);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   111
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   112
                }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   113
            }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   114
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   115
            b.enable();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   116
            b.disable();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   117
            b.reshape(10, 10, 10, 10);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   118
            b.getBounds(new Rectangle(1, 1, 1, 1));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   119
            b.getSize(new Dimension(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   120
            b.getSize(new Dimension(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   121
            b.getLocation(new Point(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   122
            b.getX();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   123
            b.getY();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   124
            b.getWidth();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   125
            b.getHeight();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   126
            b.isOpaque();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   127
            b.isValidateRoot();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   128
            b.isOptimizedDrawingEnabled();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   129
            b.isDoubleBuffered();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   130
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   131
            b.remove(0);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   132
            b.remove(c2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   133
            b.removeAll();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   134
            b.layout();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   135
            b.preferredSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   136
            b.minimumSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   137
            b.getComponentAt(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   138
            b.locate(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   139
            b.getComponentAt(new Point(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   140
            b.isFocusCycleRoot(new Container());
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   141
            b.transferFocusBackward();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   142
            b.setName("goober");
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   143
            b.getName();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   144
            b.getParent();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   145
            b.getPeer();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   146
            b.getGraphicsConfiguration();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   147
            b.getTreeLock();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   148
            b.getToolkit();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   149
            b.isValid();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   150
            b.isDisplayable();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   151
            b.isVisible();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   152
            b.isShowing();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   153
            b.isEnabled();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   154
            b.enable(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   155
            b.enable(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   156
            b.enableInputMethods(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   157
            b.enableInputMethods(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   158
            b.show();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   159
            b.show(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   160
            b.show(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   161
            b.hide();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   162
            b.getForeground();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   163
            b.isForegroundSet();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   164
            b.getBackground();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   165
            b.isBackgroundSet();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   166
            b.getFont();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   167
            b.isFontSet();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   168
            b.getLocale();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   169
            for (Locale locale : Locale.getAvailableLocales())
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   170
                b.setLocale(locale);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   171
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   172
            b.getColorModel();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   173
            b.getLocation();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   174
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   175
            exceptions = false;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   176
            try {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   177
                b.getLocationOnScreen();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   178
            } catch (IllegalComponentStateException e) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   179
                exceptions = true;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   180
            }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   181
            if (!exceptions)
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   182
                throw new RuntimeException("IllegalComponentStateException did not occur when expected");
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   183
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   184
            b.location();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   185
            b.setLocation(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   186
            b.move(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   187
            b.setLocation(new Point(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   188
            b.getSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   189
            b.size();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   190
            b.setSize(1, 32);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   191
            b.resize(1, 32);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   192
            b.setSize(new Dimension(1, 32));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   193
            b.resize(new Dimension(1, 32));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   194
            b.getBounds();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   195
            b.bounds();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   196
            b.setBounds(10, 10, 10, 10);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   197
            b.setBounds(new Rectangle(10, 10, 10, 10));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   198
            b.isLightweight();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   199
            b.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   200
            b.getCursor();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   201
            b.isCursorSet();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   202
            b.inside(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   203
            b.contains(new Point(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   204
            b.isFocusTraversable();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   205
            b.isFocusable();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   206
            b.setFocusable(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   207
            b.setFocusable(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   208
            b.transferFocus();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   209
            b.getFocusCycleRootAncestor();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   210
            b.nextFocus();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   211
            b.transferFocusUpCycle();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   212
            b.hasFocus();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   213
            b.isFocusOwner();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   214
            b.toString();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   215
            b.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   216
            b.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   217
            b.setComponentOrientation(ComponentOrientation.UNKNOWN);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   218
            b.getComponentOrientation();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   219
        }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   220
    }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   221
}