You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/11/18 19:36:29 UTC
[tomcat] branch main updated: Expand tests
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new e44bce9 Expand tests
e44bce9 is described below
commit e44bce996489db31d710d189ba51ef0649379df3
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Nov 18 19:36:18 2021 +0000
Expand tests
---
test/jakarta/servlet/http/TestCookie.java | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/test/jakarta/servlet/http/TestCookie.java b/test/jakarta/servlet/http/TestCookie.java
index 7885de5..fa1d6da 100644
--- a/test/jakarta/servlet/http/TestCookie.java
+++ b/test/jakarta/servlet/http/TestCookie.java
@@ -180,6 +180,29 @@ public class TestCookie {
cookie.setAttribute("Max-Age", "bbb");
}
+ @Test
+ public void testClone() {
+ Cookie a = new Cookie("a","a");
+ a.setComment("comment");
+ a.setDomain("domain");
+ a.setHttpOnly(true);
+ a.setMaxAge(123);
+ a.setPath("/path");
+ a.setSecure(true);
+
+ Cookie b = (Cookie) a.clone();
+
+ Assert.assertEquals("a", b.getName());
+ Assert.assertEquals("a", b.getValue());
+ Assert.assertEquals("comment", b.getComment());
+ Assert.assertEquals("domain", b.getDomain());
+ Assert.assertTrue(b.isHttpOnly());
+ Assert.assertEquals(123, b.getMaxAge());
+ Assert.assertEquals("/path", b.getPath());
+ Assert.assertTrue(b.getSecure());
+ }
+
+
public static void checkCharInName(CookieNameValidator validator, BitSet allowed) {
for (char ch = 0; ch < allowed.size(); ch++) {
boolean expected = allowed.get(ch);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org