8211139: Increase timeout value in all tests under jdk/sanity/client/SwingSet/src

Reviewed-by: serb
This commit is contained in:
Abdul Kolarkunnu 2018-10-11 07:22:53 -07:00 committed by Abdul Kolarkunnu
parent a0ce3d3f18
commit 56847065af
19 changed files with 28 additions and 24 deletions

View File

@ -54,7 +54,7 @@ import static org.jemmy2ext.JemmyExt.*;
* 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 {

View File

@ -56,7 +56,7 @@ import org.testng.annotations.Listeners;
* 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 {

View File

@ -45,7 +45,7 @@ import org.testng.annotations.Listeners;
* 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 {

View File

@ -55,7 +55,7 @@ import org.testng.annotations.Listeners;
* 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 {

View File

@ -86,7 +86,7 @@ import com.sun.swingset3.demos.frame.FrameDemo;
* 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 @@ public class FrameDemoTest {
});
}
}
}

View File

@ -51,7 +51,7 @@ import static org.jemmy2ext.JemmyExt.getUIValue;
* @modules java.desktop
* java.logging
* @build com.sun.swingset3.demos.gridbaglayout.GridBagLayoutDemo
* @run testng GridBagLayoutDemoTest
* @run testng/timeout=600 GridBagLayoutDemoTest
*/
@Listeners(GuiTestListener.class)

View File

@ -56,7 +56,7 @@ import static org.testng.AssertJUnit.*;
* 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 {

View File

@ -55,7 +55,7 @@ import static org.testng.AssertJUnit.*;
* 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 {

View File

@ -49,7 +49,7 @@ import org.testng.annotations.Listeners;
* 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 {

View File

@ -45,7 +45,7 @@ import org.testng.annotations.Listeners;
* 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 {

View File

@ -47,7 +47,7 @@ import org.testng.annotations.Listeners;
* 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 {

View File

@ -48,7 +48,7 @@ import org.testng.annotations.Listeners;
* 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 {

View File

@ -64,7 +64,7 @@ import com.sun.swingset3.demos.table.TableDemo;
* 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 {

View File

@ -65,7 +65,7 @@ import static org.testng.AssertJUnit.*;
* 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 {

View File

@ -61,7 +61,7 @@ import org.testng.annotations.Listeners;
* 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 {

View File

@ -61,7 +61,7 @@ import com.sun.swingset3.demos.tooltip.ToolTipDemo;
* 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 {

View File

@ -56,7 +56,7 @@ import static org.testng.AssertJUnit.*;
* 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 {

View File

@ -49,7 +49,7 @@ import org.testng.annotations.Listeners;
* 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 {

View File

@ -48,6 +48,7 @@ import javax.swing.JButton;
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 @@ public class JemmyExt {
* 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 @@ public class JemmyExt {
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();
}