Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
SWT Drivers
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Toby  
View profile  
 More options Dec 16 2008, 11:05 am
From: Toby <toby.wes...@gmail.com>
Date: Tue, 16 Dec 2008 08:05:58 -0800 (PST)
Local: Tues, Dec 16 2008 11:05 am
Subject: SWT Drivers
Hello,

Just starting to browse the source after Nat piqued my interest at
XPDay... I was wondering about SWT/JFace support, am I right in
thinking it doesn't yet support it? Would that be of interest to the
wider audience do you think?

Thanks,
Toby


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nat Pryce  
View profile  
 More options Dec 16 2008, 11:56 am
From: Nat Pryce <nat.pr...@gmail.com>
Date: Tue, 16 Dec 2008 08:56:32 -0800 (PST)
Local: Tues, Dec 16 2008 11:56 am
Subject: Re: SWT Drivers
Hi.  You're right, we have not added any support for SWT.  I'm sure
people would be interested, though.

You should be able to build an SWT prober by extending the
UnsynchronizedProber in the Windowlicker Core API, and writing Tracker
classes to guide the mouse pointer into SWT components.  All I know of
SWT is that the event loop is not hidden away in a background thread
as it is with Swing, so you might need a way to spawn a thread from
the test to run the application under test, and close down that thread
in a reliable manner.

--Nat

On Dec 16, 4:05 pm, Toby <toby.wes...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Toby  
View profile  
 More options Dec 16 2008, 2:31 pm
From: Toby <toby.wes...@gmail.com>
Date: Tue, 16 Dec 2008 11:31:53 -0800 (PST)
Local: Tues, Dec 16 2008 2:31 pm
Subject: Re: SWT Drivers
Thanks for the reply, sounds good. I started playing around and will
see where it goes...

What's the best way to get feedback if I get anywhere? Should I post
patches here?

Cheers ears,
Toby

On Dec 16, 4:56 pm, Nat Pryce <nat.pr...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Toby  
View profile  
 More options Dec 22 2008, 3:47 pm
From: Toby <toby.wes...@gmail.com>
Date: Mon, 22 Dec 2008 12:47:07 -0800 (PST)
Local: Mon, Dec 22 2008 3:47 pm
Subject: Re: SWT Drivers
Hello,

I've posted a bit of a spike experimenting with an SWT driver, it can
be found at

http://groups.google.com/group/windowlicker-users/web/window-licker-s...

I'm not proposing it go into the source or anything but would be
really interested in peoples thoughts. Most of it is a blatant cut and
paste from the Swing part but with minor adaptations for SWT. In
particular, have a look at the following classes

SwtCalculator and SwtBasicArithmeticTests (both unfinished but
demonstrate the idea)
TextDriverTest
UIThread (tries to make more explicit the creation of the UI thread)

The jist of it all is that we have to create a UI thread to run the
SWT stuff from within the test without blocking the actual tests. The
solution I came up with means that any application that wants to use
the framework would need to change slightly but I can't see a way to
avoid this.

The change is kind of minor and when I think about it, actually makes
good sense for SWT apps. It means that rather than like most SWT apps
that start the event dispatching loop from within the main thread, you
should code your app to *optionally* start the event loop (which is
how JFace do it with the ApplicationWindow class). The UIThread class
tries to help here and test code is free to use it to make more
explicit the creation of the UI thread. The tests will then run in the
main thread. Anyway, hopefully the code explains it better than I do!

oh, the other thing is that the patch doesn't include the SWT/JFace
jars that you'll need to actually run it. You can download these from;

http://code.google.com/p/gibble/source/browse/trunk/gibble/lib/jface
http://code.google.com/p/gibble/source/browse/trunk/gibble/lib/swt

All the best,
Toby

On Dec 16, 4:56 pm, Nat Pryce <nat.pr...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nat Pryce  
View profile  
 More options Dec 23 2008, 3:25 am
From: "Nat Pryce" <nat.pr...@gmail.com>
Date: Tue, 23 Dec 2008 08:25:33 +0000
Local: Tues, Dec 23 2008 3:25 am
Subject: Re: SWT Drivers
2008/12/22 Toby <toby.wes...@gmail.com>:

> The
> solution I came up with means that any application that wants to use
> the framework would need to change slightly but I can't see a way to
> avoid this.

> The change is kind of minor and when I think about it, actually makes
> good sense for SWT apps. It means that rather than like most SWT apps
> that start the event dispatching loop from within the main thread, you
> should code your app to *optionally* start the event loop (which is
> how JFace do it with the ApplicationWindow class). The UIThread class
> tries to help here and test code is free to use it to make more
> explicit the creation of the UI thread. The tests will then run in the
> main thread.

