tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r831780 - /tomcat/trunk/test/org/apache/tomcat/util/http/
Date Sun, 01 Nov 2009 23:05:27 GMT
Author: markt
Date: Sun Nov  1 23:05:26 2009
New Revision: 831780

URL: http://svn.apache.org/viewvc?rev=831780&view=rev
Log:
Add unit tests for blank/null cookie names

Modified:
    tomcat/trunk/test/org/apache/tomcat/util/http/CookiesBaseTest.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDefaultSysProps.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoFwdStrictSysProps.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoStrictNamingSysProps.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesStrictSysProps.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesSwitchSysProps.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/CookiesBaseTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/CookiesBaseTest.java?rev=831780&r1=831779&r2=831780&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/CookiesBaseTest.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/CookiesBaseTest.java Sun Nov  1 23:05:26
2009
@@ -72,6 +72,10 @@
 
         Tomcat.addServlet(ctx, "invalid", new CookieServlet("na;me", "value"));
         ctx.addServletMapping("/invalid", "invalid");
+        Tomcat.addServlet(ctx, "null", new CookieServlet(null, "value"));
+        ctx.addServletMapping("/null", "null");
+        Tomcat.addServlet(ctx, "blank", new CookieServlet("", "value"));
+        ctx.addServletMapping("/blank", "blank");
         Tomcat.addServlet(ctx, "invalidFwd",
                 new CookieServlet("na/me", "value"));
         ctx.addServletMapping("/invalidFwd", "invalidFwd");

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDefaultSysProps.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDefaultSysProps.java?rev=831780&r1=831779&r2=831780&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDefaultSysProps.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDefaultSysProps.java Sun Nov
 1 23:05:26 2009
@@ -43,6 +43,10 @@
         
         ByteChunk res = getUrl("http://localhost:" + getPort() + "/invalid");
         assertEquals("Cookie name fail", res.toString());
+        res = getUrl("http://localhost:" + getPort() + "/null");
+        assertEquals("Cookie name fail", res.toString());
+        res = getUrl("http://localhost:" + getPort() + "/blank");
+        assertEquals("Cookie name fail", res.toString());
         res = getUrl("http://localhost:" + getPort() + "/invalidFwd");
         assertEquals("Cookie name ok", res.toString());
         res = getUrl("http://localhost:" + getPort() + "/invalidStrict");

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoFwdStrictSysProps.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoFwdStrictSysProps.java?rev=831780&r1=831779&r2=831780&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoFwdStrictSysProps.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoFwdStrictSysProps.java Sun
Nov  1 23:05:26 2009
@@ -43,6 +43,10 @@
         
         ByteChunk res = getUrl("http://localhost:" + getPort() + "/invalid");
         assertEquals("Cookie name fail", res.toString());
+        res = getUrl("http://localhost:" + getPort() + "/null");
+        assertEquals("Cookie name fail", res.toString());
+        res = getUrl("http://localhost:" + getPort() + "/blank");
+        assertEquals("Cookie name fail", res.toString());
         res = getUrl("http://localhost:" + getPort() + "/invalidFwd");
         assertEquals("Cookie name ok", res.toString());
         res = getUrl("http://localhost:" + getPort() + "/invalidStrict");

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoStrictNamingSysProps.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoStrictNamingSysProps.java?rev=831780&r1=831779&r2=831780&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoStrictNamingSysProps.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoStrictNamingSysProps.java Sun
Nov  1 23:05:26 2009
@@ -44,6 +44,10 @@
         
         ByteChunk res = getUrl("http://localhost:" + getPort() + "/invalid");
         assertEquals("Cookie name fail", res.toString());
+        res = getUrl("http://localhost:" + getPort() + "/null");
+        assertEquals("Cookie name fail", res.toString());
+        res = getUrl("http://localhost:" + getPort() + "/blank");
+        assertEquals("Cookie name fail", res.toString());
         res = getUrl("http://localhost:" + getPort() + "/invalidFwd");
         assertEquals("Cookie name ok", res.toString());
         res = getUrl("http://localhost:" + getPort() + "/invalidStrict");

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesStrictSysProps.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesStrictSysProps.java?rev=831780&r1=831779&r2=831780&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesStrictSysProps.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesStrictSysProps.java Sun Nov 
1 23:05:26 2009
@@ -46,6 +46,10 @@
         
         ByteChunk res = getUrl("http://localhost:" + getPort() + "/invalid");
         assertEquals("Cookie name fail", res.toString());
+        res = getUrl("http://localhost:" + getPort() + "/null");
+        assertEquals("Cookie name fail", res.toString());
+        res = getUrl("http://localhost:" + getPort() + "/blank");
+        assertEquals("Cookie name fail", res.toString());
         res = getUrl("http://localhost:" + getPort() + "/invalidFwd");
         assertEquals("Cookie name fail", res.toString());
         res = getUrl("http://localhost:" + getPort() + "/invalidStrict");

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesSwitchSysProps.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesSwitchSysProps.java?rev=831780&r1=831779&r2=831780&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesSwitchSysProps.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesSwitchSysProps.java Sun Nov 
1 23:05:26 2009
@@ -49,6 +49,10 @@
         
         ByteChunk res = getUrl("http://localhost:" + getPort() + "/invalid");
         assertEquals("Cookie name fail", res.toString());
+        res = getUrl("http://localhost:" + getPort() + "/null");
+        assertEquals("Cookie name fail", res.toString());
+        res = getUrl("http://localhost:" + getPort() + "/blank");
+        assertEquals("Cookie name fail", res.toString());
         res = getUrl("http://localhost:" + getPort() + "/invalidFwd");
         assertEquals("Cookie name fail", res.toString());
         res = getUrl("http://localhost:" + getPort() + "/invalidStrict");



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message