# HG changeset patch # User akolarkunnu # Date 1513151865 -19800 # Node ID 093027a037cf5ea50d832eeaea03605d7bcee0fa # Parent dbfe141b127120b204c1241cd665c3894deaf5d6 8191803: [TEST_BUG] : sanity/client/SwingSet/src/ProgressBarDemoTest.java failed with "Wait "greater then 1349" state to be reached Reviewed-by: serb, psadhukhan Contributed-by: abdul.kolarkunnu@oracle.com diff -r dbfe141b1271 -r 093027a037cf test/jdk/sanity/client/SwingSet/src/ProgressBarDemoTest.java --- a/test/jdk/sanity/client/SwingSet/src/ProgressBarDemoTest.java Tue Dec 12 15:47:35 2017 +0530 +++ b/test/jdk/sanity/client/SwingSet/src/ProgressBarDemoTest.java Wed Dec 13 13:27:45 2017 +0530 @@ -29,6 +29,7 @@ import org.testng.annotations.Test; import org.netbeans.jemmy.ClassReference; import org.netbeans.jemmy.ComponentChooser; +import org.netbeans.jemmy.Timeouts; import org.netbeans.jemmy.operators.JButtonOperator; import org.netbeans.jemmy.operators.JFrameOperator; import org.netbeans.jemmy.operators.JProgressBarOperator; @@ -47,11 +48,13 @@ * java.logging * @build org.jemmy2ext.JemmyExt * @build com.sun.swingset3.demos.progressbar.ProgressBarDemo - * @run testng ProgressBarDemoTest + * @run testng/timeout=240 ProgressBarDemoTest */ @Listeners(GuiTestListener.class) public class ProgressBarDemoTest { + private final static long PROGRESS_BAR_TIMEOUT = 180000; + @Test public void test() throws Exception { @@ -147,9 +150,15 @@ // Check progess bar progression and start/stop button disabled/enabled states public void checkCompleteProgress(JFrameOperator frame, JButtonOperator startButton, JButtonOperator stopButton, JProgressBarOperator progressBar) throws Exception { + Timeouts timeouts = progressBar.getTimeouts(); + long defaultTimeout = timeouts.getTimeout("ComponentOperator.WaitStateTimeout"); startButton.pushNoBlock(); + // Set progress bar timeout as 3 minutes as it take long time to reach maximum + timeouts.setTimeout("ComponentOperator.WaitStateTimeout", PROGRESS_BAR_TIMEOUT); progressBar.waitValue(progressBar.getMaximum()); + // Reset timeout to default timeout value + timeouts.setTimeout("ComponentOperator.WaitStateTimeout", defaultTimeout); startButton.waitComponentEnabled();