Hi John,

Thanks for your reply.

> There are really two apps running in this case.  First, there is the one
> created by JUnitShell, which contacts an RPC servlet to manage running the
> test.  The timeout you see is because that servlet didn't get contacted.

Could you please give me some more info and pointers here?
I find the GWT Junit code difficult to follow, especially debugging is
a bit hard.
Where and how does this required servlet get contacted to overcome the
timeout?
If I follow the service method in GWTShellServlet, I don't understand
where the required contact is made.
And I can't find the relation with the messageQueue in the method
JUnitShell.notdone() that must contain the required info to overcome
the timeout exception :(

The GWT Tomcat instance that contains my proxy servlet and my
standalone Tomcat instance, run on the same server (the Cargo maven
plugin starts the stanalone tomcat instance on port 8090)

> When you say noserver mode, what exactly do you mean?  JUnitShell doesn't

Maybe it's better not to use the word noserver in this case it might
be misleading. I use the noserver mode during development mode with
own launch files.
In this case it doesn't make sense as GWT Junit always uses his own
Tomcat instance like you explain.

> If you need a real browser to run the test in an automated way, the
> recommendation would be to use -runStyle Selenium:uri and run a Selenium-RC

I also use Selenium, have about 2500 tests that run through Selenium,
that take about 50 hours to complete ;)...
Some background info:
I don't use runstyle for this. I run the tests against production
ready code produced during the nigtly build.
I run my tests through testNG with Maven surefire plugin.

I have build a little testing framework around Selenium RC in which
case Selenium RC is just an implementation detail. I could also use
other Ajax testing framework by creating a class that implements my
Browser interface and connects to the testing framework.
I model all elements on the screen that I want to test as objects and
inject a Browser instance (link to Selenium). I then ask the element
object something like isPresent(), isPresentWait(), typeText(String),
etc... or in case of a DatePickerElement, something like:
setDate(Date). The Date picker implementation will then open the date
picker and choose the specified date and close it again.
So you end up having a class hierarchy of Elements like TextElement,
DateElement, etc....

I use it now for about two years and it works well and the tester that
uses it, which isn't a experienced developers, likes it and can make
his test scenarios well in eclipse...


On Oct 5, 2:07 pm, John Tamplin <j...@google.com> wrote:
> On Tue, Oct 5, 2010 at 5:50 AM, Ed <post2edb...@gmail.com> wrote:
> > Yesterday my test was run with success and last night it failed again,
> > without anything changing in the meantime :(
>
> > I was digging a bit more in the GWT Junit test code and I think the
> > test fails because I don't use a servlet that is hosted by the Tomcat
> > container started by GWT.
> > Like Freeland mentions above, I have to contact the backend within 60
> > sec to overcome the timeout exception. I think I have to contact a
> > servlet run in the GWT Tomcat instance as otherwise it's not seen as a
> > backend contact.
> > Is this the true ?
>
> There are really two apps running in this case.  First, there is the one
> created by JUnitShell, which contacts an RPC servlet to manage running the
> test.  The timeout you see is because that servlet didn't get contacted.
>  Second, there is your actual test code, which may contact your own servlets
> that you create.  Due to SOP, these must be on the same server that the code
> was loaded from, but your proxy servlet can run there and redirect the
> request to another server since it isn't bound by that restriction.
>
> > In my case, because I run in noserver mode, I run my own tomcat
> > standalone server and use a proxy servlet that extends from
> > GWTShellServlet to forward any business/servlet calls to my standalone
> > server. So I never use any servlet in the GWT tomcat instance and as
> > such receive a timeout exception when my tests don't run fast enough,
> > which is what sometimes happens....
>
> When you say noserver mode, what exactly do you mean?  JUnitShell doesn't
> support -noserver, since as mentioned above it's own servlet has to run to
> operate the test infrastructure.
>
> > Please feedback on this and how I can solve this ?
> > The only option I see now is: disable my GWT test cases as the current
> > sometimes-failures is unacceptable on the build machine :(
> > I have no idea how to solve it otherwise...
>
> -runStyle Manual was the suggestion for how to debug what is going on.
>  There you should be able to see what is going wrong.
>
> If you need a real browser to run the test in an automated way, the
> recommendation would be to use -runStyle Selenium:uri and run a Selenium-RC
> server with the browser you want to test with.  If you are on Linux, you
> can, for example, run Firefox inside an Xvfb instance with a dedicated
> profile that includes the Developer Plugin and run your test in DevMode or
> compiled to JS.
>
> --
> John A. Tamplin
> Software Engineer (GWT), Google

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to