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 2024/12/12 12:39:23 UTC

(tomcat) branch 10.1.x updated: Expand tests to cover If-None-Match

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new 3b3dc51380 Expand tests to cover If-None-Match
3b3dc51380 is described below

commit 3b3dc51380c898c69faf4e5e812e192d0820ed10
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Dec 12 12:39:07 2024 +0000

    Expand tests to cover If-None-Match
---
 ...efaultServletRfc9110Section13Parameterized.java | 24 ++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13Parameterized.java b/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13Parameterized.java
index eb14b5029c..9c9e99852e 100644
--- a/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13Parameterized.java
+++ b/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13Parameterized.java
@@ -97,8 +97,8 @@ public class TestDefaultServletRfc9110Section13Parameterized extends TomcatBaseT
                         Boolean.FALSE, SC_200 });
                 parameterSets.add(new Object[] { useStrongEtag, task, null, DatePrecondition.MULTI_IN, null, null, null,
                         Boolean.FALSE, SC_200 });
-                parameterSets.add(new Object[] { useStrongEtag, task, null, DatePrecondition.MULTI_IN_REV, null, null, null,
-                        Boolean.FALSE, SC_200 });
+                parameterSets.add(new Object[] { useStrongEtag, task, null, DatePrecondition.MULTI_IN_REV, null, null,
+                        null, Boolean.FALSE, SC_200 });
                 parameterSets.add(new Object[] { useStrongEtag, task, null, DatePrecondition.INVALID, null, null, null,
                         Boolean.FALSE, SC_200 });
 
@@ -113,6 +113,22 @@ public class TestDefaultServletRfc9110Section13Parameterized extends TomcatBaseT
                 parameterSets.add(new Object[] { useStrongEtag, task, null, DatePrecondition.LT, null,
                         DatePrecondition.GT, null, Boolean.FALSE, SC_412 });
 
+                // RFC 9110, Section 13.2.2, Step 3, HEAD: If-None-Match with and without If-Modified-Since
+                for (DatePrecondition dateCondition : DatePrecondition.values()) {
+                    parameterSets.add(new Object[] { useStrongEtag, task, null, null, EtagPrecondition.ALL,
+                            dateCondition, null, Boolean.FALSE, SC_304 });
+                    parameterSets.add(new Object[] { useStrongEtag, task, null, null, EtagPrecondition.EXACTLY,
+                            dateCondition, null, Boolean.FALSE, SC_304 });
+                    parameterSets.add(new Object[] { useStrongEtag, task, null, null, EtagPrecondition.IN,
+                            dateCondition, null, Boolean.FALSE, SC_304 });
+                    parameterSets.add(new Object[] { useStrongEtag, task, null, null, EtagPrecondition.NOT_IN,
+                            dateCondition, null, Boolean.FALSE, SC_200 });
+                    parameterSets.add(new Object[] { useStrongEtag, task, null, null, EtagPrecondition.INVALID,
+                            dateCondition, null, Boolean.FALSE, SC_400 });
+                    parameterSets.add(new Object[] { useStrongEtag, task, null, null,
+                            EtagPrecondition.INVALID_ALL_PLUS_OTHER, dateCondition, null, Boolean.FALSE, SC_400 });
+                }
+
                 // RFC 9110, Section 13.2.2, Step 4, HEAD: If-Unmodified-Since only
                 parameterSets.add(new Object[] { useStrongEtag, task, null, null, null, DatePrecondition.EQ, null,
                         Boolean.FALSE, SC_304 });
@@ -122,8 +138,8 @@ public class TestDefaultServletRfc9110Section13Parameterized extends TomcatBaseT
                         Boolean.FALSE, SC_304 });
                 parameterSets.add(new Object[] { useStrongEtag, task, null, null, null, DatePrecondition.MULTI_IN, null,
                         Boolean.FALSE, SC_200 });
-                parameterSets.add(new Object[] { useStrongEtag, task, null, null, null, DatePrecondition.MULTI_IN_REV, null,
-                        Boolean.FALSE, SC_200 });
+                parameterSets.add(new Object[] { useStrongEtag, task, null, null, null, DatePrecondition.MULTI_IN_REV,
+                        null, Boolean.FALSE, SC_200 });
                 parameterSets.add(new Object[] { useStrongEtag, task, null, null, null, DatePrecondition.INVALID, null,
                         Boolean.FALSE, SC_200 });
             }


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