Adding ee11 Cross Context Dispatch Testing

This commit is contained in:
Joakim Erdfelt 2024-06-19 17:39:43 -05:00
parent e05e3323a6
commit 7a32a8ceb0
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
15 changed files with 564 additions and 1 deletions

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.jetty.tests.ccd</groupId>
<artifactId>test-cross-context-dispatch</artifactId>
<version>12.1.0-SNAPSHOT</version>
</parent>
<artifactId>ccd-ee11-webapp</artifactId>
<packaging>war</packaging>
<name>Tests :: Cross Context Dispatch :: ee11 WebApp</name>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty.ee11</groupId>
<artifactId>jetty-ee11-bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.tests.ccd</groupId>
<artifactId>ccd-common</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,108 @@
//
// ========================================================================
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
// ========================================================================
//
package org.eclipse.jetty.tests.ccd.ee11;
import java.io.IOException;
import java.util.Objects;
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import org.eclipse.jetty.tests.ccd.common.DispatchPlan;
import org.eclipse.jetty.tests.ccd.common.Property;
import org.eclipse.jetty.tests.ccd.common.Step;
public class CCDServlet extends HttpServlet
{
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
DispatchPlan dispatchPlan = (DispatchPlan)req.getAttribute(DispatchPlan.class.getName());
if (dispatchPlan == null)
throw new ServletException("Unable to find DispatchPlan");
dispatchPlan.addEvent("%s.service() dispatcherType=%s method=%s requestUri=%s",
this.getClass().getName(),
req.getDispatcherType(), req.getMethod(), req.getRequestURI());
Step step;
while ((step = dispatchPlan.popStep()) != null)
{
if (step instanceof Step.ContextRedispatch contextRedispatchStep)
{
ServletContext otherContext = getServletContext().getContext(contextRedispatchStep.getContextPath());
if (otherContext == null)
throw new NullPointerException("ServletContext.getContext(\"" + contextRedispatchStep.getContextPath() + "\") returned null");
RequestDispatcher dispatcher = otherContext.getRequestDispatcher(contextRedispatchStep.getDispatchPath());
if (dispatcher == null)
throw new NullPointerException("ServletContext.getRequestDispatcher(\"" + contextRedispatchStep.getDispatchPath() + "\") returned null");
switch (contextRedispatchStep.getDispatchType())
{
case FORWARD -> dispatcher.forward(req, resp);
case INCLUDE -> dispatcher.include(req, resp);
}
return;
}
else if (step instanceof Step.RequestDispatch requestDispatchStep)
{
RequestDispatcher dispatcher = req.getRequestDispatcher(requestDispatchStep.getDispatchPath());
if (dispatcher == null)
throw new NullPointerException("HttpServletRequest.getRequestDispatcher(\"" + requestDispatchStep.getDispatchPath() + "\") returned null");
switch (requestDispatchStep.getDispatchType())
{
case FORWARD -> dispatcher.forward(req, resp);
case INCLUDE -> dispatcher.include(req, resp);
}
return;
}
else if (step instanceof Step.GetHttpSession getHttpSessionTask)
{
HttpSession session = req.getSession(false);
if (session == null)
{
dispatchPlan.addEvent("%s.service() HttpSession is null",
this.getClass().getName());
}
else
{
String name = getHttpSessionTask.getName();
Object value = session.getAttribute(name);
dispatchPlan.addEvent("%s.service() HttpSession exists: [%s]=[%s]",
this.getClass().getName(),
name,
Objects.toString(value)
);
}
}
else if (step instanceof Step.HttpSessionSetAttribute sessionSetAttribute)
{
HttpSession session = req.getSession(true);
req.setAttribute("session[" + req.getRequestURI() + "].id", session.getId());
Property prop = sessionSetAttribute.getProperty();
session.setAttribute(prop.getName(), prop.getValue());
}
else
{
throw new RuntimeException("Unable to execute task " + step + " in " + this.getClass().getName());
}
}
}
}

View File

