Over the weekend I worked on extracting the HttpClient test framework
that comes with Tomcat 3.3, and making it a standalone framework. I've
extended it a bit to fit the purposes of testing interactions with Web
services.
Below is a simple running test with the current framework. It runs
against a SOAP stock quote Web service:
<target name="simple">
<httpClient>
<comment>Post a simple SOAP request</comment>
<soapRequest href="http://services.xmethods.net:80/soap"
content="requests/get-quote"/>
<httpStatusMatch match="200"/>
<responseMatch select="/soap:Envelope/soap:Body/n:getQuoteResponse/Result"/>
</httpClient>
</target>
So far, from the list of tasks I've published originally the most
important are implemented:
- <url-get>, <url-post> are now <httpRequest>, which allows both POST
and GET. <soapRequest> is a specialized <httpRequest> for posting SOAP
messages.
- <check> is now <responseMatch> which is extended to handle XPath
expressions in the XML/XHTML document response. It's implemented using
dom4j and Jaxen.
>From the other tasks, the biggest problem seems to be <spawn>. This
one requires changes in the Ant internals, which I'm reluctant to do,
unless I get some feedback from the Ant developers. The other tasks,
<iterate>, <database>, and <test> become pretty much useless without
<spawn>. Their reason to exist was to help logging the test results in
a database, so we can keep track of the Cocoon performance.
There are two other tasks I'm looking at to implement:
- <include> to include XML fragment files in the main Ant build.xml
file. This would allow the tests to be put in separate files, and have
them included all at once in the main Ant driver.
- <listen>. This is very specific to asynchronous SOAP
communication. In such a scenario a SOAP client sends a SOAP request
to a server, which will later on send the client on a particular URL
other SOAP messages. I'm looking at using the EmbeddedTomcat class
from Tomcat 3.3.
I'll post some source code as soon as I have the code integrated with
Cocoon and Cactus.
Greetings,
--
Ovidiu Predescu <[EMAIL PROTECTED]>
http://orion.rgv.hp.com/ (inside HP's firewall only)
http://sourceforge.net/users/ovidiu/ (my SourceForge page)
http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
This message was posted using eunum
To interact with a real-time, threaded interface to this e-mail list, clickthe link below:
[EMAIL PROTECTED]