Yes, that is right. The test you just described fails. I assume also that
the reason for that is what you state in your e-mail. However I think there
is some possibility of misunderstanding: I designed the test because
although I was opening a session  with my request wrapper, there was not
session associated afterwards with my request. Probably, it would be enough
with a few comments in the documentation, which I do not mind at all to
write.

Thanks for the answers.

-----Mensaje original-----
De: Kazuhito SUGURI [mailto:[EMAIL PROTECTED]
Enviado el: miercoles, 10 de noviembre de 2004 13:40
Para: [EMAIL PROTECTED]
Asunto: Re: FilterRedirector does not initialize sessions. - IS THIS A
BUG ??


Hi,

In article <[EMAIL PROTECTED]>,
Wed, 10 Nov 2004 10:24:49 +0100,
"Vincent Massol" <[EMAIL PROTECTED]> wrote:
vmassol> Are you sure your SessionFilter is a real Filter? It looks like
you're not
vmassol> extending the Filter interface. The second problem I can see is
that you're
vmassol> completely bypassing the filter initialization in your init()
method (I
vmassol> think it is safer to call super.init(filterConfig)).
vmassol>
vmassol> Have you registered the filter as a filter in the web.xml file?

I believe, Pedro is expecting that following two tests should be passed:
    public class SessionServletTest extends ServletTestCase {
        ....
        public void beginSession(WebRequest request) {
            request.setAutomaticSession(true);
        }

        public void testSession() {
            assertNotNull("There should be a session", session);
        }
    }

    public class SessionFilterTest extends FilterTestCase {
        ....
        public void beginSession(WebRequest request) {
            request.setAutomaticSession(true);
        }

        public void testSession() {
            HttpSession session = request.getSession(false);
            assertNotNull("There should be a session", session);
        }
    }

Am I misunderstanding, Pedro?

I cannot try it now, but, SessionFilterTest#testSession() may fails.
An HTTP Session is created to fill the session implicit object
of ServletTestCase (and of JspTestCase) prior to testXXX.
However, for FilterTestCase, which doesn't have the session implicit object,
such session creation is not needed and is not implemented, AFAIK.

Regards,
----
Kazuhito SUGURI
mailto:[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to