How to make table cell editor showing in fest-swing-1rc

128 views
Skip to first unread message

Simeon Fitch

unread,
Dec 31, 2008, 4:42:23 PM12/31/08
to easyt...@googlegroups.com
FESTives,

I'm writing my first FEST-Swing test using the JTable support and am having a problem getting my test to run. I'm getting this exception:

java.lang.IllegalStateException: Expecting component org.swri.tapsui.editor.MeasureField[name=null, text='0.0 Hz', enabled=true, visible=true, showing=false] to be showing on the screen
at org.fest.swing.driver.ComponentStateValidator.componentNotShowingOnScreenFailure(ComponentStateValidator.java:87)
at org.fest.swing.driver.ComponentStateValidator.validateIsShowing(ComponentStateValidator.java:72)
at org.fest.swing.driver.ComponentStateValidator.validateIsEnabledAndShowing(ComponentStateValidator.java:44)
at org.fest.swing.driver.JTextComponentDriver$2.executeInEDT(JTextComponentDriver.java:193)
at org.fest.swing.driver.JTextComponentDriver$2.executeInEDT(JTextComponentDriver.java:191)
at org.fest.swing.edt.GuiQuery.run(GuiQuery.java:42)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:300)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:210)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:200)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:195)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:187)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)


My invocation looks like this:

        JTableFixture table = propSheet.table();

        JTableCellFixture speedCell = table.cell(TableCell.row(6).column(1));

//        speedCell.select().click();

//        speedCell.startEditing();

        speedCell.enterValue("63 Hz");



(as you can see, I've tried other calls to force it into an editing state). As you can see in the trace above, the component is visible, but not showing (that aspect of Swing component state has always confused me). Anyway, is there an additional call I need to make?

Note that my CellEditor is a custom component derived from JTextComponent (therefore shouldn't require a custom writer).

Thanks,

Simeon


--
Simeon H.K. Fitch, Principal
Mustard Seed Software, LLC
http://www.mseedsoft.com/

Simeon Fitch

unread,
Dec 31, 2008, 4:48:53 PM12/31/08
to easyt...@googlegroups.com
PS: I get the same error when editing with a cell via a JTextField:

java.lang.IllegalStateException: Expecting component javax.swing.JTextField[name=null, text='SINE 1', enabled=true, visible=true, showing=false] to be showing on the screen
at org.fest.swing.driver.ComponentStateValidator.componentNotShowingOnScreenFailure(ComponentStateValidator.java:87)
at org.fest.swing.driver.ComponentStateValidator.validateIsShowing(ComponentStateValidator.java:72)
at org.fest.swing.driver.ComponentStateValidator.validateIsEnabledAndShowing(ComponentStateValidator.java:44)
at org.fest.swing.driver.JTextComponentDriver$2.executeInEDT(JTextComponentDriver.java:193)
at org.fest.swing.driver.JTextComponentDriver$2.executeInEDT(JTextComponentDriver.java:191)
at org.fest.swing.edt.GuiQuery.run(GuiQuery.java:42)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:300)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:210)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:200)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:195)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:187)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

Alex Ruiz

unread,
Dec 31, 2008, 6:33:45 PM12/31/08
to easyt...@googlegroups.com
Hi Simeon,

It is kind of difficult to tell what the problem is :( . My understanding of 'visible' vs. 'showing' is that 'visible' is just a boolean value, but 'showing' actually tells us if a component is actually being displayed on the screen. In another words, the property 'visible' can be 'true' and because a component is not showing on the screen, it is not 'showing'.

It would be great if you could please post the code where the exception is thrown (I know it is not always possible.)

Also, I uploaded 1.0rc2 (to be released next week) to our Maven repo. This version provides a better stack trace: shows both the stack trace in the EDT and the one in the thread running the test. I think that could also help us trace where the problem is. You can find the jar(s) at http://code.google.com/p/fest/source/browse/#svn/trunk/fest/m2/repository/fest/fest-swing/1.0rc2 . I'd like to kindly ask you try this new version, if the problem is still there, at least we have more info :)

Best regards,
-Alex

csaba.juhos

unread,
Jan 1, 2009, 7:40:55 AM1/1/09
to easytesting
Hi Simeon,

Maybe your problem has to do with http://code.google.com/p/fest/issues/detail?id=177
and http://code.google.com/p/fest/issues/detail?id=251 .

Check if your TableCellEditor#getTableCellEditorComponent returns the
same instance every time it's called. If not, I believe the issues
above are at fault.

Happy new year,
Csabi

On Jan 1, 1:33 am, "Alex Ruiz" <alex.ruiz...@gmail.com> wrote:
> Hi Simeon,
>
> It is kind of difficult to tell what the problem is :( . My understanding of
> 'visible' vs. 'showing' is that 'visible' is just a boolean value, but
> 'showing' actually tells us if a component is actually being displayed on
> the screen. In another words, the property 'visible' can be 'true' and
> because a component is not showing on the screen, it is not 'showing'.
>
> It would be great if you could please post the code where the exception is
> thrown (I know it is not always possible.)
>
> Also, I uploaded 1.0rc2 (to be released next week) to our Maven repo. This
> version provides a better stack trace: shows both the stack trace in the EDT
> and the one in the thread running the test. I think that could also help us
> trace where the problem is. You can find the jar(s) athttp://code.google.com/p/fest/source/browse/#svn/trunk/fest/m2/reposi....
> I'd like to kindly ask you try this new version, if the problem is
> still
> there, at least we have more info :)
>
> Best regards,
> -Alex
>

Simeon Fitch

unread,
Jan 1, 2009, 11:42:56 AM1/1/09
to easyt...@googlegroups.com
Csabi,

Thanks! That looks *exactly* like the problem I'm having. In your first report it looks like you provided a patch that's been rolled into 1.0rc. Have you found a work-around for issue 251? I supposed the first hack I'll try is to click on the cell and then traverse the hierarchy directly with the finder.

Thanks so much for taking the time to reply!

Happy new year!

Simeon

Alex Ruiz

unread,
Jan 2, 2009, 12:56:55 AM1/2/09
to easyt...@googlegroups.com
Thanks Csabi for finding the problem! I'm working on fixing this bug! :)

Happy new year!
-Alex

Alex Ruiz

unread,
Jan 2, 2009, 12:43:22 PM1/2/09
to easyt...@googlegroups.com
Csabi and Simeon,

I fixed issue 251 ( http://code.google.com/p/fest/issues/detail?id=251 .) I attached to the issue itself the links to the code changes I made in case you want to review them. I followed Csabi's instructions and they worked wonderfully! (Thanks Csabi!)

I also uploaded a new version of 1.0rc2 (to be released next week) in case you want to give it a try. Link: http://code.google.com/p/fest/source/browse/#svn/trunk/fest/m2/repository/fest/fest-swing/1.0rc2

Once again, many thanks for your help! :)

Best regards,
-Alex
Reply all
Reply to author
Forward
0 new messages