Thursday, February 09, 2006

Solution to the previous post

After some evalution, I have come to a set of solutions -
1. Implement everything in some kind of scripting language, be it Perl or Python or even Jython.
2. Figure out a way so that the in-container piece of the framework can start an outside container java process as the clients.
3. Create a separate web application server to take HTTP requests, and use HTTP requests as the way to communicate with the in-container piece.

Neither of the above solution looks simple enough for me since I don't have much scripting experiences. The second solution doesn't look very 'clean'. And the third approach is also kind of "heavy", since as the minium, I have to somehow set up another webserver as part of the test infrastructure which only does very simple communications.

In the end, I was suggested to use JMS as the solution and it does wonders. It is simple, elegant, and very light weight. Everything can be written in POJO.

Basically i create an additional topic in my J2EE environment, and have the in-container piece send "commands" to this topic. I have a small standalone java application which I call a controller, it will subscribe to this JMS topic, receive and process the commands. Any parameters needed by those commands can be sent through the JMS messages. This controller will be in charge of starting and stopping those clients at the right time. In the next post, I will collect some useful information about starting a process from a java application.

But in short, I implemented this solution in a week, and it beautifully hooked up the two pieces of my automation framework.

0 Comments:

Post a Comment

<< Home