Problem testing in Netbeans on Mac

25 views
Skip to first unread message

hs

unread,
Sep 9, 2009, 10:23:01 AM9/9/09
to easytesting
Hi,

I have a Netbeans Platform application and I'm using FEST to test some
JPanels. The test all work when run individually. On Macs, when the
test is run by running a Test build on the platform project (as
opposed to running the test individually) the Frame is not shown, or
not in focus and therefore the test fails. The mouse is jittering and
it looks like its trying to find the component. It works fine on
Windows and Linux environments.

I have reproduced this in a stand-alone 'Hello World' application. Any
help or suggestions would be appreciated.

Thanks,
H

Alex Ruiz

unread,
Sep 9, 2009, 1:43:15 PM9/9/09
to easyt...@googlegroups.com
H,

Please post your code (the 'Hello World' app), any errors/stack trace you get and as much info as possible about your platform. Otherwise, it is hard (or impossible) to diagnose your problem.

Thanks,
-Alex

hs

unread,
Sep 9, 2009, 2:26:51 PM9/9/09
to easytesting
Hi Alex,

Thanks for the reply. Here's the test code, pretty trivial:

public class GuiTestTest {
private GuiTest panel = null;
private FrameFixture fixture;

@Before
public void setUp() {
panel = new GuiTest();
fixture = Containers.frameFixtureFor(panel);
fixture.show();
}

@Test
public void testPanel(){
fixture.textBox("exampleText").deleteText();
fixture.textBox("exampleText").enterText("Hello!");
}
}


And the stack trace from the test run:

Focus change to javax.swing.JTextField[name='exampleText',
text='Example', enabled=true, visible=true, showing=true] failed
org.fest.swing.exception.ActionFailedException: Focus change to
javax.swing.JTextField[name='exampleText', text='Example',
enabled=true, visible=true, showing=true] failed
at org.fest.swing.exception.ActionFailedException.actionFailure
(ActionFailedException.java:33)
at org.fest.swing.core.BasicRobot.focus(BasicRobot.java:240)
at org.fest.swing.core.BasicRobot.focusAndWaitForFocusGain
(BasicRobot.java:217)
at org.fest.swing.driver.JComponentDriver.invokeAction
(JComponentDriver.java:117)
at org.fest.swing.driver.JTextComponentDriver.selectAll
(JTextComponentDriver.java:107)
at org.fest.swing.driver.JTextComponentDriver.deleteText
(JTextComponentDriver.java:77)
at org.fest.swing.fixture.JTextComponentFixture.deleteText
(JTextComponentFixture.java:194)
at festtest.GuiTestTest.testPanel(GuiTestTest.java:24)


I'm using Netbeans 6.7.1 on Mac OSX. It works fine with 6.7.1 on Linux
and Windows, and also works fine when running the single test but
fails when running from the main platform project build. I you need me
to I can email the full ZIP of the application (its 6mb), just let me
know which address you'd like me to send it to. There isn't much code,
only 1 panel, and 1 test but the default footprint of the Netbeans
Platform projects is pretty large.


Thanks,
Hayden

On Sep 9, 6:43 pm, Alex Ruiz <alex.ruiz...@gmail.com> wrote:
> H,
> Please post your code (the 'Hello World' app), any errors/stack trace you
> get and as much info as possible about your platform. Otherwise, it is hard
> (or impossible) to diagnose your problem.
>
> Thanks,
> -Alex
>
Reply all
Reply to author
Forward
0 new messages