diff --git a/jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java b/jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java index c09a7cfe0676..0e0ef8b30978 100644 --- a/jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java +++ b/jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java @@ -436,7 +436,9 @@ else if (status == HttpStatus.NO_CONTENT_204 || status == HttpStatus.NOT_MODIFIE case COMPLETING_1XX: { + Boolean persistent = _persistent; reset(); + _persistent = persistent; return Result.DONE; } diff --git a/jetty-core/jetty-server/src/main/config/modules/customrequestlog.mod b/jetty-core/jetty-server/src/main/config/modules/customrequestlog.mod deleted file mode 100644 index e2b0178d50d3..000000000000 --- a/jetty-core/jetty-server/src/main/config/modules/customrequestlog.mod +++ /dev/null @@ -1,12 +0,0 @@ -# DO NOT EDIT THIS FILE - See: https://jetty.org/docs/ - -[description] -Deprecated name for requestlog using custom request logger. - -[tags] -requestlog -internal - -[depends] -requestlog - diff --git a/jetty-core/jetty-server/src/main/config/modules/delay-until-content.mod b/jetty-core/jetty-server/src/main/config/modules/delay-until-content.mod index b0a1e623b630..802bde312088 100644 --- a/jetty-core/jetty-server/src/main/config/modules/delay-until-content.mod +++ b/jetty-core/jetty-server/src/main/config/modules/delay-until-content.mod @@ -6,6 +6,9 @@ For form data and multipart, the handling is delayed until the entire request bo been asynchronously read. For all other content types, the delay is for up to a configurable number of content bytes. +[deprecated] +Use 'eager-content' module instead. + [tags] server diff --git a/jetty-core/jetty-server/src/main/config/modules/eager-content.mod b/jetty-core/jetty-server/src/main/config/modules/eager-content.mod index c421e6b9939b..9156cd0ff4be 100644 --- a/jetty-core/jetty-server/src/main/config/modules/eager-content.mod +++ b/jetty-core/jetty-server/src/main/config/modules/eager-content.mod @@ -13,8 +13,8 @@ server [after] compression -cross-origin gzip +cross-origin rewrite size-limit diff --git a/jetty-core/jetty-server/src/main/config/modules/qos.mod b/jetty-core/jetty-server/src/main/config/modules/qos.mod index ceab41292e0a..b85a52202f97 100644 --- a/jetty-core/jetty-server/src/main/config/modules/qos.mod +++ b/jetty-core/jetty-server/src/main/config/modules/qos.mod @@ -5,10 +5,6 @@ to limit the number of concurrent requests, for resource management. [tags] server -[before] -compression -gzip - [depends] server diff --git a/jetty-core/jetty-server/src/main/config/modules/thread-limit.mod b/jetty-core/jetty-server/src/main/config/modules/thread-limit.mod index 0ba449025c6e..d3c765efa92d 100644 --- a/jetty-core/jetty-server/src/main/config/modules/thread-limit.mod +++ b/jetty-core/jetty-server/src/main/config/modules/thread-limit.mod @@ -5,10 +5,6 @@ the number of requests per IP address, for denial-of-service protection. [tags] server -[before] -compression -gzip - [depends] server diff --git a/jetty-core/jetty-server/src/main/config/modules/threadlimit.mod b/jetty-core/jetty-server/src/main/config/modules/threadlimit.mod index fcbd227bedf6..14e8bec5e8bd 100644 --- a/jetty-core/jetty-server/src/main/config/modules/threadlimit.mod +++ b/jetty-core/jetty-server/src/main/config/modules/threadlimit.mod @@ -1,5 +1,9 @@ [description] -DEPRECATED - use the thread-limit module instead. +Installs ThreadLimitHandler at the root of the `Handler` tree, to limit +the number of requests per IP address, for denial-of-service protection. + +[deprecated] +Use 'thread-limit' module instead. [depend] thread-limit diff --git a/jetty-core/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java b/jetty-core/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java index c0710b8b9c03..45bbe9288d80 100644 --- a/jetty-core/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java +++ b/jetty-core/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java @@ -186,12 +186,12 @@ public Module(BaseHome basehome, Path path) throws IOException } if (m < 0) throw new IllegalArgumentException("Module not contained within modules directory: " + basehome.toShortForm(path)); - String n = path.getName(m + 1).toString(); + StringBuilder n = new StringBuilder(path.getName(m + 1).toString()); for (int i = m + 2; i < path.getNameCount(); i++) { - n = n + "/" + path.getName(i).toString(); + n.append("/").append(path.getName(i)); } - Matcher matcher = MOD_NAME.matcher(n); + Matcher matcher = MOD_NAME.matcher(n.toString()); if (!matcher.matches()) throw new IllegalArgumentException("Module filename must have .mod extension: " + basehome.toShortForm(path)); _name = matcher.group(1); @@ -248,7 +248,7 @@ public boolean equals(Object obj) public void expandDependencies(Props props) { - Function expander = d -> props.expand(d); + Function expander = props::expand; List tmp = _depends.stream().map(expander).collect(Collectors.toList()); _depends.clear(); @@ -329,7 +329,7 @@ public int hashCode() public boolean hasLicense() { - return (_license != null) && (_license.size() > 0); + return !_license.isEmpty(); } /** @@ -383,7 +383,7 @@ public void process(BaseHome basehome) throws FileNotFoundException, IOException else { // blank lines and comments are valid for ini-template section - if ((line.length() == 0) || line.startsWith("#")) + if ((line.isEmpty()) || line.startsWith("#")) { // Remember ini comments and whitespace (empty lines) // for the [ini-template] section @@ -556,6 +556,11 @@ public List getDepends() return new ArrayList<>(_depends); } + public boolean isDeprecated() + { + return !_deprecated.isEmpty(); + } + public List getDeprecated() { return List.copyOf(_deprecated); diff --git a/jetty-core/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java b/jetty-core/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java index 8ab5328881ce..2be5a5b98d52 100644 --- a/jetty-core/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java +++ b/jetty-core/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java @@ -97,7 +97,7 @@ public void showModules(PrintStream out, List modules) String label; Set provides = module.getProvides(); provides.remove(module.getName()); - out.printf("%n Module: %s %s%n", module.getName(), provides.size() > 0 ? provides : ""); + out.printf("%n Module: %s %s%n", module.getName(), !provides.isEmpty() ? provides : ""); for (String description : module.getDescription()) { out.printf(" : %s%n", description); @@ -182,12 +182,13 @@ public void listModules(PrintStream out, List tags) tags = new ArrayList<>(tags); - boolean wild = tags.contains("*"); + boolean wild = tags.remove("*"); + boolean showDeprecated = tags.remove("deprecated") || wild; + Set included = new HashSet<>(); - if (wild) - tags.remove("*"); - else + if (!wild) tags.stream().filter(t -> !t.startsWith("-")).forEach(included::add); + Set excluded = new HashSet<>(); tags.stream().filter(t -> t.startsWith("-")).map(t -> t.substring(1)).forEach(excluded::add); if (!included.contains("internal")) @@ -199,12 +200,14 @@ public void listModules(PrintStream out, List tags) Optional max = _modules.stream().filter(filter).map(Module::getName).map(String::length).max(Integer::compareTo); if (max.isEmpty()) return; - String format = "%" + max.get() + "s - %s%n"; + String format = "%" + max.get() + "s - %s%s%n"; Comparator comparator = wild ? Comparator.comparing(Module::getName) : Module::compareTo; AtomicReference tag = new AtomicReference<>(); _modules.stream().filter(filter).sorted(comparator).forEach(module -> { + if (module.isDeprecated() && !showDeprecated) + return; if (!wild && !module.getPrimaryTag().equals(tag.get())) { tag.set(module.getPrimaryTag()); @@ -213,7 +216,7 @@ public void listModules(PrintStream out, List tags) } List description = module.getDescription(); - out.printf(format, module.getName(), description != null && description.size() > 0 ? description.get(0) : ""); + out.printf(format, module.getName(), module.isDeprecated() ? "DEPRECATED " : "", description != null && !description.isEmpty() ? description.get(0) : ""); }); } @@ -229,7 +232,7 @@ public void listEnabled(PrintStream out) { String index = (i++) + ")"; String name = module.getName(); - if (!module.getDeprecated().isEmpty()) + if (module.isDeprecated()) name += " (deprecated)"; for (String s : module.getEnableSources()) { @@ -424,10 +427,9 @@ private void enable(Set newlyEnabled, Module module, String enabledFrom, return; } - List deprecated = module.getDeprecated(); - if (!deprecated.isEmpty()) + if (module.isDeprecated()) { - String reason = deprecated.stream().collect(Collectors.joining(System.lineSeparator())); + String reason = module.getDeprecated().stream().collect(Collectors.joining(System.lineSeparator())); StartLog.warn(reason); } @@ -635,7 +637,7 @@ public void checkEnabledModules() Set providers = getAvailableProviders(d); if (providers.stream().noneMatch(Module::isEnabled)) { - if (unsatisfied.length() > 0) + if (!unsatisfied.isEmpty()) unsatisfied.append(','); unsatisfied.append(m.getName()); StartLog.error("Module [%s] requires a module providing [%s] from one of %s%n", m.getName(), d, providers); @@ -643,7 +645,7 @@ public void checkEnabledModules() }); }); - if (unsatisfied.length() > 0) + if (!unsatisfied.isEmpty()) throw new UsageException(-1, "Unsatisfied module dependencies: " + unsatisfied); } } diff --git a/jetty-ee10/jetty-ee10-tests/jetty-ee10-test-integration/src/test/java/org/eclipse/jetty/ee10/test/rfcs/RFC2616BaseTest.java b/jetty-ee10/jetty-ee10-tests/jetty-ee10-test-integration/src/test/java/org/eclipse/jetty/ee10/test/rfcs/RFC2616BaseTest.java index 340282d9a580..f4d8f2dafd79 100644 --- a/jetty-ee10/jetty-ee10-tests/jetty-ee10-test-integration/src/test/java/org/eclipse/jetty/ee10/test/rfcs/RFC2616BaseTest.java +++ b/jetty-ee10/jetty-ee10-tests/jetty-ee10-test-integration/src/test/java/org/eclipse/jetty/ee10/test/rfcs/RFC2616BaseTest.java @@ -14,7 +14,10 @@ package org.eclipse.jetty.ee10.test.rfcs; import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.net.Socket; +import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -46,7 +49,9 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.startsWith; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -665,7 +670,6 @@ public void test81() throws Exception * * @see RFC 2616 (section 8.2) */ - @Disabled //TODO https://github.com/jetty/jetty.project/issues/9206 @Test public void test82ExpectInvalid() throws Exception { @@ -690,7 +694,6 @@ public void test82ExpectInvalid() throws Exception * * @see RFC 2616 (section 8.2) */ - @Disabled //TODO https://github.com/jetty/jetty.project/issues/9206 @Test public void test82ExpectWithBody() throws Exception { @@ -719,35 +722,70 @@ public void test82ExpectWithBody() throws Exception * @throws Exception failure * @see RFC 2616 (section 8.2) */ - @Disabled //TODO https://github.com/jetty/jetty.project/issues/9206 @Test public void test82UnexpectWithBody() throws Exception { // Expect with body - StringBuffer req3 = new StringBuffer(); - req3.append("GET /redirect/R1 HTTP/1.1\n"); - req3.append("Host: localhost\n"); - req3.append("Expect: 100-continue\n"); // Valid Expect header. - req3.append("Content-Type: text/plain\n"); - req3.append("Content-Length: 8\n"); - req3.append("\n"); - req3.append("123456\r\n"); - req3.append("GET /echo/R1 HTTP/1.1\n"); - req3.append("Host: localhost\n"); - req3.append("Content-Type: text/plain\n"); - req3.append("Content-Length: 8\n"); - req3.append("Connection: close\n"); - req3.append("\n"); - req3.append("87654321"); // Body + String request1 = """ + GET /redirect/R1 HTTP/1.1\r + Host: localhost\r + Expect: 100-continue\r + Content-Type: text/plain\r + Content-Length: 8\r + \r + """; + + String bodyAndRequest2 = """ + 123456\r + GET /echo/R1 HTTP/1.1\r + Host: localhost\r + Content-Type: text/plain\r + Content-Length: 8\r + Connection: close\r + \r + 87654321 + """; + + try (Socket socket = http.open()) + { + InputStream in = socket.getInputStream(); + OutputStream out = socket.getOutputStream(); - List responses = http.requests(req3); + out.write(request1.getBytes(StandardCharsets.ISO_8859_1)); + out.flush(); - HttpTester.Response response = responses.get(0); + byte[] raw = new byte[8192]; + int offset = 0; + int length = raw.length; + while (true) + { + int len = in.read(raw, offset, length); + assertThat(len, greaterThan(0)); + offset += len; + length -= len; + String response = new String(raw, 0, offset, StandardCharsets.ISO_8859_1); + if (response.contains("HTTP/1.1 302 Found\r\n")) + break; + } - assertEquals(302, response.getStatus(), "8.2.3 ignored no 100"); - assertEquals("close", response.get("Connection")); - assertEquals(1, responses.size()); + out.write(bodyAndRequest2.getBytes(StandardCharsets.ISO_8859_1)); + out.flush(); + + while (true) + { + int len = in.read(raw, offset, length); + if (len < 0) + break; + offset += len; + length -= len; + } + + String response = new String(raw, 0, offset, StandardCharsets.ISO_8859_1); + assertThat(response, containsString("Connection: close")); + assertThat(response, not(containsString(" 200 OK"))); + assertThat(response, not(containsString("87654321"))); + } } /** @@ -755,13 +793,12 @@ public void test82UnexpectWithBody() throws Exception * * @see RFC 2616 (section 8.2) */ - @Disabled //TODO review Expect/Continue-100 handling @Test public void test82ExpectNormal() throws Exception { // Expect 100 - StringBuffer req4 = new StringBuffer(); + StringBuilder req4 = new StringBuilder(); req4.append("GET /echo/R1 HTTP/1.1\n"); req4.append("Host: localhost\n"); req4.append("Connection: close\n"); @@ -770,24 +807,50 @@ public void test82ExpectNormal() throws Exception req4.append("Content-Length: 7\n"); req4.append("\n"); // No body - Socket sock = http.open(); - try + http.setTimeoutMillis(1000000); + try (Socket sock = http.open()) { - http.send(sock, req4); - - http.setTimeoutMillis(2000); - HttpTester.Response response = http.readAvailable(sock); - assertThat("8.2.3 expect 100", response.getStatus(), is(HttpStatus.CONTINUE_100)); + InputStream in = sock.getInputStream(); + OutputStream out = sock.getOutputStream(); + out.write(req4.toString().getBytes(StandardCharsets.ISO_8859_1)); + out.flush(); + + byte[] raw = new byte[8192]; + int offset = 0; + int length = raw.length; + while (true) + { + int len = in.read(raw, offset, length); + assertThat(len, greaterThan(0)); + offset += len; + length -= len; + String response = new String(raw, 0, offset, StandardCharsets.ISO_8859_1); + if (response.equals("HTTP/1.1 100 Continue\r\n\r\n")) + break; + } - http.send(sock, "654321\n"); // Now send the data - response = http.read(sock); + out.write("6543210".getBytes(StandardCharsets.ISO_8859_1)); + out.flush(); - assertThat("8.2.3 expect 100", response.getStatus(), is(HttpStatus.OK_200)); - assertThat("8.2.3 expect 100", response.getContent(), Matchers.containsString("654321\n")); - } - finally - { - http.close(sock); + while (true) + { + int len = in.read(raw, offset, length); + if (len > 0) + { + offset += len; + length -= len; + } + else if (len == 0) + { + throw new IllegalStateException(); + } + else + { + String response = new String(raw, 0, offset, StandardCharsets.ISO_8859_1); + if (response.contains("HTTP/1.1 200 OK\r\n") && response.contains("6543210")) + break; + } + } } } diff --git a/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/rfcs/RFC2616BaseTest.java b/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/rfcs/RFC2616BaseTest.java index 00fe0275ad6e..cf8379ba69e7 100644 --- a/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/rfcs/RFC2616BaseTest.java +++ b/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/rfcs/RFC2616BaseTest.java @@ -14,7 +14,10 @@ package org.eclipse.jetty.ee11.test.rfcs; import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.net.Socket; +import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -46,7 +49,9 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.startsWith; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -55,6 +60,7 @@ /** * RFC 2616 (HTTP/1.1) Test Case */ +@Deprecated(forRemoval = true, since = "12.1.0") public abstract class RFC2616BaseTest { public static class EchoHandler extends Handler.Abstract.NonBlocking @@ -665,7 +671,6 @@ public void test81() throws Exception * * @see RFC 2616 (section 8.2) */ - @Disabled //TODO https://github.com/jetty/jetty.project/issues/9206 @Test public void test82ExpectInvalid() throws Exception { @@ -690,7 +695,6 @@ public void test82ExpectInvalid() throws Exception * * @see RFC 2616 (section 8.2) */ - @Disabled //TODO https://github.com/jetty/jetty.project/issues/9206 @Test public void test82ExpectWithBody() throws Exception { @@ -719,35 +723,70 @@ public void test82ExpectWithBody() throws Exception * @throws Exception failure * @see RFC 2616 (section 8.2) */ - @Disabled //TODO https://github.com/jetty/jetty.project/issues/9206 @Test public void test82UnexpectWithBody() throws Exception { // Expect with body - StringBuffer req3 = new StringBuffer(); - req3.append("GET /redirect/R1 HTTP/1.1\n"); - req3.append("Host: localhost\n"); - req3.append("Expect: 100-continue\n"); // Valid Expect header. - req3.append("Content-Type: text/plain\n"); - req3.append("Content-Length: 8\n"); - req3.append("\n"); - req3.append("123456\r\n"); - req3.append("GET /echo/R1 HTTP/1.1\n"); - req3.append("Host: localhost\n"); - req3.append("Content-Type: text/plain\n"); - req3.append("Content-Length: 8\n"); - req3.append("Connection: close\n"); - req3.append("\n"); - req3.append("87654321"); // Body + String request1 = """ + GET /redirect/R1 HTTP/1.1\r + Host: localhost\r + Expect: 100-continue\r + Content-Type: text/plain\r + Content-Length: 8\r + \r + """; + + String bodyAndRequest2 = """ + 123456\r + GET /echo/R1 HTTP/1.1\r + Host: localhost\r + Content-Type: text/plain\r + Content-Length: 8\r + Connection: close\r + \r + 87654321 + """; + + try (Socket socket = http.open()) + { + InputStream in = socket.getInputStream(); + OutputStream out = socket.getOutputStream(); - List responses = http.requests(req3); + out.write(request1.getBytes(StandardCharsets.ISO_8859_1)); + out.flush(); - HttpTester.Response response = responses.get(0); + byte[] raw = new byte[8192]; + int offset = 0; + int length = raw.length; + while (true) + { + int len = in.read(raw, offset, length); + assertThat(len, greaterThan(0)); + offset += len; + length -= len; + String response = new String(raw, 0, offset, StandardCharsets.ISO_8859_1); + if (response.contains("HTTP/1.1 302 Found\r\n")) + break; + } - assertEquals(302, response.getStatus(), "8.2.3 ignored no 100"); - assertEquals("close", response.get("Connection")); - assertEquals(1, responses.size()); + out.write(bodyAndRequest2.getBytes(StandardCharsets.ISO_8859_1)); + out.flush(); + + while (true) + { + int len = in.read(raw, offset, length); + if (len < 0) + break; + offset += len; + length -= len; + } + + String response = new String(raw, 0, offset, StandardCharsets.ISO_8859_1); + assertThat(response, containsString("Connection: close")); + assertThat(response, not(containsString(" 200 OK"))); + assertThat(response, not(containsString("87654321"))); + } } /** @@ -755,13 +794,12 @@ public void test82UnexpectWithBody() throws Exception * * @see RFC 2616 (section 8.2) */ - @Disabled //TODO review Expect/Continue-100 handling @Test public void test82ExpectNormal() throws Exception { // Expect 100 - StringBuffer req4 = new StringBuffer(); + StringBuilder req4 = new StringBuilder(); req4.append("GET /echo/R1 HTTP/1.1\n"); req4.append("Host: localhost\n"); req4.append("Connection: close\n"); @@ -770,24 +808,50 @@ public void test82ExpectNormal() throws Exception req4.append("Content-Length: 7\n"); req4.append("\n"); // No body - Socket sock = http.open(); - try + http.setTimeoutMillis(1000000); + try (Socket sock = http.open()) { - http.send(sock, req4); - - http.setTimeoutMillis(2000); - HttpTester.Response response = http.readAvailable(sock); - assertThat("8.2.3 expect 100", response.getStatus(), is(HttpStatus.CONTINUE_100)); + InputStream in = sock.getInputStream(); + OutputStream out = sock.getOutputStream(); + out.write(req4.toString().getBytes(StandardCharsets.ISO_8859_1)); + out.flush(); + + byte[] raw = new byte[8192]; + int offset = 0; + int length = raw.length; + while (true) + { + int len = in.read(raw, offset, length); + assertThat(len, greaterThan(0)); + offset += len; + length -= len; + String response = new String(raw, 0, offset, StandardCharsets.ISO_8859_1); + if (response.equals("HTTP/1.1 100 Continue\r\n\r\n")) + break; + } - http.send(sock, "654321\n"); // Now send the data - response = http.read(sock); + out.write("6543210".getBytes(StandardCharsets.ISO_8859_1)); + out.flush(); - assertThat("8.2.3 expect 100", response.getStatus(), is(HttpStatus.OK_200)); - assertThat("8.2.3 expect 100", response.getContent(), Matchers.containsString("654321\n")); - } - finally - { - http.close(sock); + while (true) + { + int len = in.read(raw, offset, length); + if (len > 0) + { + offset += len; + length -= len; + } + else if (len == 0) + { + throw new IllegalStateException(); + } + else + { + String response = new String(raw, 0, offset, StandardCharsets.ISO_8859_1); + if (response.contains("HTTP/1.1 200 OK\r\n") && response.contains("6543210")) + break; + } + } } } diff --git a/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/rfcs/RFC2616NIOHttpTest.java b/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/rfcs/RFC2616NIOHttpTest.java index 0287ad241625..988e82e468b6 100644 --- a/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/rfcs/RFC2616NIOHttpTest.java +++ b/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/rfcs/RFC2616NIOHttpTest.java @@ -27,6 +27,7 @@ * Perform the RFC2616 tests against a server running with the Jetty NIO Connector and listening on standard HTTP. */ @ExtendWith(WorkDirExtension.class) +@Deprecated(forRemoval = true, since = "12.1.0") public class RFC2616NIOHttpTest extends RFC2616BaseTest { private static XmlBasedJettyServer xmlBasedJettyServer; diff --git a/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/rfcs/RFC2616NIOHttpsTest.java b/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/rfcs/RFC2616NIOHttpsTest.java index 02c7fee4bce6..78c669f4e54a 100644 --- a/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/rfcs/RFC2616NIOHttpsTest.java +++ b/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/rfcs/RFC2616NIOHttpsTest.java @@ -29,6 +29,7 @@ * Perform the RFC2616 tests against a server running with the Jetty NIO Connector and listening on HTTPS (HTTP over SSL). */ @ExtendWith(WorkDirExtension.class) +@Deprecated(forRemoval = true, since = "12.1.0") public class RFC2616NIOHttpsTest extends RFC2616BaseTest { private static XmlBasedJettyServer xmlBasedJettyServer; diff --git a/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/support/rawhttp/HttpTesting.java b/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/support/rawhttp/HttpTesting.java index f38cca454707..59ee731a1eb8 100644 --- a/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/support/rawhttp/HttpTesting.java +++ b/jetty-ee11/jetty-ee11-tests/jetty-ee11-test-integration/src/test/java/org/eclipse/jetty/ee11/test/support/rawhttp/HttpTesting.java @@ -36,6 +36,7 @@ /** * Testing utility for performing RAW HTTP request/response. */ +@Deprecated(forRemoval = true, since = "12.1.0") public class HttpTesting { private boolean debug = false; diff --git a/tests/test-distribution/test-distribution-common/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java b/tests/test-distribution/test-distribution-common/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java index 6128ecac2d45..31c6398e8162 100644 --- a/tests/test-distribution/test-distribution-common/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java +++ b/tests/test-distribution/test-distribution-common/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java @@ -1177,11 +1177,20 @@ public void testDeprecatedModule() throws Exception ); Files.write(deprecatedModule, lines, StandardOpenOption.CREATE); + try (JettyHomeTester.Run listConfigRun = distribution.start(List.of("--list-modules"))) + { + assertTrue(listConfigRun.awaitFor(START_TIMEOUT, TimeUnit.SECONDS)); + assertEquals(0, listConfigRun.getExitValue()); + + assertTrue(listConfigRun.getLogs().stream().noneMatch(log -> log.contains("DEPRECATED"))); + } + try (JettyHomeTester.Run listConfigRun = distribution.start(List.of("--list-modules=deprecated"))) { assertTrue(listConfigRun.awaitFor(START_TIMEOUT, TimeUnit.SECONDS)); assertEquals(0, listConfigRun.getExitValue()); + assertTrue(listConfigRun.getLogs().stream().anyMatch(log -> log.contains("DEPRECATED"))); assertTrue(listConfigRun.getLogs().stream().anyMatch(log -> log.contains(description))); }