Upgrade to Jetty 12

This commit upgrades Spring Framework to Jetty 12.0.1, and Reactive HTTP
 Client 4.0.0.

Closes gh-30698
This commit is contained in:
Arjen Poutsma
2023-06-22 11:53:50 +02:00
parent 210b42b7d8
commit 6597727c86
32 changed files with 491 additions and 851 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
package org.springframework.web.bind.support;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import jakarta.servlet.MultipartConfigElement;
@@ -23,11 +25,11 @@ import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.Part;
import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
import org.eclipse.jetty.ee10.servlet.ServletHolder;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.NetworkConnector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -37,6 +39,7 @@ import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.util.FileSystemUtils;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
@@ -61,6 +64,8 @@ class WebRequestDataBinderIntegrationTests {
private String baseUrl;
private Path tempDirectory;
@BeforeAll
void startJettyServer() throws Exception {
@@ -69,7 +74,9 @@ class WebRequestDataBinderIntegrationTests {
ServletContextHandler handler = new ServletContextHandler();
MultipartConfigElement multipartConfig = new MultipartConfigElement("");
this.tempDirectory = Files.createTempDirectory("WebRequestDataBinderIntegrationTests");
MultipartConfigElement multipartConfig = new MultipartConfigElement(this.tempDirectory.toString());
ServletHolder holder = new ServletHolder(partsServlet);
holder.getRegistration().setMultipartConfig(multipartConfig);
@@ -89,8 +96,13 @@ class WebRequestDataBinderIntegrationTests {
@AfterAll
void stopJettyServer() throws Exception {
if (jettyServer != null) {
jettyServer.stop();
try {
if (jettyServer != null) {
jettyServer.stop();
}
}
finally {
FileSystemUtils.deleteRecursively(this.tempDirectory);
}
}