@ -0,0 +1,135 @@
//
// ========================================================================
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
// ========================================================================
//
package org.eclipse.jetty.tests.ccd.ee11;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
import java.util.Objects;
import java.util.Properties;
import java.util.function.Function;
import java.util.function.Supplier;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import org.eclipse.jetty.tests.ccd.common.DispatchPlan;
public class DumpServlet extends HttpServlet
{
private static final String NULL = "<null>";
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException
{
DispatchPlan dispatchPlan = (DispatchPlan)req.getAttribute(DispatchPlan.class.getName());
if (dispatchPlan != null)
{
dispatchPlan.addEvent("%s.service() dispatcherType=%s method=%s requestUri=%s",
this.getClass().getName(),
req.getDispatcherType(), req.getMethod(), req.getRequestURI());
}
Properties props = new Properties();
props.setProperty("requestType", req.getClass().getName());
props.setProperty("responseType", resp.getClass().getName());
props.setProperty("request.authType", Objects.toString(req.getAuthType(), NULL));
props.setProperty("request.characterEncoding", Objects.toString(req.getCharacterEncoding(), NULL));
props.setProperty("request.contentLength", Long.toString(req.getContentLengthLong()));
props.setProperty("request.contentType", Objects.toString(req.getContentType(), NULL));
props.setProperty("request.contextPath", Objects.toString(req.getContextPath(), NULL));
props.setProperty("request.dispatcherType", Objects.toString(req.getDispatcherType(), NULL));
props.setProperty("request.localAddr", Objects.toString(req.getLocalAddr(), NULL));
props.setProperty("request.localName", Objects.toString(req.getLocalName(), NULL));
props.setProperty("request.localPort", Integer.toString(req.getLocalPort()));
props.setProperty("request.locale", Objects.toString(req.getLocale(), NULL));
props.setProperty("request.method", Objects.toString(req.getMethod(), NULL));
props.setProperty("request.pathInfo", Objects.toString(req.getPathInfo(), NULL));
props.setProperty("request.pathTranslated", Objects.toString(req.getPathTranslated(), NULL));
props.setProperty("request.protocol", Objects.toString(req.getProtocol(), NULL));
props.setProperty("request.queryString", Objects.toString(req.getQueryString(), NULL));
props.setProperty("request.remoteAddr", Objects.toString(req.getRemoteAddr(), NULL));
props.setProperty("request.remoteHost", Objects.toString(req.getRemoteHost(), NULL));
props.setProperty("request.remotePort", Integer.toString(req.getRemotePort()));
props.setProperty("request.remoteUser", Objects.toString(req.getRemoteUser(), NULL));
props.setProperty("request.requestedSessionId", Objects.toString(req.getRequestedSessionId(), NULL));
props.setProperty("request.requestURI", Objects.toString(req.getRequestURI(), NULL));
props.setProperty("request.requestURL", Objects.toString(req.getRequestURL(), NULL));
props.setProperty("request.serverPort", Integer.toString(req.getServerPort()));
props.setProperty("request.servletPath", Objects.toString(req.getServletPath(), NULL));
props.setProperty("request.session.exists", "false");
HttpSession httpSession = req.getSession(false);
if (httpSession != null)
{
props.setProperty("request.session.exists", "true");
List<String> attrNames = Collections.list(httpSession.getAttributeNames());
attrNames
.forEach((name) ->
{
Object attrVal = httpSession.getAttribute(name);
props.setProperty("session[" + name + "]", Objects.toString(attrVal, NULL));
});
}
addAttributes(props, "req", req::getAttributeNames, req::getAttribute);
addAttributes(props, "context",
() -> getServletContext().getAttributeNames(),
(name) -> getServletContext().getAttribute(name));
List<String> headerNames = Collections.list(req.getHeaderNames());
headerNames
.forEach((name) ->
{
String headerVal = req.getHeader(name);
props.setProperty("header[" + name + "]", Objects.toString(headerVal, NULL));
});
if (dispatchPlan != null)
{
int eventCount = dispatchPlan.getEvents().size();
props.setProperty("dispatchPlan.events.count", Integer.toString(dispatchPlan.getEvents().size()));
for (int i = 0; i < eventCount; i++)
{
props.setProperty("dispatchPlan.event[" + i + "]", dispatchPlan.getEvents().get(i));
}
}
resp.setStatus(HttpServletResponse.SC_OK);
resp.setCharacterEncoding("utf-8");
resp.setContentType("text/x-java-properties");
PrintWriter out = resp.getWriter();
props.store(out, "From " + this.getClass().getName());
}
private void addAttributes(Properties props,
String prefix,
Supplier<Enumeration<String>> getNamesSupplier,
Function<String, Object> getAttributeFunction)
{
List<String> attrNames = Collections.list(getNamesSupplier.get());
attrNames
.forEach((name) ->
{
Object attrVal = getAttributeFunction.apply(name);
props.setProperty(prefix + ".attr[" + name + "]", Objects.toString(attrVal, NULL));
});
}
}

