2

I'm migrating some code from FEST Swing 1.2.1 to AssertJ Swing 3.2. In the old code there are calls to

  • JInternalFrameFixture.comboBox()
  • JInternalFrameFixture.label()
  • JInternalFrameFixture.slider()

Unfortunately I do not see any matching method in JInternalFrameFixture of AssertJ Swing. What should I use instead of the methods above in AssertJ Swing 3.2?

I've found that ComponentContainerFixture has a comboBox() method but JInternalFrameFixture does not implement this one in AssertJ Swing.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
palacsint
  • 28,416
  • 10
  • 82
  • 109
  • Can't you simply create a new JComboBoxFixture directly? After all, the method only seems to return a new instance of that in FEST Swing 1.2.1 as far as I can see. – Florian Schaetz Apr 04 '16 at 06:16

1 Answers1

2

In AssertJ 3.2, given access to AssertJ's Robot, and an already existing JInternalFrameFixture, you can find a combo box within an internal frame with the following snippet:

robot().finder().findByType(internalFrameFixture.target(), JComboBox.class);

Additonally, I have submitted a pull request to assertj-swing to allow the fluent style that you are describing, i.e., frame.internalFrame().comboBox(). Hopefully it will be incorporated into a future version of AssertJ Swing.

heenenee
  • 19,914
  • 1
  • 60
  • 86