Last change
on this file since 193 was
193,
checked in by Maciej Komosinski, 10 years ago
|
Set svn:eol-style native for all textual files
|
-
Property svn:eol-style set to
native
|
File size:
1.0 KB
|
Rev | Line | |
---|
[97] | 1 | package com.framsticks.gui; |
---|
| 2 | |
---|
| 3 | import org.fest.swing.core.Robot; |
---|
| 4 | import org.fest.swing.edt.FailOnThreadViolationRepaintManager; |
---|
| 5 | import org.fest.swing.edt.GuiActionRunner; |
---|
| 6 | import org.fest.swing.edt.GuiTask; |
---|
| 7 | import org.fest.swing.fixture.JButtonFixture; |
---|
| 8 | import org.testng.annotations.Test; |
---|
| 9 | |
---|
| 10 | import com.framsticks.test.MonitorBasedTest; |
---|
| 11 | import static org.fest.assertions.Assertions.assertThat; |
---|
| 12 | import static org.fest.swing.edt.GuiActionRunner.executeInEDT; |
---|
| 13 | import static org.fest.swing.core.BasicRobot.robotWithNewAwtHierarchy; |
---|
| 14 | |
---|
| 15 | @Test |
---|
| 16 | public abstract class GuiTest extends MonitorBasedTest { |
---|
| 17 | |
---|
| 18 | protected static Robot robot; |
---|
| 19 | |
---|
| 20 | static { |
---|
| 21 | FailOnThreadViolationRepaintManager.install(); |
---|
| 22 | assertThat(executeInEDT()).isTrue(); |
---|
| 23 | |
---|
| 24 | robot = robotWithNewAwtHierarchy(); |
---|
| 25 | } |
---|
| 26 | |
---|
| 27 | protected void waitForIdle() { |
---|
| 28 | robot.waitForIdle(); |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | protected void clickButton(final JButtonFixture button) { |
---|
| 32 | |
---|
| 33 | // button.click(); |
---|
| 34 | |
---|
| 35 | GuiActionRunner.execute(new GuiTask() { |
---|
| 36 | @Override |
---|
| 37 | protected void executeInEDT() throws Throwable { |
---|
| 38 | button.component().doClick(); |
---|
| 39 | } |
---|
| 40 | }); |
---|
| 41 | } |
---|
| 42 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.