|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DialogDriver | Line # 38 | 2 | 0% | 2 | 0 | 100% |
1.0
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| No Tests | |||
| 1 | /* | |
| 2 | * Created on Feb 29, 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.assertions.Assertions.assertThat; | |
| 19 | import static org.fest.swing.driver.DialogModalQuery.isModal; | |
| 20 | ||
| 21 | import java.awt.Dialog; | |
| 22 | ||
| 23 | import org.fest.swing.annotation.RunsInEDT; | |
| 24 | import org.fest.swing.core.Robot; | |
| 25 | ||
| 26 | /** | |
| 27 | * Understands functional testing of <code>{@link Dialog}</code>s: | |
| 28 | * <ul> | |
| 29 | * <li>user input simulation</li> | |
| 30 | * <li>state verification</li> | |
| 31 | * <li>property value query</li> | |
| 32 | * </ul> | |
| 33 | * This class is intended for internal use only. Please use the classes in the package | |
| 34 | * <code>{@link org.fest.swing.fixture}</code> in your tests. | |
| 35 | * | |
| 36 | * @author Alex Ruiz | |
| 37 | */ | |
| 38 | public class DialogDriver extends WindowDriver { | |
| 39 | ||
| 40 | /** | |
| 41 | * Creates a new </code>{@link DialogDriver}</code>. | |
| 42 | * @param robot the robot to use to simulate user input. | |
| 43 | */ | |
| 44 | 60 |
public DialogDriver(Robot robot) { |
| 45 | 60 | super(robot); |
| 46 | } | |
| 47 | ||
| 48 | /** | |
| 49 | * Asserts that the<code>{@link Dialog}</code> is modal. | |
| 50 | * @param dialog the target <code>Dialog</code>. | |
| 51 | * @throws AssertionError if this fixture's <code>Dialog</code> is not modal. | |
| 52 | */ | |
| 53 | 2 |
@RunsInEDT |
| 54 | public void requireModal(Dialog dialog) { | |
| 55 | 2 | assertThat(isModal(dialog)).as(propertyName(dialog, "modal")).isTrue(); |
| 56 | } | |
| 57 | } | |
|
||||||||||||