jdk/test/sanity/client/SwingSet/src/WindowDemoTest.java
changeset 37677 9774eca96b01
parent 36744 a00905527ec2
child 39006 fd8c3312d043
--- a/jdk/test/sanity/client/SwingSet/src/WindowDemoTest.java	Wed Apr 27 20:36:02 2016 +0100
+++ b/jdk/test/sanity/client/SwingSet/src/WindowDemoTest.java	Wed Apr 27 17:47:17 2016 -0700
@@ -21,6 +21,7 @@
  * questions.
  */
 
+import org.jtregext.GuiTestListener;
 import com.sun.swingset3.demos.window.WindowDemo;
 import static com.sun.swingset3.demos.window.WindowDemo.*;
 import static org.jemmy2ext.JemmyExt.*;
@@ -31,6 +32,7 @@
 import org.netbeans.jemmy.operators.JFrameOperator;
 import org.netbeans.jemmy.operators.JLabelOperator;
 import org.netbeans.jemmy.operators.WindowOperator;
+import org.testng.annotations.Listeners;
 
 /*
  * @test
@@ -40,37 +42,37 @@
  *          when the "Show JWindow..." button is clicked.
  *
  * @library /sanity/client/lib/jemmy/src
- * @library /sanity/client/lib/Jemmy2Ext/src
+ * @library /sanity/client/lib/Extensions/src
  * @library /sanity/client/lib/SwingSet3/src
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.window.WindowDemo
  * @run testng WindowDemoTest
  */
+@Listeners(GuiTestListener.class)
 public class WindowDemoTest {
 
     @Test
     public void test() throws Exception {
-        captureDebugInfoOnFail(() -> {
-            new ClassReference(WindowDemo.class.getCanonicalName()).startApplication();
+
+        new ClassReference(WindowDemo.class.getCanonicalName()).startApplication();
 
-            JFrameOperator frame = new JFrameOperator();
+        JFrameOperator frame = new JFrameOperator();
 
-            assertEquals("Only one JWindow is shown", 1, getJWindowCount());
+        assertEquals("Only one JWindow is shown", 1, getJWindowCount());
 
-            WindowOperator window = new WindowOperator(getJWindow());
+        WindowOperator window = new WindowOperator(getJWindow());
 
-            assertTrue("JFrame is showing", frame.isShowing());
-            assertFalse("JFrame is not iconified", isIconified(frame));
-            assertTrue("JWindow is showing", window.isShowing());
+        assertTrue("JFrame is showing", frame.isShowing());
+        assertFalse("JFrame is not iconified", isIconified(frame));
+        assertTrue("JWindow is showing", window.isShowing());
 
-            final String labelText = I_HAVE_NO_SYSTEM_BORDER;
-            JLabelOperator jLabelOperator = new JLabelOperator(window, labelText);
-            assertEquals("JWindow contains the label with corresponding text", labelText, jLabelOperator.getText());
+        final String labelText = I_HAVE_NO_SYSTEM_BORDER;
+        JLabelOperator jLabelOperator = new JLabelOperator(window, labelText);
+        assertEquals("JWindow contains the label with corresponding text", labelText, jLabelOperator.getText());
 
-            new JButtonOperator(frame, SHOW_J_WINDOW).push();
+        new JButtonOperator(frame, SHOW_J_WINDOW).push();
 
-            assertEquals("Only one JWindow is shown", 1, getJWindowCount());
-        });
+        assertEquals("Only one JWindow is shown", 1, getJWindowCount());
     }
 
 }