< prev index next >

test/sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java

Print this page




  21  * questions.
  22  */
  23 
  24 import com.sun.swingset3.demos.button.ButtonDemo;
  25 import org.jtregext.GuiTestListener;
  26 import java.awt.Point;
  27 import java.awt.Robot;
  28 import java.awt.event.InputEvent;
  29 import java.awt.image.BufferedImage;
  30 import org.netbeans.jemmy.ClassReference;
  31 import org.netbeans.jemmy.image.StrictImageComparator;
  32 import org.netbeans.jemmy.operators.JButtonOperator;
  33 import org.netbeans.jemmy.operators.JFrameOperator;
  34 import static org.jemmy2ext.JemmyExt.*;
  35 import org.testng.annotations.Test;
  36 import static com.sun.swingset3.demos.button.ButtonDemo.*;
  37 import org.testng.annotations.Listeners;
  38 
  39 /*
  40  * @test
  41  * @key headful screenshots
  42  * @summary Verifies buttons on SwingSet3 ButtonDemo page by clicking each
  43  *          button, taking its screenshots and checking that pressed button
  44  *          image is different from initial button image.
  45  *
  46  * @library /sanity/client/lib/jemmy/src
  47  * @library /sanity/client/lib/Extensions/src
  48  * @library /sanity/client/lib/SwingSet3/src


  49  * @build org.jemmy2ext.JemmyExt
  50  * @build com.sun.swingset3.demos.button.ButtonDemo
  51  * @run testng ButtonDemoScreenshotTest
  52  */
  53 @Listeners(GuiTestListener.class)
  54 public class ButtonDemoScreenshotTest {
  55 
  56     private static final int BUTTON_COUNT = 6; // TODO: Decide about "open browser" buttons (value was 8 originally)
  57 
  58     @Test
  59     public void test() throws Exception {
  60         Robot rob = new Robot();
  61 
  62         new ClassReference(ButtonDemo.class.getCanonicalName()).startApplication();
  63 
  64         JFrameOperator mainFrame = new JFrameOperator(DEMO_TITLE);
  65         waitImageIsStill(rob, mainFrame);
  66 
  67         // Check all the buttons
  68         for (int i = 0; i < BUTTON_COUNT; i++) {




  21  * questions.
  22  */
  23 
  24 import com.sun.swingset3.demos.button.ButtonDemo;
  25 import org.jtregext.GuiTestListener;
  26 import java.awt.Point;
  27 import java.awt.Robot;
  28 import java.awt.event.InputEvent;
  29 import java.awt.image.BufferedImage;
  30 import org.netbeans.jemmy.ClassReference;
  31 import org.netbeans.jemmy.image.StrictImageComparator;
  32 import org.netbeans.jemmy.operators.JButtonOperator;
  33 import org.netbeans.jemmy.operators.JFrameOperator;
  34 import static org.jemmy2ext.JemmyExt.*;
  35 import org.testng.annotations.Test;
  36 import static com.sun.swingset3.demos.button.ButtonDemo.*;
  37 import org.testng.annotations.Listeners;
  38 
  39 /*
  40  * @test
  41  * @key headful screenshots intermittent
  42  * @summary Verifies buttons on SwingSet3 ButtonDemo page by clicking each
  43  *          button, taking its screenshots and checking that pressed button
  44  *          image is different from initial button image.
  45  *
  46  * @library /sanity/client/lib/jemmy/src
  47  * @library /sanity/client/lib/Extensions/src
  48  * @library /sanity/client/lib/SwingSet3/src
  49  * @modules java.desktop
  50  *          java.logging
  51  * @build org.jemmy2ext.JemmyExt
  52  * @build com.sun.swingset3.demos.button.ButtonDemo
  53  * @run testng ButtonDemoScreenshotTest
  54  */
  55 @Listeners(GuiTestListener.class)
  56 public class ButtonDemoScreenshotTest {
  57 
  58     private static final int BUTTON_COUNT = 6; // TODO: Decide about "open browser" buttons (value was 8 originally)
  59 
  60     @Test
  61     public void test() throws Exception {
  62         Robot rob = new Robot();
  63 
  64         new ClassReference(ButtonDemo.class.getCanonicalName()).startApplication();
  65 
  66         JFrameOperator mainFrame = new JFrameOperator(DEMO_TITLE);
  67         waitImageIsStill(rob, mainFrame);
  68 
  69         // Check all the buttons
  70         for (int i = 0; i < BUTTON_COUNT; i++) {


< prev index next >