You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Vincenzo Vitale <vi...@gmail.com> on 2007/09/14 16:00:26 UTC

Automatic Testing CXF Web Services out of the box

Hi,

I would like to automatic testing my web services out of the box, that is
integrated in an application server I can start in a JUnit test case.

My idea is using Jetty to launch the application I'm writing and then call
the webservice with a dynamic client configured with Spring (extending
AbstractDependencyInjectionSpringContextTests). BTW I don't like this
approach (launching a web server cannot be permitted in some environment and
also the port must not be used), moreover I also need to think how to create
a mock data provider.

There is a better way to do it?


Thanks,
Vicio.

Re: Automatic Testing CXF Web Services out of the box

Posted by Willem2 <ni...@iona.com>.
Hi,

You could use the LocalTransport instead of HTTP transport which you could
just focus on the business logical things.
You can take a look at the Unit test of jaxws [1], and also there are some
spring example [2]
[1]
https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws
[2] 
https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring

Willem.



Vincenzo Vitale wrote:
> 
> Hi,
> 
> I would like to automatic testing my web services out of the box, that is
> integrated in an application server I can start in a JUnit test case.
> 
> My idea is using Jetty to launch the application I'm writing and then call
> the webservice with a dynamic client configured with Spring (extending
> AbstractDependencyInjectionSpringContextTests). BTW I don't like this
> approach (launching a web server cannot be permitted in some environment
> and
> also the port must not be used), moreover I also need to think how to
> create
> a mock data provider.
> 
> There is a better way to do it?
> 
> 
> Thanks,
> Vicio.
> 
> 

-- 
View this message in context: http://www.nabble.com/Automatic-Testing-CXF-Web-Services-out-of-the-box-tf4442775.html#a12686388
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Automatic Testing CXF Web Services out of the box

Posted by Vincenzo Vitale <vi...@gmail.com>.
For the service API I have written Junit unit testing using EasyMock.

I would like to test the webservice deployed and running to check it works
as expected without problems. (Runtime exceptions for example).

On 9/14/07, Dale Peakall <d....@oclcpica.org> wrote:
>
> It depends what you're trying to test: the network interface, or the
> service API.  There's no need to create (or use) the network interface
> if what you actually want to test is the service API.
>
> Vincenzo Vitale wrote:
> > Hi,
> >
> > I would like to automatic testing my web services out of the box, that
> is
> > integrated in an application server I can start in a JUnit test case.
> >
> > My idea is using Jetty to launch the application I'm writing and then
> call
> > the webservice with a dynamic client configured with Spring (extending
> > AbstractDependencyInjectionSpringContextTests). BTW I don't like this
> > approach (launching a web server cannot be permitted in some environment
> and
> > also the port must not be used), moreover I also need to think how to
> create
> > a mock data provider.
> >
> > There is a better way to do it?
> >
> >
> > Thanks,
> > Vicio.
> >
> >
>
>

Re: Automatic Testing CXF Web Services out of the box

Posted by Dale Peakall <d....@oclcpica.org>.
It depends what you're trying to test: the network interface, or the 
service API.  There's no need to create (or use) the network interface 
if what you actually want to test is the service API.

Vincenzo Vitale wrote:
> Hi,
>
> I would like to automatic testing my web services out of the box, that is
> integrated in an application server I can start in a JUnit test case.
>
> My idea is using Jetty to launch the application I'm writing and then call
> the webservice with a dynamic client configured with Spring (extending
> AbstractDependencyInjectionSpringContextTests). BTW I don't like this
> approach (launching a web server cannot be permitted in some environment and
> also the port must not be used), moreover I also need to think how to create
> a mock data provider.
>
> There is a better way to do it?
>
>
> Thanks,
> Vicio.
>
>