Launching SDM programatically from integrated tests

50 views
Skip to first unread message

Ali Akhtar

unread,
Apr 9, 2016, 5:49:13 PM4/9/16
to GWT Users
I'm attempting to figure out the best way to setup integrated testing in GWT. I've recently played with Rails where its really easy to launch the application and click on buttons / fill in fields, etc to simulate user behavior, and ensure the app works as expected. I'm looking for a similar solution with GWT.

So far, it looks like the best solution would be to have a Test Suite which runs all of the integrated tests, and before launching the suite, have it setup GWT's sdm mode programatically.

How can that be done? Can anyone point me to which code class / method needs to be called for starting up SDM?

Also, if there's a better way of doing what I'm trying to do, or if anyone has done this before, please share your thoughts.

I'll post my setup once I manage to get this working.

Jens

unread,
Apr 9, 2016, 7:40:14 PM4/9/16
to GWT Users

How can that be done? Can anyone point me to which code class / method needs to be called for starting up SDM?

CodeServer.main()

 
Also, if there's a better way of doing what I'm trying to do, or if anyone has done this before, please share your thoughts.

IMHO you would usually use a build system to produce a *.war file configured for integration testing (e.g. using a specific database for integration testing), to deploy it and then start integration tests using selenium/webdriver.


-- J.

Ali Akhtar

unread,
Apr 9, 2016, 8:24:34 PM4/9/16
to Google Web Toolkit
Thanks Jens.

Wars are so old school. Fat jars are the thing these days :).

In the integration test, I'm already creating an in-memory instance of the db which is injected into the server resources, so that part is covered.

The only question now is how to setup GWT for doing browser based integration testing. Will keep you guys posted on how it goes.



--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/oZvdPi9T844/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Ali Akhtar

unread,
Apr 10, 2016, 11:01:40 AM4/10/16
to Google Web Toolkit
Once CodeServer.main() has been run, is there a way to stop the code server, such as in the tear down method of the test?

On Sun, Apr 10, 2016 at 4:40 AM, Jens <jens.ne...@gmail.com> wrote:

--

Jens

unread,
Apr 10, 2016, 2:11:43 PM4/10/16
to GWT Users

Once CodeServer.main() has been run, is there a way to stop the code server, such as in the tear down method of the test?

 Hmm no. I guess you would need to run it as a separate process and then kill the process. But always starting/killing SDM also costs you time so personally I would run CodeServer once for all tests.

-- J.

Lars

unread,
Apr 11, 2016, 1:08:59 AM4/11/16
to GWT Users
You could setup a stop key for the jetty and stop this with this key later.
Reply all
Reply to author
Forward
0 new messages