I am currently working on a Ruby on Rails/GWT application using the
"scaffold" restful goodness. The "scaffold" stuff allows Ruby on Rails
to easily create (roughly) restful resources. I created all my
resources, I set up validation for each of these resources, I set up
domain logic between these resources (ok, mostly). The server is
conceptually done.
Now, I am trying to program a GWT client frontend. Obviously (this
being rails) I am not going to use a Java server. Therefore when I run
in hosted mode I use the "-noserver" option, compile my generated
JavaScript into my rails application, and the files are hosted from my
rails development server. So far so good. I will admit I have some
confusion as to how my application is running in hosted mode but
seemingly being served from my rails server, but these are details and
not germane to my main problem.
My big grip so far is that I can't seem to get asynchronous server
based unit testing working at all. Period. When I attempt to access
resources on my rails server when running asynchronous unit test from
eclipse, I keep getting messages like this.
The development shell servlet received a request for 'answers' in
module 'com.quizzer.quizzer.JUnit.gwt.xml'
[WARN] Resource not found: answers; (could a file be missing from
the public path or a <servlet> tag misconfigured in module
com.quizzer.quizzer.JUnit.gwt.xml ?)
Hello Stephen, responseText was => <<Cannot find resource 'answers' in
the public path of module 'com.quizzer.quizzer.JUnit'
>>
Maybe this message makes sense to some people, to me it seems a little
confusing. I am guessing it means something like "Hey, you are trying
to access some small program/servlet named "answers", unfortunately, I
don't know what "answers" is, so I am having trouble helping you out".
I posted the test that this message comes from below.
@SuppressWarnings("deprecation")
public void testUpdate() {
delayTestFinish(500);
HTTPRequest.asyncGet("answers", new ResponseTextHandler(){
public void onCompletion(String responseText) {
System.out.println("Hello Stephen, responseText
was => <<" +
responseText + ">>");
finishTest();
}
});
}
The following testUpdate() unit test does pass. But obviously the
return value I am getting as responseText is not what I expected. If I
run the same HTTPRequest in hosted mode (with "-noserver") I get back
the restfull resource I was expecting. What am I doing wrong? Is it
possible to do unit testing with the "-noserver" option?
A few note:
1) It appears that the unit test are still running through the
integrated Tomcat lite server
2) I though that maybe I could make the Tomcat server a reverse proxy
into my ruby server, then I could just leave everything as is test/
debug/develop in hosted mode, and compile when going into production.
This would be cool, except that I have no idea how to do so in Tomcat.
3) Just to re-iterate, I seem to have the -noserver stuff working well
enough in hosted mode in general, it is only in the case that I run
unit test that things seem to go haywire.
Any help would be appreciated, thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---