8211139: Increase timeout value in all tests under jdk/sanity/client/SwingSet/src
authorakolarkunnu
Thu, 11 Oct 2018 07:22:53 -0700
changeset 52128 1e0cdaf980f3
parent 52122 cb20bf10cfbd
child 52129 b1526df0add2
8211139: Increase timeout value in all tests under jdk/sanity/client/SwingSet/src Reviewed-by: serb Contributed-by: abdul.kolarkunnu@oracle.com
test/jdk/sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java
test/jdk/sanity/client/SwingSet/src/ButtonDemoTest.java
test/jdk/sanity/client/SwingSet/src/ComboBoxDemoTest.java
test/jdk/sanity/client/SwingSet/src/DialogDemoTest.java
test/jdk/sanity/client/SwingSet/src/FrameDemoTest.java
test/jdk/sanity/client/SwingSet/src/GridBagLayoutDemoTest.java
test/jdk/sanity/client/SwingSet/src/ListDemoTest.java
test/jdk/sanity/client/SwingSet/src/OptionPaneDemoTest.java
test/jdk/sanity/client/SwingSet/src/ProgressBarDemoTest.java
test/jdk/sanity/client/SwingSet/src/ScrollPaneDemoTest.java
test/jdk/sanity/client/SwingSet/src/SpinnerDemoTest.java
test/jdk/sanity/client/SwingSet/src/TabbedPaneDemoTest.java
test/jdk/sanity/client/SwingSet/src/TableDemoTest.java
test/jdk/sanity/client/SwingSet/src/TextFieldDemoTest.java
test/jdk/sanity/client/SwingSet/src/ToggleButtonDemoTest.java
test/jdk/sanity/client/SwingSet/src/ToolTipDemoTest.java
test/jdk/sanity/client/SwingSet/src/TreeDemoTest.java
test/jdk/sanity/client/SwingSet/src/WindowDemoTest.java
test/jdk/sanity/client/lib/Extensions/src/org/jemmy2ext/JemmyExt.java
--- a/test/jdk/sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -54,7 +54,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.button.ButtonDemo
- * @run testng ButtonDemoScreenshotTest
+ * @run testng/timeout=600 ButtonDemoScreenshotTest
  */
 @Listeners(GuiTestListener.class)
 public class ButtonDemoScreenshotTest {
--- a/test/jdk/sanity/client/SwingSet/src/ButtonDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ButtonDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -56,7 +56,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.button.ButtonDemo
- * @run testng ButtonDemoTest
+ * @run testng/timeout=600 ButtonDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class ButtonDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/ComboBoxDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ComboBoxDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -45,7 +45,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.combobox.ComboBoxDemo
- * @run testng ComboBoxDemoTest
+ * @run testng/timeout=600 ComboBoxDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class ComboBoxDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/DialogDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/DialogDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -55,7 +55,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.dialog.DialogDemo
- * @run testng DialogDemoTest
+ * @run testng/timeout=600 DialogDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class DialogDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/FrameDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/FrameDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -86,7 +86,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.frame.FrameDemo
- * @run testng FrameDemoTest
+ * @run testng/timeout=600 FrameDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class FrameDemoTest {
@@ -293,4 +293,4 @@
         });
     }
 
-}
\ No newline at end of file
+}
--- a/test/jdk/sanity/client/SwingSet/src/GridBagLayoutDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/GridBagLayoutDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -51,7 +51,7 @@
  * @modules java.desktop
  *          java.logging
  * @build com.sun.swingset3.demos.gridbaglayout.GridBagLayoutDemo
- * @run testng GridBagLayoutDemoTest
+ * @run testng/timeout=600 GridBagLayoutDemoTest
  */
 
 @Listeners(GuiTestListener.class)
