Unit testing of GWT RequestFactory services without GWTTestCase

后端 未结 2 1138
慢半拍i
慢半拍i 2021-02-03 10:17

Somewhere, I don\'t remember where, I spotted information, that starting from GWT 2.1.1 it is possible to test ReqeustFactory services without GWTTestCase. If this is true, plea

相关标签:
2条回答
  • 2021-02-03 10:39

    The RequestFactorySource type can be used to instantiate RequestFactory instances in non-GWT runtimes. The previously-mentioned InProcessRequestTransport is used by GWT's own RequestFactoryJreSuite tests to avoid the need to fire up an entire GWT runtime environment.

    The RequestFactorySource type isn't limited to just testing. If you implement your own RequestTransport (perhaps based on a java.net.HttpUrlConnection or Apache HttpClient library), you can write console apps, bulk-query apps, or health probers using your production RequestFactory endpoints. This is a huge improvement over GWT`s old RPC system, which only supports GWT-based clients.

    0 讨论(0)
  • 2021-02-03 11:05

    I found it myself browsing GWT's source code. The answer is hidden in InProcessRequestTransport javadoc:

    https://gwt.googlesource.com/gwt/+/master/user/src/com/google/web/bindery/requestfactory/server/testing/InProcessRequestTransport.java

    0 讨论(0)
提交回复
热议问题