Hi,

qooxdoo contains an excellent infrastructure to test the client-side
classes. What is still needed are similar things for the backend. While
there can be no general way for the diverse backends, I am thinking of
creating a testing infrastructure for the json-rpc backends that is based on
the rpcconsole contribution. I think that this system should combine
*mockup* and *testing*.

a) mockup here means to replace the real data requests by prefabricated
responses in order to be able to test the client-side application without a
backend.

b) testing here refers to issue real requests to the backend and to compare
the returning data to expected responses. This way, the backend service
classes can be tested. In particular, it would be good to create the test
data ON the backend, so that a method-level testing can easily be
maintained. 

There can be a combination of both - mockup data can be recorded from real
requests, and be replayed for the client AND be used to test the backend.

I am currently thinking of the following architecture:

http://n2.nabble.com/file/n4680880/rpcconsole.jpg  

The rpcconsole.MRpcMockup is a mixin that qx.io.remote.Rpc is patched with
to allow the substitution of "real" requests with data from the mockup data
cache. You can produce mockup data by running your application with the
backend and controlling the mixin with its static methods. All requests and
responses are recorded and can be saved, through a jsonrpc service call, to
the server. The data is saved in the resource/rpcconsole folder. From there,
it can be retrieved and "replayed" in the application that then no longer
needs the backend, as long as every possible request has been pre-recorded.

On the other hand, usind the rpcconsole.demo.Application(), you can use a
visual widget to run test suits that are generated from the API
documentation in the code of the service classes themselves. My current
solution in PHP is to add a @rpctest documentation tag that contains a json
snippet with the test data. This way, maintaining a test suite is much more
easy than maintaining a separate json test file and the PHP classes. A
special introspection mehtod then collects the json from the documentation
and "feeds" the RpcConsole widget.

What do you think? Do you have a better idea how to implement this?

Thanks, Christian 
-- 
View this message in context: 
http://n2.nabble.com/jsonrpc-testing-infrastructure-tp4680880p4680880.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to