0

I cannot get RequestFactory to work with GWTTestCase. I see the following:

[WARN] 404 - POST /com.traviswebb.MyApp.JUnit/gwtRequest (127.0.0.1) 1439 bytes

In my MyAppJUnit.gwt.xml file, I have this:

<servlet path='/gwtRequest' class='com.google.web.bindery.requestfactory.server.RequestFactoryServlet'/>

When I run it in the browser, it just requests /myApp/gwtRequest because I have rename-to set in the module file. I tried setting this same thing in the JUnit module but it has no effect. In desperation I even tried adding

<url-pattern>/com.traviswebb.MyApp.JUnit/gwtRequest</url-pattern>

to my web.xml but that didn't work either. Ideas?

Travis Webb
  • 14,688
  • 7
  • 55
  • 109

1 Answers1

0

Per my usual Stackoverflow process, I am again answering my own question. As a last resort I checked what version of maven-surefire-plugin I was using and it was actually 2.5. This is over two years old! This is what I get for copying code straight from a tutorial. Anyway, I upgraded to 2.12 and the problem vanished with no configuration changes.

Travis Webb
  • 14,688
  • 7
  • 55
  • 109
  • Have you tried using the `gwt:test` goal instead of `surefire:test`? I typically leave my browser-ish tests to `gwt:test` as it is generally easier to adapt to running tests on remote browsers instead of just in htmlunit, and the gwt-maven-plugin is easier to keep up to date with the rest of gwt – Colin Alworth Apr 11 '12 at 17:15
  • I tried using `gwt:test` but I had the same problem. Unfortunately for science, my appetite for debugging through maven plugin hell has waned, as I'm now able to get my work done. – Travis Webb Apr 11 '12 at 17:22
  • Fair enough - glad you got it working. I don't currently have any projects freely available that use `gwt:test` and rf, but should make one as a reference for how this can work... – Colin Alworth Apr 11 '12 at 22:59