jdk/test/java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowBlockingTest.java
author goetz
Tue, 14 Jun 2016 10:44:59 +0200
changeset 39056 d99e63b6d962
parent 31442 5f0b1f795848
permissions -rw-r--r--
8159690: [TESTBUG] Mark headful tests with @key headful. Reviewed-by: simonis, alexsch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
     1
/*
39056
d99e63b6d962 8159690: [TESTBUG] Mark headful tests with @key headful.
goetz
parents: 31442
diff changeset
     2
 * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
     4
 *
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
     7
 * published by the Free Software Foundation.
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
     8
 *
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    13
 * accompanied this code).
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    14
 *
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 425
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 425
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 425
diff changeset
    21
 * questions.
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    22
 */
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    23
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    24
/*
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    25
  @test
39056
d99e63b6d962 8159690: [TESTBUG] Mark headful tests with @key headful.
goetz
parents: 31442
diff changeset
    26
  @key headful
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    27
  @bug       6314575
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    28
  @summary   Tests that previosly focused owned window doesn't steal focus when an owner's component requests focus.
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
    29
  @author    Anton.Tarasov: area=awt.focus
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
    30
  @library   ../../regtesthelpers
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
    31
  @build     Util
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
    32
  @run       main ActualFocusedWindowBlockingTest
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    33
*/
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    34
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    35
import java.awt.*;
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    36
import java.awt.event.*;
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    37
import java.applet.Applet;
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    38
import java.util.concurrent.atomic.AtomicBoolean;
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    39
import java.lang.reflect.InvocationTargetException;
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
    40
import test.java.awt.regtesthelpers.Util;
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    41
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    42
public class ActualFocusedWindowBlockingTest extends Applet {
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
    43
    Robot robot = Util.createRobot();
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    44
    Frame owner = new Frame("Owner Frame");
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    45
    Window win = new Window(owner);
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    46
    Frame frame = new Frame("Auxiliary Frame");
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    47
    Button fButton = new Button("frame button") {public String toString() {return "Frame_Button";}};
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    48
    Button wButton = new Button("window button") {public String toString() {return "Window_Button";}};
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    49
    Button aButton = new Button("auxiliary button") {public String toString() {return "Auxiliary_Button";}};
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    50
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    51
    public static void main(String[] args) {
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    52
        ActualFocusedWindowBlockingTest app = new ActualFocusedWindowBlockingTest();
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    53
        app.init();
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    54
        app.start();
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    55
    }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    56
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    57
    public void init() {
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    58
        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    59
                public void eventDispatched(AWTEvent e) {
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
    60
                    System.out.println("--> " + e);
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    61
                }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    62
            }, FocusEvent.FOCUS_EVENT_MASK | WindowEvent.WINDOW_FOCUS_EVENT_MASK);
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    63
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    64
        owner.add(fButton);
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    65
        win.add(wButton);
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    66
        frame.add(aButton);
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    67
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    68
        owner.setName("OWNER_FRAME");
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    69
        win.setName("OWNED_WINDOW");
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    70
        frame.setName("AUX_FRAME");
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    71
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    72
        tuneAndShowWindows(new Window[] {owner, win, frame});
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    73
    }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    74
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    75
    public void start() {
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    76
        if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) {
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
    77
            System.out.println("No testing on Motif. Test passed.");
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    78
            return;
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    79
        }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    80
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
    81
        System.out.println("\nTest started:\n");
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    82
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    83
        // Test 1.
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    84
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    85
        clickOnCheckFocus(wButton);
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    86
        clickOnCheckFocus(aButton);
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    87
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
    88
        Util.clickOnComp(fButton, robot);
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    89
        if (!testFocused(fButton)) {
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    90
            throw new TestFailedException("The owner's component [" + fButton + "] couldn't be focused by click");
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    91
        }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    92
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    93
        // Test 2.
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    94
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    95
        clickOnCheckFocus(wButton);
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    96
        clickOnCheckFocus(aButton);
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    97
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
    98
        fButton.requestFocus();
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
    99
        Util.waitForIdle(robot);
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   100
        if (!testFocused(fButton)) {
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   101
            throw new TestFailedException("The owner's component [" + fButton + "] couldn't be focused by request");
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   102
        }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   103
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   104
        // Test 3.
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   105
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   106
        clickOnCheckFocus(wButton);
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   107
        clickOnCheckFocus(aButton);
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   108
        clickOnCheckFocus(fButton);
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   109
        clickOnCheckFocus(aButton);
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   110
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   111
        Util.clickOnTitle(owner, robot);
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   112
        if (!testFocused(fButton)) {
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   113
            throw new TestFailedException("The owner's component [" + fButton + "] couldn't be focused as the most recent focus owner");
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   114
        }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   115
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   116
        System.out.println("Test passed.");
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   117
    }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   118
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   119
    void tuneAndShowWindows(Window[] arr) {
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   120
        int y = 0;
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   121
        for (Window w: arr) {
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   122
            w.setLayout(new FlowLayout());
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   123
            w.setBounds(100, y, 400, 150);
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   124
            w.setBackground(Color.blue);
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   125
            w.setVisible(true);
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   126
            y += 200;
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   127
            Util.waitForIdle(robot);
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   128
        }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   129
    }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   130
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   131
    void clickOnCheckFocus(Component c) {
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   132
        if (c instanceof Frame) {
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   133
            Util.clickOnTitle((Frame)c, robot);
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   134
        } else {
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   135
            Util.clickOnComp(c, robot);
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   136
        }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   137
        if (!testFocused(c)) {
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   138
            throw new TestErrorException(c + "couldn't get focus by click.");
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   139
        }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   140
    }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   141
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   142
    boolean testFocused(Component c) {
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   143
        for (int i=0; i<10; i++) {
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   144
            if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() == c) {
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   145
                return true;
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   146
            }
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   147
            Util.waitForIdle(robot);
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   148
        }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   149
        return false;
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   150
    }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   151
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   152
    // Thrown when the behavior being verified is found wrong.
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   153
    class TestFailedException extends RuntimeException {
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   154
        TestFailedException(String msg) {
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   155
            super("Test failed: " + msg);
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   156
        }
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   157
    }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   158
425
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   159
    // Thrown when an error not related to the behavior being verified is encountered.
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   160
    class TestErrorException extends RuntimeException {
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   161
        TestErrorException(String msg) {
89b44fab010f 6616792: five AWT focus regression tests should be fixed
ant
parents: 423
diff changeset
   162
            super("Unexpected error: " + msg);
423
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   163
        }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   164
    }
1c607ab74068 6680135: A number of test/closed/java/awt/Focus/* tests should be opened
ant
parents:
diff changeset
   165
}