Luca Morandini wrote: > Kamal wrote: >> Hi, >> I have been thinking about testing REST based web services of late. It >> occurred to me that these web services are very difficult to test > > Really ? My impression is the opposite: a REST-style web service should > be usable by humans and machines alike, which makes them easier to test > (easier then the RPC-style web services, anyway).
Same impression here. The Cocoon 3 integration tests should give you some hints how the testing can be done via HTTP. See the cocoon-sample and cocoon-sample-webapp module. >> against. I was thinking that maybe there is some funky way of mocking >> a web service, using XPath and regexes to match on the requst, and use >> a templating language to generate the response (based on variables >> generated from the XPath and regexes). I was thinking maybe Cocoon 3.0 >> might help me here. > > I think you could do the same with 2.1 or 2.2 as well. Yes, or you can use the Cocoon 3 REST module which provides a JSR311 inspired controller implementation. Also see http://cocoon.apache.org/3.0/features.html for a basic example. Regarding your testing question above, those REST controller classes can be unit tested easily. -- Reinhard Pötz Managing Director, {Indoqa} GmbH http://www.indoqa.com/en/people/reinhard.poetz/ Member of the Apache Software Foundation Apache Cocoon Committer, PMC member [EMAIL PROTECTED] ________________________________________________________________________ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
