You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Steve Loughran <st...@iseran.com> on 2003/07/22 20:35:25 UTC

Re: testing optional components (was RE: cvs commit: xml-axis/java/sr c/org/apache/axis/transport/http CommonsHTTPSender.java)

Eric.D.Friedman@wellsfargo.com wrote:
> Thanks Tom.
> 
> Apropos of this changeset, does anyone have any advice on how best to
> provide tests/samples for the CommonsHTTPSender integration?  I hacked up a
> copy of samples.client.DynamicInvoker last night to make it invoke the same
> service in multiple threads, cranked up the logging on httpclient, and ran
> some tests with different settings defined via system properties.  It all
> worked fine -- I was able to see logging messages about connections being
> recycled when the number of threads was greater than the number of
> connections allowed; similarly, I was able to see logging messages about new
> connections being created when the number of threads was less than the
> number of connections allowed.
> 
> But, this really should be an automated test, not a sample.  The problem is
> (1) the tests can't assume that httpclient is present, since it's an
> optional component; (2) junit doesn't support assertions on logging
> messages, and so there isn't a good way to verify that the pool is being
> exploited from within axis.  Obviously the tests shouldn't be trying to
> cover httpclient itself (that would be an integration test, not a unit
> test), but it does seem that it would be useful for the test suite to
> include some kind of coverage for the integrity of this integration.

Ant's unit test framework runs ant from inside junit, and captures all 
output...you can then make assertions about output text. Maybe you could 
do something similar