jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pedro Nevado" <pnev...@javato.com>
Subject RE: FilterRedirector does not initialize sessions. - IS THIS A BUG ??
Date Wed, 10 Nov 2004 19:33:52 GMT
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:suguri.kazuhito@lab.ntt.co.jp]
Enviado el: miercoles, 10 de noviembre de 2004 13:40
Para: cactus-user@jakarta.apache.org
Asunto: Re: FilterRedirector does not initialize sessions. - IS THIS A
BUG ??


Hi,

In article <200411100929.iAA9TjPn012009@tama5.ecl.ntt.co.jp>,
Wed, 10 Nov 2004 10:24:49 +0100,
"Vincent Massol" <vmassol@pivolis.com> 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:suguri.kazuhito@lab.ntt.co.jp

---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-user-help@jakarta.apache.org




Mime
View raw message