On Jun 23, 2008, at 11:47 AM, Martin Probst wrote:
> Hi Paul,
>
> thanks for your help.
>
> I just realized i answered your question incorrectly. You can use a
> different container, for example Grizzly, at the end of the email
> shows a standalone example.
>
> I'm actually trying to implement real unit tests (as opposed to
> functional tests)
IMHO i don't really see much difference between the two from the
perspective of the resource class. Jersey runs such unit tests
without any issue.
> , so I'm trying to run tests without any container running at all.
> My code looks like this:
>
> class FooTest {
> @Test
> public void test1() {
> // how to get an injected FooResource?
> FooResource fr = new FooResource();
> ...
> }
> }
>
> Is this possible with Jersey?
>
No, because the resource classes are required to be deployed,
instantiated and managed in a container to behave correctly.
Paul.