jdk/test/javax/swing/Headless/HeadlessJTextArea.java
author hseigel
Wed, 01 Mar 2017 08:00:02 -0500
changeset 46194 5596e6f63072
parent 30469 bac0a7ff7e1e
permissions -rw-r--r--
8172307: Remove ununsed JVM API JVM_GetModuleByPackageName() Summary: Remove get_module_by_package_name() etc., and unneeded test. Reviewed-by: sspitsyn, gtriantafill
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
/*
30469
bac0a7ff7e1e 8074028: Remove API references to java.awt.peer
serb
parents: 25203
diff changeset
     2
 * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
25203
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 JTextArea constructor and methods do not throw unexpected
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    31
 *          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 HeadlessJTextArea
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 HeadlessJTextArea {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    36
    public static void main(String args[]) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    37
        JTextArea t = new JTextArea();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    38
        t.selectAll();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    39
        t.getSelectionStart();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    40
        t.getSelectionEnd();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    41
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    42
        t.getAccessibleContext();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    43
        t.isFocusTraversable();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    44
        t.setEnabled(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    45
        t.setEnabled(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    46
        t.requestFocus();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    47
        t.requestFocusInWindow();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    48
        t.getPreferredSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    49
        t.getMaximumSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    50
        t.getMinimumSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    51
        t.contains(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    52
        Component c1 = t.add(new Component(){});
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    53
        Component c2 = t.add(new Component(){});
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    54
        Component c3 = t.add(new Component(){});
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    55
        Insets ins = t.getInsets();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    56
        t.getAlignmentY();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    57
        t.getAlignmentX();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    58
        t.getGraphics();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    59
        t.setVisible(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    60
        t.setVisible(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    61
        t.setForeground(Color.red);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    62
        t.setBackground(Color.red);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    63
        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    64
            for (int j = 8; j < 17; j++) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    65
                Font f1 = new Font(font, Font.PLAIN, j);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    66
                Font f2 = new Font(font, Font.BOLD, j);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    67
                Font f3 = new Font(font, Font.ITALIC, j);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    68
                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
    69
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    70
                t.setFont(f1);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    71
                t.setFont(f2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    72
                t.setFont(f3);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    73
                t.setFont(f4);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    74
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    75
                t.getFontMetrics(f1);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    76
                t.getFontMetrics(f2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    77
                t.getFontMetrics(f3);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    78
                t.getFontMetrics(f4);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    79
            }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    80
        }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    81
        t.enable();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    82
        t.disable();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    83
        t.reshape(10, 10, 10, 10);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    84
        t.getBounds(new Rectangle(1, 1, 1, 1));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    85
        t.getSize(new Dimension(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    86
        t.getLocation(new Point(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    87
        t.getX();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    88
        t.getY();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    89
        t.getWidth();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    90
        t.getHeight();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    91
        t.isOpaque();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    92
        t.isValidateRoot();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    93
        t.isOptimizedDrawingEnabled();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    94
        t.isDoubleBuffered();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    95
        t.getComponentCount();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    96
        t.countComponents();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    97
        t.getComponent(1);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    98
        t.getComponent(2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    99
        Component[] cs = t.getComponents();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   100
        t.getLayout();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   101
        t.setLayout(new FlowLayout());
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   102
        t.doLayout();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   103
        t.layout();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   104
        t.invalidate();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   105
        t.validate();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   106
        t.remove(0);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   107
        t.remove(c2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   108
        t.removeAll();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   109
        t.preferredSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   110
        t.minimumSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   111
        t.getComponentAt(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   112
        t.locate(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   113
        t.getComponentAt(new Point(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   114
        t.isFocusCycleRoot(new Container());
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   115
        t.transferFocusBackward();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   116
        t.setName("goober");
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   117
        t.getName();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   118
        t.getParent();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   119
        t.getGraphicsConfiguration();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   120
        t.getTreeLock();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   121
        t.getToolkit();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   122
        t.isValid();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   123
        t.isDisplayable();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   124
        t.isVisible();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   125
        t.isShowing();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   126
        t.isEnabled();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   127
        t.enable(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   128
        t.enable(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   129
        t.enableInputMethods(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   130
        t.enableInputMethods(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   131
        t.show();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   132
        t.show(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   133
        t.show(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   134
        t.hide();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   135
        t.getForeground();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   136
        t.isForegroundSet();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   137
        t.getBackground();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   138
        t.isBackgroundSet();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   139
        t.getFont();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   140
        t.isFontSet();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   141
        Container c = new Container();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   142
        c.add(t);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   143
        t.getLocale();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   144
        for (Locale locale : Locale.getAvailableLocales())
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   145
            t.setLocale(locale);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   146
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   147
        t.getColorModel();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   148
        t.getLocation();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   149
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   150
        boolean exceptions = false;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   151
        try {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   152
            t.getLocationOnScreen();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   153
        } catch (IllegalComponentStateException e) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   154
            exceptions = true;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   155
        }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   156
        if (!exceptions)
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   157
            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   158
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   159
        t.location();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   160
        t.setLocation(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   161
        t.move(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   162
        t.setLocation(new Point(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   163
        t.getSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   164
        t.size();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   165
        t.setSize(1, 32);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   166
        t.resize(1, 32);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   167
        t.setSize(new Dimension(1, 32));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   168
        t.resize(new Dimension(1, 32));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   169
        t.getBounds();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   170
        t.bounds();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   171
        t.setBounds(10, 10, 10, 10);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   172
        t.setBounds(new Rectangle(10, 10, 10, 10));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   173
        t.isLightweight();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   174
        t.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   175
        t.getCursor();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   176
        t.isCursorSet();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   177
        t.inside(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   178
        t.contains(new Point(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   179
        t.isFocusable();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   180
        t.setFocusable(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   181
        t.setFocusable(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   182
        t.transferFocus();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   183
        t.getFocusCycleRootAncestor();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   184
        t.nextFocus();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   185
        t.transferFocusUpCycle();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   186
        t.hasFocus();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   187
        t.isFocusOwner();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   188
        t.toString();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   189
        t.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   190
        t.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   191
        t.setComponentOrientation(ComponentOrientation.UNKNOWN);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   192
        t.getComponentOrientation();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   193
    }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   194
}