users@jersey.java.net

Jersey Test Framework

From: Yogesh kumar <mtyogesh_at_gmail.com>
Date: Sat, 12 Sep 2009 14:20:06 +0530

I am using "GrizzlyWebTestContainerFactory
(jersey-test-framework-1.1.2-ea.jar)" to write testcases for my jersey
service which uses *session* variable.

*I am not sure how to make available session objects through test framework?
*

Tried to set session objects using filterClass (WebAppDescriptor.Builder)
but it shows me null pointer exception while starting container. I gone
through the src code and found this chunk causing error:

     try {
                servletInstance = (Servlet) servletClass.newInstance();
            } catch (InstantiationException ex) {
                throw new TestContainerException(ex);
            } catch (IllegalAccessException ex) {
It always excepting servletClass and when I setting filter class this code
snippet sets *this.servletClass = null* and *one more thing test framework
not using filter class anywhere*.

  try {
                servletInstance = (Servlet) servletClass.newInstance();
            } catch (InstantiationException ex) {
                throw new TestContainerException(ex);
            } catch (IllegalAccessException ex) {public Builder
filterClass(Class<? extends Filter> filterClass)
                throws IllegalArgumentException {
            if (filterClass == null)
                throw new IllegalArgumentException("The filter class must
not be null");
            this.filterClass = filterClass;
            this.servletClass = null;
            return this;
        }

Thanks,
 Yogesh