View File

@ -0,0 +1,35 @@
//
// ========================================================================
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
// ========================================================================
//
package org.eclipse.jetty.tests.ccd.ee11;
import java.io.IOException;
import java.util.Objects;
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
public class ForwardServlet extends HttpServlet
{
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
String forwardTo = req.getHeader("X-ForwardTo");
Objects.requireNonNull(forwardTo);
RequestDispatcher requestDispatcher = req.getRequestDispatcher(forwardTo);
requestDispatcher.forward(req, resp);
}
}

View File

@ -0,0 +1,56 @@
//
// ========================================================================
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
// ========================================================================
//
package org.eclipse.jetty.tests.ccd.ee11;
import java.io.IOException;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequestWrapper;
import jakarta.servlet.http.HttpServletResponse;
/**
* A servlet filter that will harshly change the return value of
* {@link HttpServletRequest#getRequestURI()} to something that does
* not satisfy the Servlet spec URI invariant {@code request URI == context path + servlet path + path info}
*/
public class InternalRequestURIFilter implements Filter
{
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
{
HttpServletRequest httpServletRequest = (HttpServletRequest)request;
HttpServletResponse httpServletResponse = (HttpServletResponse)response;
InternalRequestURIWrapper requestURIWrapper = new InternalRequestURIWrapper(httpServletRequest);
chain.doFilter(requestURIWrapper, httpServletResponse);
}
private static class InternalRequestURIWrapper extends HttpServletRequestWrapper
{
public InternalRequestURIWrapper(HttpServletRequest request)
{
super(request);
}
@Override
public String getRequestURI()
{
return "/internal/";
}
}
}

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_1.xsd"
version="6.1">
<display-name>ccd-ee10</display-name>
<servlet>
<servlet-name>ccd</servlet-name>
<servlet-class>org.eclipse.jetty.tests.ccd.ee11.CCDServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>dump</servlet-name>
<servlet-class>org.eclipse.jetty.tests.ccd.ee11.DumpServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ccd</servlet-name>
<url-pattern>/redispatch/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dump</servlet-name>
<url-pattern>/dump/*</url-pattern>
</servlet-mapping>
</web-app>

View File

@ -40,7 +40,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public abstract class AbstractRedispatchTest public abstract class AbstractRedispatchTest
{ {
protected static final int START_TIMEOUT = Integer.getInteger("home.start.timeout", 30); protected static final int START_TIMEOUT = Integer.getInteger("home.start.timeout", 30);
protected static final List<String> ENVIRONMENTS = List.of("ee8", "ee9", "ee10"); protected static final List<String> ENVIRONMENTS = List.of("ee8", "ee9", "ee10", "ee11");
static String toResponseDetails(ContentResponse response) static String toResponseDetails(ContentResponse response)
{ {

View File

@ -77,6 +77,7 @@ public class RedispatchPlansTests extends AbstractRedispatchTest
List<String> disabledTests = new ArrayList<>(); List<String> disabledTests = new ArrayList<>();
disabledTests.add("ee10-session-ee8-ee9-ee8.txt"); // causes an ISE disabledTests.add("ee10-session-ee8-ee9-ee8.txt"); // causes an ISE
disabledTests.add("ee11-session-ee8-ee9-ee8.txt"); // causes an ISE
Path testPlansDir = MavenPaths.findTestResourceDir("plans"); Path testPlansDir = MavenPaths.findTestResourceDir("plans");
try (Stream<Path> plansStream = Files.list(testPlansDir)) try (Stream<Path> plansStream = Files.list(testPlansDir))

View File

@ -0,0 +1,30 @@
REQUEST|GET|/ccd-ee11/redispatch/ee11
STEP|SET_HTTP_SESSION_ATTRIBUTE|test-name-10|test-value-ee11
STEP|CONTEXT_FORWARD|/ccd-ee8|/redispatch/ee8
STEP|CONTEXT_FORWARD|/ccd-ee9|/redispatch/ee9
STEP|REQUEST_INCLUDE|/dump/ee9
EXPECTED_EVENT|Initial plan: ee11-forward-to-ee8-include-ee9-dump.txt
EXPECTED_EVENT|DispatchPlanHandler.handle() method=GET path-query=/ccd-ee11/redispatch/ee11
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee11.CCDServlet.service() dispatcherType=REQUEST method=GET requestUri=/ccd-ee11/redispatch/ee11
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee8.CCDServlet.service() dispatcherType=FORWARD method=GET requestUri=/ccd-ee8/redispatch/ee8
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee9.CCDServlet.service() dispatcherType=FORWARD method=GET requestUri=/ccd-ee9/redispatch/ee9
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee9.DumpServlet.service() dispatcherType=INCLUDE method=GET requestUri=/ccd-ee9/redispatch/ee9
EXPECTED_PROP|request.dispatcherType|INCLUDE
EXPECTED_PROP|request.requestURI|/ccd-ee9/redispatch/ee9
EXPECTED_PROP|req.attr[jakarta.servlet.forward.context_path]|/ccd-ee8
EXPECTED_PROP|req.attr[jakarta.servlet.forward.path_info]|/ee8
EXPECTED_PROP|req.attr[jakarta.servlet.forward.request_uri]|/ccd-ee8/redispatch/ee8
EXPECTED_PROP|req.attr[jakarta.servlet.forward.servlet_path]|/redispatch
EXPECTED_PROP|req.attr[jakarta.servlet.include.context_path]/ccd-ee9
EXPECTED_PROP|req.attr[jakarta.servlet.include.path_info]|/ee9
EXPECTED_PROP|req.attr[jakarta.servlet.include.request_uri]|/ccd-ee9/dump/ee9
EXPECTED_PROP|req.attr[jakarta.servlet.include.servlet_path]/dump
EXPECTED_PROP|req.attr[javax.servlet.include.context_path]|<null>
EXPECTED_PROP|req.attr[javax.servlet.include.path_info]|<null>
EXPECTED_PROP|req.attr[javax.servlet.include.request_uri]|<null>
EXPECTED_PROP|req.attr[javax.servlet.include.servlet_path]|<null>
EXPECTED_PROP|req.attr[javax.servlet.forward.context_path]|/ccd-ee8
EXPECTED_PROP|req.attr[javax.servlet.forward.path_info]|/ee8
EXPECTED_PROP|req.attr[javax.servlet.forward.request_uri]|/ccd-ee8/redispatch/ee8
EXPECTED_PROP|req.attr[javax.servlet.forward.servlet_path]|/redispatch
EXPECTED_SESSION_IDS|true

View File

@ -0,0 +1,12 @@
REQUEST|GET|/ccd-ee11/redispatch/ee11
STEP|REQUEST_FORWARD|/dump/ee11
EXPECTED_EVENT|Initial plan: ee11-request-forward-dump.txt
EXPECTED_EVENT|DispatchPlanHandler.handle() method=GET path-query=/ccd-ee11/redispatch/ee11
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee11.CCDServlet.service() dispatcherType=REQUEST method=GET requestUri=/ccd-ee11/redispatch/ee11
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee11.DumpServlet.service() dispatcherType=FORWARD method=GET requestUri=/ccd-ee11/dump/ee11
EXPECTED_PROP|request.dispatcherType|FORWARD
EXPECTED_PROP|request.requestURI|/ccd-ee11/dump/ee11
EXPECTED_PROP|req.attr[jakarta.servlet.forward.context_path]|/ccd-ee11
EXPECTED_PROP|req.attr[jakarta.servlet.forward.path_info]|/ee11
EXPECTED_PROP|req.attr[jakarta.servlet.forward.request_uri]|/ccd-ee11/redispatch/ee11
EXPECTED_PROP|req.attr[jakarta.servlet.forward.servlet_path]|/redispatch

View File

@ -0,0 +1,12 @@
REQUEST|GET|/ccd-ee11/redispatch/ee11
STEP|REQUEST_INCLUDE|/dump/ee11
EXPECTED_EVENT|Initial plan: ee11-request-include-dump.txt
EXPECTED_EVENT|DispatchPlanHandler.handle() method=GET path-query=/ccd-ee11/redispatch/ee11
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee11.CCDServlet.service() dispatcherType=REQUEST method=GET requestUri=/ccd-ee11/redispatch/ee11
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee11.DumpServlet.service() dispatcherType=INCLUDE method=GET requestUri=/ccd-ee11/redispatch/ee11
EXPECTED_PROP|request.dispatcherType|INCLUDE
EXPECTED_PROP|request.requestURI|/ccd-ee11/redispatch/ee11
EXPECTED_PROP|req.attr[jakarta.servlet.include.context_path]|/ccd-ee11
EXPECTED_PROP|req.attr[jakarta.servlet.include.path_info]|/ee11
EXPECTED_PROP|req.attr[jakarta.servlet.include.request_uri]|/ccd-ee11/dump/ee11
EXPECTED_PROP|req.attr[jakarta.servlet.include.servlet_path]|/dump

View File

@ -0,0 +1,36 @@
REQUEST|GET|/ccd-ee11/redispatch/ee11
# we reach ee11
STEP|SET_HTTP_SESSION_ATTRIBUTE|test-name-10|test-value-ee11
STEP|CONTEXT_FORWARD|/ccd-ee8|/redispatch/ee8
# we reach ee8
STEP|GET_HTTP_SESSION_ATTRIBUTE|test-name-10
STEP|SET_HTTP_SESSION_ATTRIBUTE|test-name-8|test-value-ee8
STEP|GET_HTTP_SESSION_ATTRIBUTE|test-name-10
STEP|CONTEXT_FORWARD|/ccd-ee9|/redispatch/ee9
# we reach ee9
STEP|CONTEXT_FORWARD|/ccd-ee8|/redispatch/ee8
# we reach ee8 again (does the HttpSession still exist, and has values?)
STEP|GET_HTTP_SESSION_ATTRIBUTE|test-name-8
STEP|REQUEST_FORWARD|/dump/ee8
EXPECTED_EVENT|Initial plan: ee11-session-ee8-ee9-ee8.txt
EXPECTED_EVENT|DispatchPlanHandler.handle() method=GET path-query=/ccd-ee11/redispatch/ee11
# we reach ee11
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee11.CCDServlet.service() dispatcherType=REQUEST method=GET requestUri=/ccd-ee11/redispatch/ee11
# we reach ee8
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee8.CCDServlet.service() dispatcherType=FORWARD method=GET requestUri=/ccd-ee8/redispatch/ee8
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee8.CCDServlet.service() HttpSession is null
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee8.CCDServlet.service() HttpSession exists: [test-name-10]=[null]
# we reach ee9
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee9.DumpServlet.service() dispatcherType=INCLUDE method=GET requestUri=/ccd-ee9/redispatch/ee9
# we reached ee8 again
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee8.CCDServlet.service() HttpSession exists: [test-name-8]=[test-value-ee8]
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee8.DumpServlet.service() dispatcherType=FORWARD method=GET requestUri=/ccd-ee8/dump/ee8
EXPECTED_PROP|request.dispatcherType|FORWARD
EXPECTED_PROP|request.requestURI|/ccd-ee8/dump/ee8
EXPECTED_PROP|request.session.exists|true
EXPECTED_PROP|session[test-name-8]|test-value-ee8
EXPECTED_PROP|req.attr[javax.servlet.forward.context_path]|/ccd-ee8
EXPECTED_PROP|req.attr[javax.servlet.forward.path_info]|/ee8
EXPECTED_PROP|req.attr[javax.servlet.forward.request_uri]|/ccd-ee8/dump/ee8
EXPECTED_PROP|req.attr[javax.servlet.forward.servlet_path]|/dump
EXPECTED_SESSION_IDS|true

View File

@ -0,0 +1,50 @@
REQUEST|GET|/ccd-ee11/redispatch/ee11
# we reach ee11
STEP|SET_HTTP_SESSION_ATTRIBUTE|test-name-10|test-value-ee11
STEP|CONTEXT_FORWARD|/ccd-ee8|/redispatch/ee8
# we reach ee8
STEP|GET_HTTP_SESSION_ATTRIBUTE|test-name-10
STEP|SET_HTTP_SESSION_ATTRIBUTE|test-name-8|test-value-ee8
STEP|GET_HTTP_SESSION_ATTRIBUTE|test-name-10
STEP|CONTEXT_FORWARD|/ccd-ee9|/redispatch/ee9
# we reach ee9
STEP|GET_HTTP_SESSION_ATTRIBUTE|test-name-10
STEP|SET_HTTP_SESSION_ATTRIBUTE|test-name|test-value-ee9
STEP|GET_HTTP_SESSION_ATTRIBUTE|test-name-10
STEP|GET_HTTP_SESSION_ATTRIBUTE|test-name-8
STEP|REQUEST_INCLUDE|/dump/ee9
EXPECTED_EVENT|Initial plan: ee11-session-forward-to-ee8-session-include-ee9-dump.txt
EXPECTED_EVENT|DispatchPlanHandler.handle() method=GET path-query=/ccd-ee11/redispatch/ee11
# we reach ee11
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee11.CCDServlet.service() dispatcherType=REQUEST method=GET requestUri=/ccd-ee11/redispatch/ee11
# we reach ee8
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee8.CCDServlet.service() dispatcherType=FORWARD method=GET requestUri=/ccd-ee8/redispatch/ee8
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee8.CCDServlet.service() HttpSession is null
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee8.CCDServlet.service() HttpSession exists: [test-name-10]=[null]
# we reach ee9
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee9.CCDServlet.service() dispatcherType=FORWARD method=GET requestUri=/ccd-ee9/redispatch/ee9
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee9.CCDServlet.service() HttpSession is null
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee9.CCDServlet.service() HttpSession exists: [test-name-10]=[null]
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee9.CCDServlet.service() HttpSession exists: [test-name-8]=[null]
EXPECTED_EVENT|org.eclipse.jetty.tests.ccd.ee9.DumpServlet.service() dispatcherType=INCLUDE method=GET requestUri=/ccd-ee9/redispatch/ee9
EXPECTED_PROP|request.dispatcherType|INCLUDE
EXPECTED_PROP|request.requestURI|/ccd-ee9/redispatch/ee9
EXPECTED_PROP|request.session.exists|true
EXPECTED_PROP|session[test-name]|test-value-ee9
EXPECTED_PROP|req.attr[jakarta.servlet.forward.context_path]|/ccd-ee8
EXPECTED_PROP|req.attr[jakarta.servlet.forward.path_info]|/ee8
EXPECTED_PROP|req.attr[jakarta.servlet.forward.request_uri]|/ccd-ee8/redispatch/ee8
EXPECTED_PROP|req.attr[jakarta.servlet.forward.servlet_path]|/redispatch
EXPECTED_PROP|req.attr[jakarta.servlet.include.context_path]/ccd-ee9
EXPECTED_PROP|req.attr[jakarta.servlet.include.path_info]|/ee9
EXPECTED_PROP|req.attr[jakarta.servlet.include.request_uri]|/ccd-ee9/dump/ee9
EXPECTED_PROP|req.attr[jakarta.servlet.include.servlet_path]/dump
EXPECTED_PROP|req.attr[javax.servlet.include.context_path]|<null>
EXPECTED_PROP|req.attr[javax.servlet.include.path_info]|<null>
EXPECTED_PROP|req.attr[javax.servlet.include.request_uri]|<null>
EXPECTED_PROP|req.attr[javax.servlet.include.servlet_path]|<null>
EXPECTED_PROP|req.attr[javax.servlet.forward.context_path]|/ccd-ee8
EXPECTED_PROP|req.attr[javax.servlet.forward.path_info]|/ee8
EXPECTED_PROP|req.attr[javax.servlet.forward.request_uri]|/ccd-ee8/redispatch/ee8
EXPECTED_PROP|req.attr[javax.servlet.forward.servlet_path]|/redispatch
EXPECTED_SESSION_IDS|true

View File

@ -0,0 +1,19 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
<Configure id="wac" class="org.eclipse.jetty.ee11.webapp.WebAppContext">
<Set name="contextPath">/ccd-ee11</Set>
<Set name="war"><Property name="jetty.webapps" default="." />/ccd-ee11</Set>
<Set name="crossContextDispatchSupported">true</Set>
<Get id="sessMan" name="sessionHandler">
<Set name="sessionCache">
<New class="org.eclipse.jetty.tests.ccd.common.PlanSessionCache">
<Arg>
<Ref refid="sessMan"/>
</Arg>
</New>
</Set>
</Get>
</Configure>

View File

@ -14,6 +14,7 @@
<modules> <modules>
<module>ccd-common</module> <module>ccd-common</module>
<module>ccd-ee11-webapp</module>
<module>ccd-ee10-webapp</module> <module>ccd-ee10-webapp</module>
<module>ccd-ee9-webapp</module> <module>ccd-ee9-webapp</module>
<module>ccd-ee8-webapp</module> <module>ccd-ee8-webapp</module>