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-tck.git
The following commit(s) were added to refs/heads/main by this push:
new b298ae7 Few more configuration settings required for the TCK
b298ae7 is described below
commit b298ae74fad83f34ccf63eda39e1033be29bbdb6
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Mar 18 18:06:07 2024 +0000
Few more configuration settings required for the TCK
---
.../tomcat/tck/servlet/TomcatServletTckConfiguration.java | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git
a/servlet-tck/src/test/java/org/apache/tomcat/tck/servlet/TomcatServletTckConfiguration.java
b/servlet-tck/src/test/java/org/apache/tomcat/tck/servlet/TomcatServletTckConfiguration.java
index afd9bfb..27be6bf 100644
---
a/servlet-tck/src/test/java/org/apache/tomcat/tck/servlet/TomcatServletTckConfiguration.java
+++
b/servlet-tck/src/test/java/org/apache/tomcat/tck/servlet/TomcatServletTckConfiguration.java
@@ -17,9 +17,9 @@
package org.apache.tomcat.tck.servlet;
import java.lang.reflect.Field;
+import java.util.Locale;
import org.apache.catalina.Container;
-import org.apache.catalina.Context;
import org.apache.catalina.connector.Connector;
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.startup.Tomcat;
@@ -83,12 +83,21 @@ public class TomcatServletTckConfiguration implements
LoadableExtension {
Container contexts[] = tomcat.getHost().findChildren();
for (Container context : contexts) {
- // Configure expected encoding mapping
+ // Configure expected encoding mapping unless
application has defined one explicitly
StandardContext stdContext = (StandardContext) context;
- stdContext.addLocaleEncodingMappingParameter("ja",
"Shift_JIS");
+ if
(stdContext.getCharsetMapper().getCharset(Locale.forLanguageTag("ja")) == null)
{
+
stdContext.addLocaleEncodingMappingParameter("ja", "Shift_JIS");
+ }
// Enable cross-context dispatches
stdContext.setCrossContext(true);
+
+ // Subset of STRICT_SERVLET_COMPLIANCE required by TCK
+ stdContext.setAlwaysAccessSession(true);
+ stdContext.setContextGetResourceRequiresSlash(true);
+ stdContext.setUseRelativeRedirects(false);
+ stdContext.getManager().setSessionActivityCheck(true);
+
stdContext.getManager().setSessionLastAccessAtStart(true);
}
} catch (ReflectiveOperationException e) {
throw new RuntimeException(e);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]