users@jersey.java.net

[Jersey] Re: JAXB to JSON in a Junit

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Mon, 27 Jun 2011 20:44:18 +0200

Hello Alejandro,

just checking.. do you know about Jersey Test Framework?

see jsonp sample (not exactly what you need, but almost..) [1]. see
./src/test/* and [2] for info about test framework

Regards,
Pavel

[1]
http://download.java.net/maven/2/com/sun/jersey/samples/jsonp/1.8/jsonp-1.8-project.zip
[2]
http://jersey.java.net/nonav/documentation/latest/test-framework.html#d4e1273

On 6/27/11 5:07 PM, Alejandro Calbazana wrote:
> Hi,
>
> Simple question...
>
> I'd like to verify serialization of JAXB annotated classes to JSON in
> a unit test as part of my service's test suite. Is this possible? It
> looks like Jersey facilitates the processing of JAXB to JSON, but I
> am not sure how to replicate this path in a junit to ensure that the
> serialization that Jersey will apply will be what I expect.
>
> Any help on this is appreciated.
>
> Thanks,
>
> Alejandro
>
>