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]