This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new dd5fdc3c33 Test GET as well as HEAD
dd5fdc3c33 is described below
commit dd5fdc3c33903e36f24ddc0112992eb66c269714
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Dec 12 11:55:22 2024 +0000
Test GET as well as HEAD
---
...efaultServletRfc9110Section13Parameterized.java | 82 +++++++++++-----------
1 file changed, 41 insertions(+), 41 deletions(-)
diff --git
a/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13Parameterized.java
b/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13Parameterized.java
index d54987c1d9..4aa70b5711 100644
---
a/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13Parameterized.java
+++
b/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13Parameterized.java
@@ -21,6 +21,7 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -69,48 +70,47 @@ public class
TestDefaultServletRfc9110Section13Parameterized extends TomcatBaseT
@Parameterized.Parameters(name = "{index} resource-strong [{0}],
matchHeader [{1}]")
public static Collection<Object[]> parameters() {
List<Object[]> parameterSets = new ArrayList<>();
- for (Boolean useStrongEtag : booleans) {
- // RFC 9110, Section 13.2.2, Step 1, HEAD: If-Match with and
without If-Unmodified-Since
- for (DatePrecondition dateCondition : DatePrecondition.values()) {
- parameterSets.add(new Object[] { useStrongEtag,
Task.HEAD_INDEX_HTML, EtagPrecondition.ALL,
- dateCondition, null, null, null, Boolean.FALSE, SC_200
});
- parameterSets.add(
- new Object[] { useStrongEtag, Task.HEAD_INDEX_HTML,
EtagPrecondition.EXACTLY, dateCondition,
- null, null, null, Boolean.FALSE,
useStrongEtag.booleanValue() ? SC_200 : SC_412 });
- parameterSets
- .add(new Object[] { useStrongEtag,
Task.HEAD_INDEX_HTML, EtagPrecondition.IN, dateCondition,
- null, null, null, Boolean.FALSE,
useStrongEtag.booleanValue() ? SC_200 : SC_412 });
- parameterSets.add(new Object[] { useStrongEtag,
Task.HEAD_INDEX_HTML, EtagPrecondition.NOT_IN,
- dateCondition, null, null, null, Boolean.FALSE, SC_412
});
- parameterSets.add(new Object[] { useStrongEtag,
Task.HEAD_INDEX_HTML, EtagPrecondition.INVALID,
- dateCondition, null, null, null, Boolean.FALSE, SC_400
});
- parameterSets.add(
- new Object[] { useStrongEtag, Task.HEAD_INDEX_HTML,
EtagPrecondition.INVALID_ALL_PLUS_OTHER,
- dateCondition, null, null, null,
Boolean.FALSE, SC_400 });
- }
+ for (Task task : Arrays.asList(Task.HEAD_INDEX_HTML,
Task.GET_INDEX_HTML)) {
+ for (Boolean useStrongEtag : booleans) {
+ // RFC 9110, Section 13.2.2, Step 1, HEAD: If-Match with and
without If-Unmodified-Since
+ for (DatePrecondition dateCondition :
DatePrecondition.values()) {
+ parameterSets.add(new Object[] { useStrongEtag, task,
EtagPrecondition.ALL, dateCondition, null,
+ null, null, Boolean.FALSE, SC_200 });
+ parameterSets.add(new Object[] { useStrongEtag, task,
EtagPrecondition.EXACTLY, dateCondition, null,
+ null, null, Boolean.FALSE,
useStrongEtag.booleanValue() ? SC_200 : SC_412 });
+ parameterSets.add(new Object[] { useStrongEtag, task,
EtagPrecondition.IN, dateCondition, null,
+ null, null, Boolean.FALSE,
useStrongEtag.booleanValue() ? SC_200 : SC_412 });
+ parameterSets.add(new Object[] { useStrongEtag, task,
EtagPrecondition.NOT_IN, dateCondition, null,
+ null, null, Boolean.FALSE, SC_412 });
+ parameterSets.add(new Object[] { useStrongEtag, task,
EtagPrecondition.INVALID, dateCondition, null,
+ null, null, Boolean.FALSE, SC_400 });
+ parameterSets.add(new Object[] { useStrongEtag, task,
EtagPrecondition.INVALID_ALL_PLUS_OTHER,
+ dateCondition, null, null, null, Boolean.FALSE,
SC_400 });
+ }
- // RFC 9110, Section 13.2.2, Step 2, HEAD: If-Unmodified-Since only
- parameterSets.add(new Object[] { useStrongEtag,
Task.HEAD_INDEX_HTML, null, DatePrecondition.EQ, null, null,
- null, Boolean.FALSE, SC_200 });
- parameterSets.add(new Object[] { useStrongEtag,
Task.HEAD_INDEX_HTML, null, DatePrecondition.LT, null, null,
- null, Boolean.FALSE, SC_412 });
- parameterSets.add(new Object[] { useStrongEtag,
Task.HEAD_INDEX_HTML, null, DatePrecondition.GT, null, null,
- null, Boolean.FALSE, SC_200 });
- parameterSets.add(new Object[] { useStrongEtag,
Task.HEAD_INDEX_HTML, null, DatePrecondition.MULTI_IN, null,
- null, null, Boolean.FALSE, SC_200 });
- parameterSets.add(new Object[] { useStrongEtag,
Task.HEAD_INDEX_HTML, null, DatePrecondition.INVALID, null,
- null, null, Boolean.FALSE, SC_200 });
-
- // Ensure If-Unmodified-Since takes precedence over
If-Modified-Since
- // If-Unmodified-Since only
- parameterSets.add(new Object[] { useStrongEtag,
Task.HEAD_INDEX_HTML, null, DatePrecondition.LT, null, null,
- null, Boolean.FALSE, SC_412 });
- // If-Modified-Since only
- parameterSets.add(new Object[] { useStrongEtag,
Task.HEAD_INDEX_HTML, null, null, null, DatePrecondition.GT,
- null, Boolean.FALSE, SC_304 });
- // Both
- parameterSets.add(new Object[] { useStrongEtag,
Task.HEAD_INDEX_HTML, null, DatePrecondition.LT, null,
- DatePrecondition.GT, null, Boolean.FALSE, SC_412 });
+ // RFC 9110, Section 13.2.2, Step 2, HEAD: If-Unmodified-Since
only
+ parameterSets.add(new Object[] { useStrongEtag, task, null,
DatePrecondition.EQ, null, null, null,
+ Boolean.FALSE, SC_200 });
+ parameterSets.add(new Object[] { useStrongEtag, task, null,
DatePrecondition.LT, null, null, null,
+ Boolean.FALSE, SC_412 });
+ parameterSets.add(new Object[] { useStrongEtag, task, null,
DatePrecondition.GT, null, null, null,
+ 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.INVALID, null, null, null,
+ Boolean.FALSE, SC_200 });
+
+ // Ensure If-Unmodified-Since takes precedence over
If-Modified-Since
+ // If-Unmodified-Since only
+ parameterSets.add(new Object[] { useStrongEtag, task, null,
DatePrecondition.LT, null, null, null,
+ Boolean.FALSE, SC_412 });
+ // If-Modified-Since only
+ parameterSets.add(new Object[] { useStrongEtag, task, null,
null, null, DatePrecondition.GT, null,
+ Boolean.FALSE, SC_304 });
+ // Both
+ parameterSets.add(new Object[] { useStrongEtag, task, null,
DatePrecondition.LT, null,
+ DatePrecondition.GT, null, Boolean.FALSE, SC_412 });
+ }
}
return parameterSets;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]