Clover Coverage Report - FEST Swing 1.2
Coverage timestamp: Tue Jun 1 2010 15:19:25 PDT
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
7   86   7   1
0   36   1   7
7     1  
1    
 
  JScrollPaneDriver       Line # 39 7 0% 7 0 100% 1.0
 
No Tests
 
1    /*
2    * Created on Sep 1, 2008
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5    * in compliance with the License. You may obtain a copy of the License at
6    *
7    * http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software distributed under the License
10    * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11    * or implied. See the License for the specific language governing permissions and limitations under
12    * the License.
13    *
14    * Copyright @2008-2010 the original author or authors.
15    */
16    package org.fest.swing.driver;
17   
18    import static org.fest.swing.edt.GuiActionRunner.execute;
19   
20    import javax.swing.JScrollBar;
21    import javax.swing.JScrollPane;
22   
23    import org.fest.swing.annotation.RunsInEDT;
24    import org.fest.swing.core.Robot;
25    import org.fest.swing.edt.GuiQuery;
26   
27    /**
28    * Understands functional testing of <code>{@link JScrollPane}</code>s:
29    * <ul>
30    * <li>user input simulation</li>
31    * <li>state verification</li>
32    * <li>property value query</li>
33    * </ul>
34    * This class is intended for internal use only. Please use the classes in the package
35    * <code>{@link org.fest.swing.fixture}</code> in your tests.
36    *
37    * @author Yvonne Wang
38    */
 
39    public class JScrollPaneDriver extends JComponentDriver {
40   
41    /**
42    * Creates a new </code>{@link JScrollPaneDriver}</code>.
43    * @param robot the robot the robot to use to simulate user input.
44    */
 
45  15 toggle public JScrollPaneDriver(Robot robot) {
46  15 super(robot);
47    }
48   
49    /**
50    * Returns the horizontal <code>{@link JScrollBar}</code> in the given <code>{@link JScrollPane}</code>.
51    * @param scrollPane the given <code>JScrollBar</code>.
52    * @return the horizontal scroll bar in the given <code>JScrollBar</code>.
53    */
 
54  2 toggle @RunsInEDT
55    public JScrollBar horizontalScrollBarIn(JScrollPane scrollPane) {
56  2 return horizontalScrollBar(scrollPane);
57    }
58   
 
59  2 toggle @RunsInEDT
60    private static JScrollBar horizontalScrollBar(final JScrollPane scrollPane) {
61  2 return execute(new GuiQuery<JScrollBar>() {
 
62  2 toggle protected JScrollBar executeInEDT() {
63  2 return scrollPane.getHorizontalScrollBar();
64    }
65    });
66    }
67   
68    /**
69    * Returns the vertical <code>{@link JScrollBar}</code> in the given <code>{@link JScrollPane}</code>.
70    * @param scrollPane the given <code>JScrollBar</code>.
71    * @return the vertical scroll bar in the given <code>JScrollBar</code>.
72    */
 
73  1 toggle @RunsInEDT
74    public JScrollBar verticalScrollBarIn(JScrollPane scrollPane) {
75  1 return verticalScrollBar(scrollPane);
76    }
77   
 
78  1 toggle @RunsInEDT
79    private static JScrollBar verticalScrollBar(final JScrollPane scrollPane) {
80  1 return execute(new GuiQuery<JScrollBar>() {
 
81  1 toggle protected JScrollBar executeInEDT() {
82  1 return scrollPane.getVerticalScrollBar();
83    }
84    });
85    }
86    }