--- a/test/jdk/sanity/client/SwingSet/src/ListDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ListDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -56,7 +56,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.list.ListDemo
- * @run testng ListDemoTest
+ * @run testng/timeout=600 ListDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class ListDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/OptionPaneDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/OptionPaneDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -55,7 +55,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.optionpane.OptionPaneDemo
- * @run testng OptionPaneDemoTest
+ * @run testng/timeout=600 OptionPaneDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class OptionPaneDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/ProgressBarDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ProgressBarDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -49,7 +49,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.progressbar.ProgressBarDemo
- * @run testng/timeout=240 ProgressBarDemoTest
+ * @run testng/timeout=1200 ProgressBarDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class ProgressBarDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/ScrollPaneDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ScrollPaneDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -45,7 +45,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.scrollpane.ScrollPaneDemo
- * @run testng ScrollPaneDemoTest
+ * @run testng/timeout=600 ScrollPaneDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class ScrollPaneDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/SpinnerDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/SpinnerDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -47,7 +47,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.spinner.SpinnerDemo
- * @run testng SpinnerDemoTest
+ * @run testng/timeout=600 SpinnerDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class SpinnerDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/TabbedPaneDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/TabbedPaneDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -48,7 +48,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.tabbedpane.TabbedPaneDemo
- * @run testng TabbedPaneDemoTest
+ * @run testng/timeout=600 TabbedPaneDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class TabbedPaneDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/TableDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/TableDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -64,7 +64,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.table.TableDemo
- * @run testng TableDemoTest
+ * @run testng/timeout=600 TableDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class TableDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/TextFieldDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/TextFieldDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -65,7 +65,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.textfield.TextFieldDemo
- * @run testng TextFieldDemoTest
+ * @run testng/timeout=600 TextFieldDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class TextFieldDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/ToggleButtonDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ToggleButtonDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -61,7 +61,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.togglebutton.ToggleButtonDemo
- * @run testng ToggleButtonDemoTest
+ * @run testng/timeout=600 ToggleButtonDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class ToggleButtonDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/ToolTipDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ToolTipDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -61,7 +61,7 @@
  *         java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.tooltip.ToolTipDemo
- * @run testng ToolTipDemoTest
+ * @run testng/timeout=600 ToolTipDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class ToolTipDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/TreeDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/TreeDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -56,7 +56,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.tree.TreeDemo
- * @run testng TreeDemoTest
+ * @run testng/timeout=600 TreeDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class TreeDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/WindowDemoTest.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/WindowDemoTest.java	Thu Oct 11 07:22:53 2018 -0700
@@ -49,7 +49,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.window.WindowDemo
- * @run testng WindowDemoTest
+ * @run testng/timeout=600 WindowDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class WindowDemoTest {
--- a/test/jdk/sanity/client/lib/Extensions/src/org/jemmy2ext/JemmyExt.java	Mon Oct 15 11:53:15 2018 -0400
+++ b/test/jdk/sanity/client/lib/Extensions/src/org/jemmy2ext/JemmyExt.java	Thu Oct 11 07:22:53 2018 -0700
@@ -48,6 +48,7 @@
 import javax.swing.JComponent;
 import javax.swing.JPanel;
 import javax.swing.JWindow;
+import javax.swing.UIManager;
 import javax.swing.border.Border;
 import javax.swing.border.CompoundBorder;
 import javax.swing.border.TitledBorder;
@@ -340,19 +341,21 @@
      * full dump and a screenshot of the whole screen.
      */
     public static void captureAll() {
-        PNGEncoder.captureScreen("failure.png", PNGEncoder.COLOR_MODE);
+        String lookAndFeelClassName = UIManager.getLookAndFeel().getClass().getSimpleName();
+        PNGEncoder.captureScreen("failure_" + lookAndFeelClassName + ".png", PNGEncoder.COLOR_MODE);
         try {
-            Dumper.dumpAll("dumpAll.xml");
+            Dumper.dumpAll("dumpAll_" + lookAndFeelClassName + ".xml");
         } catch (FileNotFoundException ex) {
             Logger.getLogger(JemmyExt.class.getName()).log(Level.SEVERE, null, ex);
         }
-        captureWindows();
+        captureWindows(lookAndFeelClassName);
     }
 
     /**
      * Captures each showing window image using Window.paint() method.
+     * @param lookAndFeelClassName
      */
-    private static void captureWindows() {
+    private static void captureWindows(String lookAndFeelClassName) {
         try {
             EventQueue.invokeAndWait(() -> {
                 Window[] windows = Window.getWindows();
@@ -367,7 +370,8 @@
                     g.dispose();
 
                     try {
-                        ImageIO.write(img, "png", new File("window" + index++ + ".png"));
+                        ImageIO.write(img, "png", new File("window_" + lookAndFeelClassName
+                                + "_" + index++ + ".png"));
                     } catch (IOException e) {
                         e.printStackTrace();
                     }