Chen, Min | 26 Sep 2009 02:15
Picon
Favicon

Why JTextComponentTester.actionEnterText does not trigger listeners registered for some JTextField?

Hi there,

 

                I am testing a Swing panel using abbot. In this Swing panel, there are two JTextField, when user typed something into JTextField 1, JTextField 2 will be automatically populated with value of JTextField 1. However, if I used JTextComponentTester.actionEnterText(JTextField1, value), I can see from playback that value is not set to JTextField2, obviously listener registered in JTextField1 is not triggered by abbot tester, and I don’t understand why? Posting key event from abbot is different from user keyboard actions? Strangely, I also noticed that if I add the following call after actionEnterText, JTextField2 will be populated with right value:

 

actionActionMap(c, DefaultEditorKit.selectAllAction);

 

Has somebody experienced similar issues here? Thanks.

 

                -min

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
abbot-users mailing list
abbot-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/abbot-users
Timothy Wall | 30 Sep 2009 03:54
Gravatar

Re: [abbot - Help] Issue with JTextTester.actionEnterText


On Sep 29, 2009, at 9:27 PM, SourceForge.net wrote:

>
> Read and respond to this message at:
> https://sourceforge.net/projects/abbot/forums/forum/168262/topic/3415421
> By: minchencm
>
> Hi there,
>                I am testing a Swing panel using abbot. In this Swing  
> panel,
> there are two JTextField, when user typed something into JTextField  
> 1, JTextField
> 2 will be automatically populated with value of JTextField 1.

At what point is the text duplicated?  What are you listening to in  
order to duplicate the text?  Do you copy each character as it is  
typed, or when the user types "Enter"?

> However, if I used JTextComponentTester.actionEnterText(JTextField1,  
> value),
> I can see from playback that value is not set to JTextField2,  
> obviously listener
> registered in JTextField1 is not triggered by abbot tester, and I  
> don’t understand
> why? Posting key event from abbot is different from user keyboard  
> actions?

No, it's identical, except for keys for which the appropriate  
keystrokes can't be determined.  For such keys, key down/up events  
won't be generated, only key typed events.

> Strangely,
> I also noticed that if I add the following call after  
> actionEnterText, JTextField2
> will be populated with right value:
>
> actionActionMap(c, DefaultEditorKit.selectAllAction);

Again, it depends on what events you're listening to in order to  
duplicate the text.
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
Timothy Wall | 30 Sep 2009 03:58
Gravatar

Re: [abbot - Developers] launch abbot scripts on a server when commit

You set it up as you would any other automated JUnit test suite.   
However, you need to ensure that the server has a workable user  
display (you can use a dedicated display in X11, a logged in user in  
OSX; in windows I think the only option is to give the running service  
access to the desktop, otherwise the tests you'll be able to run will  
be limited).

See http://rabbit-hole.blogspot.com/2006/08/ui-testing-on-sly.html

On Sep 16, 2009, at 4:56 PM, SourceForge.net wrote:

>
> Read and respond to this message at:
> https://sourceforge.net/projects/abbot/forums/forum/168263/topic/3401336
> By: paco1975
>
> Hi,
>
> I want to know if it is possible to automatically launch abbot  
> scripts on a
> server when someone in my team commit some code? If it is possible  
> how can i
> do this?
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
Grant Birchmeier | 30 Sep 2009 15:56
Gravatar

Re: [abbot - Developers] launch abbot scripts on a server when commit

