FEST

optionPane() fails to find JOptionPane with null parent

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: FEST-Swing 1.1
  • Fix Version/s: FEST-Swing 1.2a4
  • Component/s: Swing
  • Labels:
    None
  • Environment:
    Windows XP
  • Number of attachments :
    1

Description

When trying to locate a JOptionPane asking a yes/no question, I fail to obtain an JOptionPaneFixture when the JOptionPane is constructed with parent set to null.

Activity

Hide
Alex Ruiz added a comment -

Hi Stephen,

Thank you for reporting this issue. I'm having trouble reproducing this bug. Can you please post some code showing how to reproduce it? Or better yet, can you please attach a test case?

Cheers!
-Alex

Show
Alex Ruiz added a comment - Hi Stephen, Thank you for reporting this issue. I'm having trouble reproducing this bug. Can you please post some code showing how to reproduce it? Or better yet, can you please attach a test case? Cheers! -Alex
Hide
Morten Breum Mikkelsen added a comment -

Seems the problem is that the shared hidden frame used as parent for parentless option panes is constructed well before the robot is created with
BasicRobot.robotWithNewAwtHierarchy();

The option pane is found correctly when using
BasicRobot.robotWithCurrentAwtHierarchy();
instead.

Show
Morten Breum Mikkelsen added a comment - Seems the problem is that the shared hidden frame used as parent for parentless option panes is constructed well before the robot is created with BasicRobot.robotWithNewAwtHierarchy(); The option pane is found correctly when using BasicRobot.robotWithCurrentAwtHierarchy(); instead.
Hide
Alex Ruiz added a comment -

I couldn't reproduce the bug. Please review the attached test case. If you can still reproduce this bug, please attach a test case.

Show
Alex Ruiz added a comment - I couldn't reproduce the bug. Please review the attached test case. If you can still reproduce this bug, please attach a test case.
Hide
Stephen Gade Esven added a comment -

As my coleague Morten Breum already wtore, we found that the problem was that the default parent frame was contructed before our Robot instance, and we used the new AWT hierarchy. By changing to existing WAT hierarchy, the option pane was found. So the bug does not exist. It was a matter of sorting out why the parent wasn't searched.

Show
Stephen Gade Esven added a comment - As my coleague Morten Breum already wtore, we found that the problem was that the default parent frame was contructed before our Robot instance, and we used the new AWT hierarchy. By changing to existing WAT hierarchy, the option pane was found. So the bug does not exist. It was a matter of sorting out why the parent wasn't searched.
Hide
Alex Ruiz added a comment -

I actually found a way to make the test fail, by launching a JOptionPane and then creating a Robot with a new AWT ComponentHierarchy. In theory, it should work, but it didn't. The problem is that the hierarchy did not include ownerless windows.

Show
Alex Ruiz added a comment - I actually found a way to make the test fail, by launching a JOptionPane and then creating a Robot with a new AWT ComponentHierarchy. In theory, it should work, but it didn't. The problem is that the hierarchy did not include ownerless windows.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: