jdk/test/javax/accessibility/6986385/bug6986385.java
author chegar
Wed, 01 May 2013 14:11:01 +0100
changeset 18060 7cfaa4558c12
parent 6838 c101d59707f3
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6838
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
     1
/*
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
     2
 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
     4
 *
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
     7
 * published by the Free Software Foundation.
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
     8
 *
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    13
 * accompanied this code).
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    14
 *
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    18
 *
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    21
 * questions.
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    22
 */
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    23
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    24
/* @test
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    25
   @bug 6986385
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    26
   @summary JLayer should implement accessible interface
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    27
   @author Alexander Potochkin
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    28
   @run main bug6986385
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    29
*/
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    30
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    31
import javax.swing.*;
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    32
import javax.accessibility.AccessibleContext;
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    33
import javax.accessibility.AccessibleRole;
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    34
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    35
public class bug6986385 {
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    36
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    37
    public static void main(String... args) throws Exception {
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    38
        JLayer l = new JLayer();
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    39
        AccessibleContext acc = l.getAccessibleContext();
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    40
        if (acc == null) {
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    41
            throw new RuntimeException("JLayer's AccessibleContext is null");
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    42
        }
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    43
        if (acc.getAccessibleRole() != AccessibleRole.PANEL) {
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    44
            throw new RuntimeException("JLayer's AccessibleRole must be PANEL");
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    45
        }
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    46
    }
c101d59707f3 6986385: JLayer should implement accessible interface
alexp
parents:
diff changeset
    47
}