Re: newbie - unit test
On 16 oct, 23:25, Ray Tayek <rta...@ca.rr.com> wrote:
> hi, i added a unit test to the greet example (please see code below). i get
>
> Starting HTTP on port 0
> HTTP listening on port 4889
> Startinghttp://192.168.1.105:4889/p.R.JUnit/junit.html?gwt.codesvr=192.168.1....
> on browser FF3
> Module p.R.JUnit has been loaded
> The development shell servlet received a request for 'greet' in
> module 'p.R.JUnit.gwt.xml'
> [WARN] Resource not found: greet; (could a file be missing from
> the public path or a <servlet> tag misconfigured in module p.R.JUnit.gwt.xml ?)
> lose: com.google.gwt.user.client.rpc.StatusCodeException: Cannot find
> resource 'greet' in the public path of module 'p.R.JUnit'
>
> All clients connected (Limiting future permutations to: gecko1_8)
>
> the :"lose" message is mine, coming from onFailure() in the async callback.
>
> i don't think i changed anything except the on module load file.
JUnit tests do not use your web.xml, so you have to declare your
servlets in the gwt.xml.
As for the module name, GWT's JUnitShell synthesize a module that
<inherits/> your module (the one you return from your test's
getModuleName()) and calls it the same as your module with a ".JUnit"
suffix.
So if you don't want to include a <servlet> tag in your module, you
can create a "test module" that inherits your "normal" module and adds
the <servlet> tag, and return this module's name from your unit test.
The <servlet> tag is documented here:
http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideModuleXml
and here http://code.google.com/webtoolkit/doc/latest/DevGuideTesting.html
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home