< prev index next >

test/javax/swing/JTabbedPane/7170310/bug7170310.java

Print this page
rev 14565 : 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,7 +1,7 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -35,17 +35,19 @@
 import javax.swing.plaf.metal.MetalLookAndFeel;
 
 
 /**
  * @test
+ * @key headful
  * @bug 7170310
  * @author Alexey Ivanov
  * @summary Selected tab should be scrolled into view.
  * @library ../../../../lib/testlibrary/
  * @build ExtendedRobot
  * @run main bug7170310
  */
+
 public class bug7170310 {
     private static final int TABS_NUMBER = 3;
 
     private static volatile JTabbedPane tabbedPane;
     private static volatile int count = 1;

@@ -73,11 +75,11 @@
                 throw exception;
             } else {
                 System.out.printf("Test passed");
             }
         } finally {
-            frame.dispose();
+            if (frame != null) { frame.dispose(); }
         }
     }
 
     private static void createAndShowUI() {
         frame = new JFrame("bug7170310");
< prev index next >