IllegalThreadStateException in EDT
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
Research direction
Start by reproducing JTreeFixture.showPopUpMenu(2) from the reported JUnit test context, then read BasicRobot.java around waitForIdle and the JTreeDriver.java/JTreeFixture.java popup-menu path in the stack trace. Done means the popup-menu scenario no longer raises IllegalThreadStateException when the test runs on the EDT, with the behavior verified by a test.
Written by the indexing model from the issue text.
Description
Hi all,
(I opened this issues by mistake in assertj-core, too. Sorry for that).
the documentation says that the code using AssertJ should run in the EDT. I am running a JUnit test that actually runs in the EDT.
However, when invoking code like this on a JTreeFixture:
jtf.showPopUpMenu(2)
I am getting an exception
java.lang.IllegalThreadStateException: Cannot call method from the event dispatcher thread
at org.assertj.swing.core.BasicRobot.waitForIdle(BasicRobot.java:825)
at org.assertj.swing.core.BasicRobot.waitForIdle(BasicRobot.java:794)
at org.assertj.swing.core.BasicRobot.moveMouse(BasicRobot.java:538)
at org.assertj.swing.core.BasicRobot.moveMouse(BasicRobot.java:528)
at org.assertj.swing.core.BasicRobot.moveMouse(BasicRobot.java:522)
at org.assertj.swing.core.BasicRobot.focus(BasicRobot.java:292)
at org.assertj.swing.core.BasicRobot.focusAndWaitForFocusGain(BasicRobot.java:270)
at org.assertj.swing.core.BasicRobot.showPopupMenu(BasicRobot.java:889)
at org.assertj.swing.driver.JTreeDriver.showPopupMenu(JTreeDriver.java:676)
at org.assertj.swing.fixture.JTreeFixture.showPopupMenuAt(JTreeFixture.java:579)
Wait for Idle explicitely wants not to be run in the EDT. I tried running the code in a thread of its own but did not succeed. Any suggestions on how to tackle this problem would be most welcome.
- Dominant language
- Java
- Stars
- 121
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from assertj/assertj-swing
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
assertj/assertj-swing#279 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
assertj/assertj-swing#278 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
assertj/assertj-swing#276 · 1 comment ·
-
Update unit test to avoid deprecated `ExpectedException.none()` by using `Assert.assertThrows()` Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
assertj/assertj-swing#275 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
assertj/assertj-swing#277 · 1 comment ·
All issues in assertj/assertj-swing
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Difficulty 2/5 1-3 hours Newbie friendliness 65/100