This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new 68e8378102 Fix failing tests when running on Java 17.
68e8378102 is described below
commit 68e83781027ef71af6d94b147252a6c5be967d07
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Nov 9 13:48:05 2026 +0000
Fix failing tests when running on Java 17.
Also better messages when asserting Java versions
---
test/org/apache/catalina/core/TestStandardVirtualThreadExecutor.java | 4 ++--
test/org/apache/tomcat/util/net/TestAbstractEndpoint.java | 4 ++++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git
a/test/org/apache/catalina/core/TestStandardVirtualThreadExecutor.java
b/test/org/apache/catalina/core/TestStandardVirtualThreadExecutor.java
index 8e55747835..fd121d7608 100644
--- a/test/org/apache/catalina/core/TestStandardVirtualThreadExecutor.java
+++ b/test/org/apache/catalina/core/TestStandardVirtualThreadExecutor.java
@@ -28,7 +28,7 @@ public class TestStandardVirtualThreadExecutor {
@Test
public void testVirtualThreadExecutorAwaitTerminationNotStarted() throws
Exception {
- Assume.assumeTrue(JreCompat.isJre21Available());
+ Assume.assumeTrue("JRE 21+ not available",
JreCompat.isJre21Available());
@SuppressWarnings("resource") // never started
StandardVirtualThreadExecutor executor = new
StandardVirtualThreadExecutor();
try {
@@ -42,7 +42,7 @@ public class TestStandardVirtualThreadExecutor {
@Test
public void testVirtualThreadExecutorAwaitTerminationDelegates() throws
Exception {
- Assume.assumeTrue(JreCompat.isJre21Available());
+ Assume.assumeTrue("JRE 21+ not available",
JreCompat.isJre21Available());
@SuppressWarnings("resource") // stop() is called
StandardVirtualThreadExecutor executor = new
StandardVirtualThreadExecutor();
executor.start();
diff --git a/test/org/apache/tomcat/util/net/TestAbstractEndpoint.java
b/test/org/apache/tomcat/util/net/TestAbstractEndpoint.java
index 4b06e254c9..ab1605c4ad 100644
--- a/test/org/apache/tomcat/util/net/TestAbstractEndpoint.java
+++ b/test/org/apache/tomcat/util/net/TestAbstractEndpoint.java
@@ -23,8 +23,10 @@ import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import org.junit.Assert;
+import org.junit.Assume;
import org.junit.Test;
+import org.apache.tomcat.util.compat.JreCompat;
import org.apache.tomcat.util.threads.VirtualThreadExecutor;
public class TestAbstractEndpoint {
@@ -77,6 +79,7 @@ public class TestAbstractEndpoint {
*/
@Test
public void testCreatedVirtualThreadExecutorIsShutDownOnStop() throws
Exception {
+ Assume.assumeTrue("JRE 21+ not available",
JreCompat.isJre21Available());
NioEndpoint endpoint = new NioEndpoint();
endpoint.setUseVirtualThreads(true);
endpoint.createExecutor();
@@ -97,6 +100,7 @@ public class TestAbstractEndpoint {
@Test
public void testExternalVirtualThreadExecutorIsNotShutDownOnStop() throws
Exception {
+ Assume.assumeTrue("JRE 21+ not available",
JreCompat.isJre21Available());
NioEndpoint endpoint = new NioEndpoint();
VirtualThreadExecutor executor = new
VirtualThreadExecutor("test-external-");
endpoint.setExecutor(executor);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]