< prev index next >

test/java/awt/Frame/DecoratedExceptions/DecoratedExceptions.java

Print this page
rev 14031 : 8160974: [TESTBUG] Mark more headful tests with @key headful.

This is a backport of fe58d505fffd from jdk9. 228/596 hunks apply without
modifications. 16 hunks required manual rework. The remainder were for files
not present in jdk8u.


  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 /*
  24  * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  25  * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  26  */
  27 
  28 import java.awt.*;
  29 
  30 /*
  31  * @test

  32  * @summary An attempt to set non-trivial background, shape, or translucency
  33  *          to a decorated toplevel should end with an exception.
  34  * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
  35  * @library ../../../../lib/testlibrary
  36  * @build ExtendedRobot
  37  * @run main DecoratedExceptions
  38  */
  39 public class DecoratedExceptions {
  40     public static void main(String args[]) throws Exception{
  41         ExtendedRobot robot = new ExtendedRobot();
  42         Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(() -> {
  43             Frame frame = new Frame("Frame");
  44             frame.setBounds(50,50,400,200);
  45             try {
  46                 frame.setOpacity(0.5f);
  47                 throw new RuntimeException("No exception when Opacity set to a decorated Frame");
  48             }catch(IllegalComponentStateException e) {
  49             }
  50             try {
  51                 frame.setShape(new Rectangle(50,50,400,200));




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 /*
  24  * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  25  * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  26  */
  27 
  28 import java.awt.*;
  29 
  30 /*
  31  * @test
  32  * @key headful
  33  * @summary An attempt to set non-trivial background, shape, or translucency
  34  *          to a decorated toplevel should end with an exception.
  35  * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
  36  * @library ../../../../lib/testlibrary
  37  * @build ExtendedRobot
  38  * @run main DecoratedExceptions
  39  */
  40 public class DecoratedExceptions {
  41     public static void main(String args[]) throws Exception{
  42         ExtendedRobot robot = new ExtendedRobot();
  43         Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(() -> {
  44             Frame frame = new Frame("Frame");
  45             frame.setBounds(50,50,400,200);
  46             try {
  47                 frame.setOpacity(0.5f);
  48                 throw new RuntimeException("No exception when Opacity set to a decorated Frame");
  49             }catch(IllegalComponentStateException e) {
  50             }
  51             try {
  52                 frame.setShape(new Rectangle(50,50,400,200));


< prev index next >