users@jersey.java.net

Re: [Jersey] Creating UriInfo in tests

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 12 Nov 2008 15:11:43 +0100

On Nov 12, 2008, at 11:46 AM, tarjei wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> hi, is it possible to create UriBuilder in tests or do I have to use
> EasyMock?
>

It is possible to create a UrBuilder by doing:

    UriBuilder.fromUri(...)

or using other static methods.

But i suspect you mean UriInfo as in the title.

The only way to create a Jersey-based instance is to deploy the tests
using an embedded server. Quite a lot of the functional tests use an
in-memory-based server, but still that is not the same as
instantiating the resource classes yourself. So it is necessary to use
something like EasyMock. If you have any ideas about how Jersey can
make it easier in this respect let me know.

Paul.


> Regards,
> Tarjei
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFJGrPtYVRKCnSvzfIRAk8WAJ9GqB+ZpFF2/qDThtzFfiWwFkVBGgCeOYsR
> Di7/3RhZvpkDWSgbcVYr4I8=
> =dmQs
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>