cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: CXF Web client test with mock URL
Date Wed, 31 Jul 2013 09:16:47 GMT
Hi
On 31/07/13 04:20, Dev1 wrote:
> I am new to CXF.
> I am using CXF 2.7.3 for web service creation.
>
> I have XSLTJaxbProvider that reads a URL and pass URL path and query params
> to XSLT stylesheet that transformation into xml. I want to test this using
> web client that uses XSLTJaxbProvider. But I need to use a Mock URL in my
> test and get the resultant xml that the xslt produces.
>
> How to accomplish it? I did not find any such example in cxf web site.
>
Sure, use CXF LocalTransport, see
https://cwiki.apache.org/confluence/display/CXF20DOC/JAXRS+Testing

Your client and server code remains exactly as it is now, only the 
address is changed, has to start from a "local://" scheme.
(The code on the page shows that the server endpoint needs a Local 
transport id set as well but I've just double-checked - not actually 
needed).

Note that at the moment for GET requests to work 
LocalConduit.DIRECT_DISPATCH property has to be set as shown on the 
page, we're looking into making that property enabled by default.

HTH, Sergey

> Any help is appreciated.
>
> Thanks in advance.
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXF-Web-client-test-with-mock-URL-tp5731684.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Mime
View raw message