Update of /cvsroot/securityfilter/securityfilter/src/test/org/securityfilter/test/http/form
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6017/src/test/org/securityfilter/test/http/form
Modified Files:
NoSessionForUnsecuredTest.java
Log Message:
bug#1056920: added another unit test to ensure that directly requesting the login form page does not create a session
Index: NoSessionForUnsecuredTest.java
===================================================================
RCS file: /cvsroot/securityfilter/securityfilter/src/test/org/securityfilter/test/http/form/NoSessionForUnsecuredTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NoSessionForUnsecuredTest.java 14 Feb 2006 09:28:28 -0000 1.1
--- NoSessionForUnsecuredTest.java 15 Feb 2006 08:34:14 -0000 1.2
***************
*** 94,96 ****
--- 94,110 ----
assertEquals("Number of cookies should be 0.", 0, cookieNames.length);
}
+
+ /**
+ * Test for session cookie on index page. There should be no session cookie.
+ *
+ * @throws Exception
+ */
+ public void testNoSessionForLoginPage() throws Exception {
+
+ WebRequest request = new GetMethodWebRequest(baseUrl + "/loginForm.jsp");
+ WebResponse response = session.getResponse(request);
+
+ String[] cookieNames = response.getNewCookieNames();
+ assertEquals("Number of cookies should be 0.", 0, cookieNames.length);
+ }
}
|