Can you not spawn a thread in the test to run the app's main method
and then call Display.findDisplay(thread) to find the app's display?

--Nat


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Toby  
View profile  
 More options Dec 23 2008, 6:50 am
From: Toby <toby.wes...@gmail.com>
Date: Tue, 23 Dec 2008 03:50:10 -0800 (PST)
Local: Tues, Dec 23 2008 6:50 am
Subject: Re: SWT Drivers

On Dec 23, 8:25 am, "Nat Pryce" <nat.pr...@gmail.com> wrote:

> 2008/12/22 Toby <toby.wes...@gmail.com>:

> Can you not spawn a thread in the test to run the app's main method
> and then call Display.findDisplay(thread) to find the app's display?

> --Nat

hmmm, not sure. The test does spawn a thread for the main and in the
run of that thread starts the annoying SWT event loop business. So
that sets up the UI and its off ready to handle UI events. The main
thread is then off to run the actual tests. The problem was that one
of the threads has to get into the event loop and essentially block
and that can't happen in the apps main (at least when under test) else
the test blocks.

I'll have a look and see if I can figure out something with
findDisplay. Right now it enforces that everything happends of the
default display so we can call Display.getDefault() to interact with
it. findDisplay might be more sensibe though.

Not sure if that answers your question!

Cheers,
Toby


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nat Pryce  
View profile  
 More options Dec 23 2008, 12:34 pm
From: Nat Pryce <nat.pr...@gmail.com>
Date: Tue, 23 Dec 2008 17:34:28 +0000
Local: Tues, Dec 23 2008 12:34 pm
Subject: Re: SWT Drivers
The event loop should not block the test thread because it runs on the  
GUI thread that the test thread spawned, unless I've missed something  
about how swt behaves.

www.natpryce.com

On 23 Dec 2008, at 11:50, Toby <toby.wes...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Toby  
View profile  
 More options Dec 24 2008, 7:58 am
From: Toby <toby.wes...@gmail.com>
Date: Wed, 24 Dec 2008 04:58:21 -0800 (PST)
Local: Wed, Dec 24 2008 7:58 am
Subject: Re: SWT Drivers
On Dec 23, 5:34 pm, Nat Pryce <nat.pr...@gmail.com> wrote:

> The event loop should not block the test thread because it runs on the  
> GUI thread that the test thread spawned, unless I've missed something  
> about how swt behaves.

> www.natpryce.com

That sounds about right, I probably wasn't very clear when I said
'block' before. You're right, the event loop doesn't block the test
thread once its been spawned in its own thread. The biggest problem I
had with the spike was spawning that thread.

What did you think of that as an approach, using the UIThread from
within the test etc?


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
nat.pr...@gmail.com  
View profile  
 More options Dec 24 2008, 9:42 am
From: nat.pr...@gmail.com
Date: Wed, 24 Dec 2008 14:42:13 +0000
Local: Wed, Dec 24 2008 9:42 am
Subject: Re: SWT Drivers
Having a class that performs all the drudgery of spawning and
interacting with the display thread sounds like the best approach. I
can imagine it having overloaded constructors or subclasses that know
how to run an application's main method or show a single widget for
unit testing custom controls.

Cheers,
    Nat.

On 24/12/2008, Toby <toby.wes...@gmail.com> wrote:

--
http://www.natpryce.com

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Toby  
View profile  
 More options Jan 24 2009, 5:35 am
From: Toby <toby.wes...@gmail.com>
Date: Sat, 24 Jan 2009 02:35:08 -0800 (PST)
Local: Sat, Jan 24 2009 5:35 am
Subject: Re: SWT Drivers
So just for reference, a discussion of the UIThread class can be found
here http://pequenoperro.blogspot.com/2008/12/be-explicit-about-ui-thread-...
and a more refined version here
http://code.google.com/p/gibble/source/browse/trunk/gibble/src/test-e...

Cheers


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nat Pryce  
View profile  
 More options Jan 25 2009, 8:08 am
From: Nat Pryce <nat.pr...@gmail.com>
Date: Sun, 25 Jan 2009 13:08:35 +0000
Local: Sun, Jan 25 2009 8:08 am
Subject: Re: SWT Drivers
Good stuff.  Thanks for the links.

--Nat

2009/1/24 Toby <toby.wes...@gmail.com>:

> So just for reference, a discussion of the UIThread class can be found
> here http://pequenoperro.blogspot.com/2008/12/be-explicit-about-ui-thread-...
> and a more refined version here
> http://code.google.com/p/gibble/source/browse/trunk/gibble/src/test-e...

> Cheers

--
http://www.natpryce.com

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google