Hi Damon,
Before going further down the track of being able to issue requests for
resources from within a JUnit test case, you might want to consider if
that's a good idea to begin with. Generally, unit tests are meant to test
individual units of functionality down to the method (and in some cases,
down to the method with varying test data). This would make the unit test
more useful as its failure will tell you exactly what part isn't behaving as
expected, and thus you save time running a debugger and stepping through
your code.

It seems that if your tests are making requests for resources, they are
grossly over-scoped. That said, if you really do need to get these files in
for your test cases for your own reasons, have you considered using simple
File I/O? This would allow you to get any resources your depending on and
test your component with those resources as part of the input test data. On
the other hand, if the requests are being made from within the methods you
are testing, that might suggest that a code refactoring is in order (i.e.
separate out the part that you want to test from the part making the
requests into another method / component).

Hope that helps,
-Sumit Chandel

On Mon, Jul 27, 2009 at 8:36 PM, <damonfeld...@verizon.net> wrote:

> We have a nice GWT project that hits our XQuery server but are missing out
> on many of the features of GWT, and I'm trying to add them in despite our
> non-standard configuration.  The overall situation should be identical to
> GWT+Ruby or PHP, except that we are using XQuery as the back end language.
>
> One item is that I get either
>
> "The development shell servlet received a request for 'MyApp.css' in module
> 'com.foo.app.MyApp.JUnit.gwt.xml' "
>
> errors, and/or cross-domain violations when I try to Run JUnit to test a
> service.  Specifically, the files are simply not found when I use a relative
> URL for the RequestBuilder, and if I hardcode the URL to be the correct
> server+port I also get cross-domain violations.
>
> Our setup is that we use GWT with v 1.6 to push compiled .js into a war
> directory which also contains XQuery code, and have our non-java server
> serve up files from that location.  Running JUnit (or hosted mode) however
> seems to lock us into the embedded tomcat that GWT uses.  Are there standard
> workarounds?  I'm considering trying to proxy everything with a small Java
> server that is also running to provide some file processing utilities we
> need, but am concerned about the performance impact of that approach.
>
> Thoughts or pointers would be appreciated.
>
> Damon
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to