At our firm, we use Buildbot (http://buildbot.net/) to do automated
testing for every checkin.  We were able to use buildbot to launch the
Abbot tests on a Windows machine, and it's been working pretty well.

You pretty much need a dedicated test machine for this, as no other
GUI processes can run while Abbot is testing.

-Grant

On Tue, Sep 29, 2009 at 8:58 PM, Timothy Wall <twall <at> users.sf.net> wrote:
> You set it up as you would any other automated JUnit test suite.
> However, you need to ensure that the server has a workable user
> display (you can use a dedicated display in X11, a logged in user in
> OSX; in windows I think the only option is to give the running service
> access to the desktop, otherwise the tests you'll be able to run will
> be limited).
>
> See http://rabbit-hole.blogspot.com/2006/08/ui-testing-on-sly.html
>
> On Sep 16, 2009, at 4:56 PM, SourceForge.net wrote:
>
>>
>> Read and respond to this message at:
>> https://sourceforge.net/projects/abbot/forums/forum/168263/topic/3401336
>> By: paco1975
>>
>> Hi,
>>
>> I want to know if it is possible to automatically launch abbot
>> scripts on a
>> server when someone in my team commit some code? If it is possible
>> how can i
>> do this?
>>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> abbot-users mailing list
> abbot-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/abbot-users
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
Chen, Min | 30 Sep 2009 18:22
Picon
Favicon

Re: [abbot - Help] Issue with JTextTester.actionEnterText

The event UI code is listening to duplicate the text is "keyReleased", is this the reason?

-min

-----Original Message-----
From: Timothy Wall [mailto:twall <at> users.sf.net] 
Sent: Tuesday, September 29, 2009 6:54 PM
To: Abbot Users
Cc: minchencm <at> users.sf.net
Subject: Re: [abbot - Help] Issue with JTextTester.actionEnterText

On Sep 29, 2009, at 9:27 PM, SourceForge.net wrote:

>
> Read and respond to this message at:
> https://sourceforge.net/projects/abbot/forums/forum/168262/topic/3415421
> By: minchencm
>
> Hi there,
>                I am testing a Swing panel using abbot. In this Swing  
> panel,
> there are two JTextField, when user typed something into JTextField  
> 1, JTextField
> 2 will be automatically populated with value of JTextField 1.

At what point is the text duplicated?  What are you listening to in  
order to duplicate the text?  Do you copy each character as it is  
typed, or when the user types "Enter"?

> However, if I used JTextComponentTester.actionEnterText(JTextField1,  
> value),
> I can see from playback that value is not set to JTextField2,  
> obviously listener
> registered in JTextField1 is not triggered by abbot tester, and I  
> don't understand
> why? Posting key event from abbot is different from user keyboard  
> actions?

No, it's identical, except for keys for which the appropriate  
keystrokes can't be determined.  For such keys, key down/up events  
won't be generated, only key typed events.

> Strangely,
> I also noticed that if I add the following call after  
> actionEnterText, JTextField2
> will be populated with right value:
>
> actionActionMap(c, DefaultEditorKit.selectAllAction);

Again, it depends on what events you're listening to in order to  
duplicate the text.

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
Timothy Wall | 30 Sep 2009 19:25
Gravatar

Re: [abbot - Help] Issue with JTextTester.actionEnterText

Yes.  Abbot will only generate key released events for those  
characters it knows from its keymap.  Abbot's language-specific  
keymaps tell it which keys correspond to which characters.

You might consider listening to the text component document instead.

On Sep 30, 2009, at 12:22 PM, Chen, Min wrote:

> The event UI code is listening to duplicate the text is  
> "keyReleased", is this the reason?
>
> -min
>
> -----Original Message-----
> From: Timothy Wall [mailto:twall <at> users.sf.net]
> Sent: Tuesday, September 29, 2009 6:54 PM
> To: Abbot Users
> Cc: minchencm <at> users.sf.net
> Subject: Re: [abbot - Help] Issue with JTextTester.actionEnterText
>
>
> On Sep 29, 2009, at 9:27 PM, SourceForge.net wrote:
>
>>
>> Read and respond to this message at:
>> https://sourceforge.net/projects/abbot/forums/forum/168262/topic/3415421
>> By: minchencm
>>
>> Hi there,
>>               I am testing a Swing panel using abbot. In this Swing
>> panel,
>> there are two JTextField, when user typed something into JTextField
>> 1, JTextField
>> 2 will be automatically populated with value of JTextField 1.
>
> At what point is the text duplicated?  What are you listening to in
> order to duplicate the text?  Do you copy each character as it is
> typed, or when the user types "Enter"?
>
>
>> However, if I used JTextComponentTester.actionEnterText(JTextField1,
>> value),
>> I can see from playback that value is not set to JTextField2,
>> obviously listener
>> registered in JTextField1 is not triggered by abbot tester, and I
>> don't understand
>> why? Posting key event from abbot is different from user keyboard
>> actions?
>
> No, it's identical, except for keys for which the appropriate
> keystrokes can't be determined.  For such keys, key down/up events
> won't be generated, only key typed events.
>
>> Strangely,
>> I also noticed that if I add the following call after
>> actionEnterText, JTextField2
>> will be populated with right value:
>>
>> actionActionMap(c, DefaultEditorKit.selectAllAction);
>
> Again, it depends on what events you're listening to in order to
> duplicate the text.
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart  
> your
> developing skills, take BlackBerry mobile applications to market and  
> stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register  
> now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> abbot-users mailing list
> abbot-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/abbot-users

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf

Gmane