I'm having two difficulties with testing.  One practical, one theoretical.

practical:
If I have any @Context annotations, I can't actually call the service
via a client proxy.  I need to code the call separately (and
manually.)

theoretical:
Using the same JSON compile unit on the service and the test seems to
defeat the purpose.  If I have a webpage hitting my JAX-RS server, and
I change the name of a field, I'd like to have my test point that out,
so that when I fix my test, I can let my web team know.  But if I use
the same compile unit, whatever I change, even accidentally, will
marshall and unmarshall correctly, the actual user of the API may then
run into issues.

Jeff

On Thu, Feb 2, 2012 at 1:49 PM, Glen Mazza <[email protected]> wrote:
> I recently converted the Jersey "helloworld" sample to using CXF, its JUnit
> test case structure might be something you can leverage:
>
> https://github.com/gmazza/jersey-samples-on-cxf/tree/master/helloworld/src/test/java/com/sun/jersey/samples/helloworld
>
> HTH,
> Glen
>
>
> On 02/01/2012 02:41 PM, cganesan wrote:
>>
>> Hi
>>
>> Is there a way to invoke the URLs for a JAX-RS end point services as part
>> of
>> JUnit test - triggered from MAven build? Does Apache CXF support something
>> like an embedded container towards this?
>>
>> Thanks
>> Chandru
>>
>> --
>> View this message in context:
>> http://cxf.547215.n5.nabble.com/Unit-testing-JAX-RS-services-tp5448539p5448539.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>
>
>
> --
> Glen Mazza
> Talend Community Coders - coders.talend.com
> blog: www.jroller.com/gmazza
>

Reply via email to