axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Peterson (JIRA)" <>
Subject [jira] Commented: (AXIS2-1474) Create ServiceClient interface to allow mocking in unit tests
Date Tue, 24 Oct 2006 15:55:17 GMT
    [ ] 
Jeff Peterson commented on AXIS2-1474:

Using OperationClient is definitely a viable option.  I've looked into it and it appears to
do everything I need, as well as provide additional "nice to have" functionality.  My concern,
however, is that I will likely have to reproduce some of the code already present in the ServiceClient
class.  For example, createClient(), getSOAPFactory(), and fillSOAPEnvelope() all seem to
be candidates for more general purpose utility methods.  While this isn't a problem, per se,
it is an unfortunate side effect.

I can understand why changing the ServiceClient class is probably not the best idea.  It would
break a lot of code that people wrote against Axis2 1.0.  I guess I was hoping that there
was some way to keep the main ServiceClient object the same (read: backward compatible), while
tacking on an additional interface to abstract its methods.  Old clients wouldn't have to
change and new ones could use the new interface.  For example,

public class ServiceClient implements Axis2Client {

> Create ServiceClient interface to allow mocking in unit tests
> -------------------------------------------------------------
>                 Key: AXIS2-1474
>                 URL:
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: client-api
>            Reporter: Jeff Peterson
>            Priority: Minor
> Frequently when I write unit tests I find myself wanting to mock the ServiceClient object.
 I usually have to resort to writing a generic wrapper around service client to achieve this
functionality.  It would be much easier if the ServiceClient class was restructured into a
ServiceClient interface and ServiceClientImpl class, or something similar.  I think this would
greatly improve the unit testability of client-side code which uses the Axis2 API's.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message