Running
Tomcat
Set the following system properties
- -Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=true
- -Dorg.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR=false
- -Duser.language=en
- -Duser.country=US
Make the following changes to context.xml
<Context crossContext="true" resourceOnlyServlets="jsp">
<CookieProcessor className="org.apache.tomcat.util.http.LegacyCookieProcessor" />
...
</Context>
Make the following changes to tomcat-users.xml
<user username="CN=CTS, OU=Java Software, O=Sun Microsystems Inc., L=Burlington, ST=MA, C=US" roles="Administrator"/>
<user username="j2ee" password="j2ee" roles="Administrator,Employee" />
<user username="javajoe" password="javajoe" roles="VP,Manager" />
Enable h2c on port 8080, and add some trailer headers
<Connector ... allowedTrailerHeaders="myTrailer, myTrailer2">
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
</Connector>
Enable TLS on port 8443
Client certificate
- TBD
Test Suite
Download latest nightly build
https://download.eclipse.org/ee4j/jakartaee-tck/8.0.1/nightly/servlettck-4.0_latest.zip
Extract to SERVLET_TCK_HOME
Edit $SERVLET_TCK_HOME/bin/ts.jte
You'll need to set the following properties (adjust the paths and values for your environment)
servlet.classes=/home/mark/repos/asf-public/tomcat/trunk/output/build/lib/servlet-api.jar:/home/mark/repos/asf-public/tomcat/trunk/output/build/lib/annotations-api.jar
webServerHost=localhost
webServerPort=8080
securedWebServicePort=8443
command.testExecute += -Djava.endorsed.dirs=${ts.home}/endorsedlib
set JAVA_HOME
cd $SERVLET_TCK_HOME/bin
ant gui
Accept the defaults and then run the tests
Expected results
A default 9.0.x build with the above configuration triggers 16 test failures
2 Expected failures
- 1 x signature test as Tomcat has added a missing \@Deprecated annotation
- 1 x default context path test as Tomcat configuration always overrides this
1 + TBD TCK bugs
- 1 x case sensitive HTTP header checks
- TBD * com/sun/ts/tests/servlet/spec/security/denyUncovered/* use URLs which don't match the WAR name (it needs to be renamed from servlet_sec_denyUncovered_web.war to servlet_sec_denyUncovered.war (there is a proprietary descriptor to rectify the mapping on deployment, but it is not portable)
13 TBD
Note the configuration above also works around 3 additional TCK bugs
- 2 x cookie tests assume server is running in en_US locale (fixed by setenv.sh changes that start Tomcat in that locale)
- 1 x missing endorsedLib configuration (fixed by command.testExecute change above)
1 Tomcat bug has also been fixed as a result of running the TCK
- 1 x Enable a PushBuilder to manipluate cookies via HTTP headers