23 24 import org.jtregext.GuiTestListener; 25 import com.sun.swingset3.demos.scrollpane.ScrollPaneDemo; 26 import static com.sun.swingset3.demos.scrollpane.ScrollPaneDemo.DEMO_TITLE; 27 import static org.testng.AssertJUnit.*; 28 import org.testng.annotations.Test; 29 import org.netbeans.jemmy.ClassReference; 30 import org.netbeans.jemmy.operators.JFrameOperator; 31 import org.netbeans.jemmy.operators.JScrollPaneOperator; 32 import org.testng.annotations.Listeners; 33 34 /* 35 * @test 36 * @key headful 37 * @summary Verifies SwingSet3 ScrollPaneDemo by scrolling to bottom, to top, 38 * to left and to right and checking scroll bar values. 39 * 40 * @library /sanity/client/lib/jemmy/src 41 * @library /sanity/client/lib/Extensions/src 42 * @library /sanity/client/lib/SwingSet3/src 43 * @build org.jemmy2ext.JemmyExt 44 * @build com.sun.swingset3.demos.scrollpane.ScrollPaneDemo 45 * @run testng ScrollPaneDemoTest 46 */ 47 @Listeners(GuiTestListener.class) 48 public class ScrollPaneDemoTest { 49 50 @Test 51 public void test() throws Exception { 52 53 new ClassReference(ScrollPaneDemo.class.getName()).startApplication(); 54 55 JFrameOperator frame = new JFrameOperator(DEMO_TITLE); 56 JScrollPaneOperator jspo = new JScrollPaneOperator(frame); 57 58 // Set initial scrollbar positions 59 int initialVerticalValue = jspo.getVerticalScrollBar().getValue(); 60 int initialHorizontalValue = jspo.getHorizontalScrollBar().getValue(); 61 62 System.out.println("Initial Vertical Value = " + jspo.getVerticalScrollBar().getValue()); | 23 24 import org.jtregext.GuiTestListener; 25 import com.sun.swingset3.demos.scrollpane.ScrollPaneDemo; 26 import static com.sun.swingset3.demos.scrollpane.ScrollPaneDemo.DEMO_TITLE; 27 import static org.testng.AssertJUnit.*; 28 import org.testng.annotations.Test; 29 import org.netbeans.jemmy.ClassReference; 30 import org.netbeans.jemmy.operators.JFrameOperator; 31 import org.netbeans.jemmy.operators.JScrollPaneOperator; 32 import org.testng.annotations.Listeners; 33 34 /* 35 * @test 36 * @key headful 37 * @summary Verifies SwingSet3 ScrollPaneDemo by scrolling to bottom, to top, 38 * to left and to right and checking scroll bar values. 39 * 40 * @library /sanity/client/lib/jemmy/src 41 * @library /sanity/client/lib/Extensions/src 42 * @library /sanity/client/lib/SwingSet3/src 43 * @modules java.desktop 44 * java.logging 45 * @build org.jemmy2ext.JemmyExt 46 * @build com.sun.swingset3.demos.scrollpane.ScrollPaneDemo 47 * @run testng ScrollPaneDemoTest 48 */ 49 @Listeners(GuiTestListener.class) 50 public class ScrollPaneDemoTest { 51 52 @Test 53 public void test() throws Exception { 54 55 new ClassReference(ScrollPaneDemo.class.getName()).startApplication(); 56 57 JFrameOperator frame = new JFrameOperator(DEMO_TITLE); 58 JScrollPaneOperator jspo = new JScrollPaneOperator(frame); 59 60 // Set initial scrollbar positions 61 int initialVerticalValue = jspo.getVerticalScrollBar().getValue(); 62 int initialHorizontalValue = jspo.getHorizontalScrollBar().getValue(); 63 64 System.out.println("Initial Vertical Value = " + jspo.getVerticalScrollBar().getValue()); |