Starting from version 1.6 it will no longer work http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/doc/helpInfo/servletMappings.html
среда, 1 декабря 2010 г., 10:57:34 UTC+2 пользователь ra написал: > > On Mon, Nov 29, 2010 at 5:14 PM, Raphael André Bauer > <[email protected] <javascript:>> wrote: > > Hi folks, > > > > > > what I want to do are two simple things: > > 1. Mock a RESTFul Api using a servlet. > > 2. Use that mock inside a GWTTestCase that retrieves data from that > > servlet and does some meaningful testing. > > > > I am running here into a lot of problems where the servlet is not > > started from the GWTTestCase, where the web.xml is not loaded and so > > on. Using a different server is not working either, because of the > > same origin policy of the built-in jetty. > > > > I stumbled across some nice posts from Alex Moffat: > > http://development.lombardi.com/?p=15 > > > > But I guess this information is outdated because of the tomcat > references. > > > > > > So. My question is: Does anybody use GWTTestCase to test GWT modules > > against a "real" RESTFul web service (mocked as described above - but > > running on the server). Or is this not a intended use case? > > I solved it 99%. Check out also discussion > ( > http://groups.google.com/group/google-web-toolkit/browse_thread/thread/aab1eac5909c3437 > ). > > The way to go is to use a gwt.xml for your GWTTestCase with a servlet > definition. > > <servlet class="yourServletClass" path="/test.json"/> > > You can then test against that servlet simply by calling > > GWT.getModuleBaseURL() + /test.json > > > This is a cool solution how to test my API. If anybody knows a > solution how to map my test.json into the root of my server I would be > totally happy. But it's also cool the way it is now. > > > Cheers, > > > Raphael > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/N23x-T0E0N4J. 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.
