< prev index next >

test/java/awt/SplashScreen/MultiResolutionSplash/unix/UnixMultiResolutionSplashTest.java

Print this page
rev 17565 : 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
Summary: Add new keyword 'printer'. Some minor test fixes to show headless exception. Add some @requires windows.
Reviewed-by: serb, mbaesken
   1 /*
   2  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  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  */


  28 import java.awt.Graphics2D;
  29 import java.awt.Panel;
  30 import java.awt.Rectangle;
  31 import java.awt.Robot;
  32 import java.awt.SplashScreen;
  33 import java.awt.TextField;
  34 import java.awt.Window;
  35 import java.awt.event.KeyEvent;
  36 import java.awt.image.BufferedImage;
  37 import java.io.BufferedReader;
  38 import java.io.File;
  39 import java.io.InputStreamReader;
  40 import java.util.ArrayList;
  41 import java.util.HashMap;
  42 import java.util.List;
  43 import java.util.Map;
  44 import javax.imageio.ImageIO;
  45 
  46 /**
  47  * @test

  48  * @bug 8145174 8151787 8168657
  49  * @summary HiDPI splash screen support on Linux
  50  * @modules java.desktop/sun.java2d
  51  * @requires (os.family == "linux")
  52  * @run main UnixMultiResolutionSplashTest
  53  */

  54 public class UnixMultiResolutionSplashTest {
  55 
  56     private static final int IMAGE_WIDTH = 300;
  57     private static final int IMAGE_HEIGHT = 200;
  58     private static int inx = 0;
  59     private static final ImageInfo[] tests = {
  60         new ImageInfo("splash1.png", "splash1@200pct.png", Color.BLUE, Color.GREEN),
  61         new ImageInfo("splash2", "splash2@2x", Color.WHITE, Color.BLACK),
  62         new ImageInfo("splash3.", "splash3@200pct.", Color.YELLOW, Color.RED)
  63     };
  64 
  65     public static void main(String[] args) throws Exception {
  66 
  67         if (args.length == 0) {
  68             generateImages();
  69             for (ImageInfo test : tests) {
  70                 createChildProcess(test);
  71             }
  72         } else {
  73             int index = Integer.parseInt(args[0]);


   1 /*
   2  * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  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  */


  28 import java.awt.Graphics2D;
  29 import java.awt.Panel;
  30 import java.awt.Rectangle;
  31 import java.awt.Robot;
  32 import java.awt.SplashScreen;
  33 import java.awt.TextField;
  34 import java.awt.Window;
  35 import java.awt.event.KeyEvent;
  36 import java.awt.image.BufferedImage;
  37 import java.io.BufferedReader;
  38 import java.io.File;
  39 import java.io.InputStreamReader;
  40 import java.util.ArrayList;
  41 import java.util.HashMap;
  42 import java.util.List;
  43 import java.util.Map;
  44 import javax.imageio.ImageIO;
  45 
  46 /**
  47  * @test
  48  * @key headful
  49  * @bug 8145174 8151787 8168657
  50  * @summary HiDPI splash screen support on Linux
  51  * @modules java.desktop/sun.java2d
  52  * @requires (os.family == "linux")
  53  * @run main UnixMultiResolutionSplashTest
  54  */
  55 
  56 public class UnixMultiResolutionSplashTest {
  57 
  58     private static final int IMAGE_WIDTH = 300;
  59     private static final int IMAGE_HEIGHT = 200;
  60     private static int inx = 0;
  61     private static final ImageInfo[] tests = {
  62         new ImageInfo("splash1.png", "splash1@200pct.png", Color.BLUE, Color.GREEN),
  63         new ImageInfo("splash2", "splash2@2x", Color.WHITE, Color.BLACK),
  64         new ImageInfo("splash3.", "splash3@200pct.", Color.YELLOW, Color.RED)
  65     };
  66 
  67     public static void main(String[] args) throws Exception {
  68 
  69         if (args.length == 0) {
  70             generateImages();
  71             for (ImageInfo test : tests) {
  72                 createChildProcess(test);
  73             }
  74         } else {
  75             int index = Integer.parseInt(args[0]);


< prev index next >