users@jersey.java.net

Re: [Jersey] Unit testing resources

From: Martin Probst <mail_at_martin-probst.com>
Date: Mon, 23 Jun 2008 11:47:06 +0200

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), 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?

Regards,
Martin