8210057: Enable different look and feels in SwingSet3 demo test InternalFrameDemoTest
authorsveerabhadra
Fri, 26 Oct 2018 14:03:57 +0530
changeset 52522 e57405e79cd7
parent 52521 7335ac58f32b
child 52523 56585eb10314
8210057: Enable different look and feels in SwingSet3 demo test InternalFrameDemoTest Reviewed-by: serb Contributed-by: gauri.patil@oracle.com
test/jdk/sanity/client/SwingSet/src/InternalFrameDemoTest.java
--- a/test/jdk/sanity/client/SwingSet/src/InternalFrameDemoTest.java	Fri Oct 26 13:52:08 2018 +0530
+++ b/test/jdk/sanity/client/SwingSet/src/InternalFrameDemoTest.java	Fri Oct 26 14:03:57 2018 +0530
@@ -45,10 +45,12 @@
 
 import javax.swing.JDesktopPane;
 import javax.swing.JInternalFrame;
+import javax.swing.UIManager;
 
 import org.jemmy2ext.JemmyExt;
 import org.jtregext.GuiTestListener;
 import org.netbeans.jemmy.ClassReference;
+import org.netbeans.jemmy.JemmyProperties;
 import org.netbeans.jemmy.operators.ComponentOperator;
 import org.netbeans.jemmy.operators.JButtonOperator;
 import org.netbeans.jemmy.operators.JCheckBoxOperator;
@@ -74,7 +76,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.internalframe.InternalFrameDemo
- * @run testng InternalFrameDemoTest
+ * @run testng/timeout=600 InternalFrameDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class InternalFrameDemoTest {
@@ -92,8 +94,12 @@
      *
      * @throws Exception
      */
-    @Test
-    public void test() throws Exception {
+    @Test(dataProvider = "availableLookAndFeels", dataProviderClass = TestHelpers.class)
+    public void test(String lookAndFeel) throws Exception {
+        UIManager.setLookAndFeel(lookAndFeel);
+        // initializing internal frame driver for each L&F
+        JemmyProperties.setCurrentDispatchingModel(
+                JemmyProperties.getCurrentDispatchingModel());
 
         new ClassReference(InternalFrameDemo.class.getCanonicalName()).startApplication();