0 Replies Latest reply on Aug 11, 2003 11:49 AM by nate

    Request/Response serialization

    nate

      I am working on some code that utilizes JBoss AOP and some of the XML persistence mechanisms out there like Koala (http://koala.ilog.fr/koml/) or Castor (http://www.castor.org/). I know on almost every project I am ever on there is a dependency to an external resource (i.e. database, web service, LDAP, etc.) that has its own timelines and management. To get new "test data" for unit testing or even basic development it becomes quite tedious to ask that external team to manage their test data or resources according to my expectations and schedule. I wish I could record once an example of a request going into their service, and the response coming back. And then replicate these messages with my own tweaks to provide a complete set of mock objects. (www.easymock.com is interesting, but I don't usually have interfaces handy for the services I am mocking, and I wish I could use an example of a request/response from the service as a template for creating a larger set of mock value objects). JBoss AOP is great for this because now we can easily intercept and inspect these requests and responses.

      The goal of some code I am working on is to create a user friendly framework for recording a request and response to some "service" (some function capable of interception from AOP). In the JavaDoc or jboss-aop.xml fille, a user can specify which methods should be recorded. A user can then specify in another properties file if they are in record, or playback mode. The messages would be serialized to XML so they can be easily modified in a text editor, and also be copied and pasted into new files for the easy creation of new data. This approach has drawbacks because to get the template request/response the service needs to pretty much work in some fashion, even if its erroneous data, at least once.

      I am looking for some affirmation that developers out there think this could be a valuable tool. If anyone is interested I can post more details here or discuss in another medium.