This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 3010feada4 Add version checks for tests that require Java > 11
3010feada4 is described below
commit 3010feada46d8cca67c8e4a7fd66309504bc7c2b
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Nov 10 12:02:39 2026 +0000
Add version checks for tests that require Java > 11
---
test/org/apache/catalina/realm/TestDataSourceRealm.java | 4 +++-
test/org/apache/jasper/compiler/TestJavaCompiler.java | 4 ++--
test/webapp/jstl/foreach-begin-after-end.jsp | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/test/org/apache/catalina/realm/TestDataSourceRealm.java
b/test/org/apache/catalina/realm/TestDataSourceRealm.java
index d0677fdd70..e6627d3b7a 100644
--- a/test/org/apache/catalina/realm/TestDataSourceRealm.java
+++ b/test/org/apache/catalina/realm/TestDataSourceRealm.java
@@ -90,7 +90,7 @@ public class TestDataSourceRealm extends LoggingBaseTest {
@Test
public void testRealm() throws Exception {
- Assume.assumeTrue(JreCompat.isJre16Available());
+ Assume.assumeTrue("Database tests require Derby which requires Java
17+", JreCompat.isJre17Available());
db = new DerbyDataSourceRealm("dsRealm");
db.setUserTable("users");
@@ -166,6 +166,8 @@ public class TestDataSourceRealm extends LoggingBaseTest {
@Test
public void testRealmWithoutRoleStore() throws Exception {
+ Assume.assumeTrue("Database tests require Derby which requires Java
17+", JreCompat.isJre17Available());
+
db = new DerbyDataSourceRealm("dsRealmNoRoles");
db.setUserTable("users");
db.setUserNameCol("user_name");
diff --git a/test/org/apache/jasper/compiler/TestJavaCompiler.java
b/test/org/apache/jasper/compiler/TestJavaCompiler.java
index f4f3c090b9..c36d13a3ca 100644
--- a/test/org/apache/jasper/compiler/TestJavaCompiler.java
+++ b/test/org/apache/jasper/compiler/TestJavaCompiler.java
@@ -76,9 +76,9 @@ public class TestJavaCompiler {
Options options = EasyMock.createMock(Options.class);
EasyMock.expect(options.getJavaEncoding()).andReturn("UTF-8")
.anyTimes();
- EasyMock.expect(options.getCompilerSourceVM()).andReturn("17")
+ EasyMock.expect(options.getCompilerSourceVM()).andReturn("11")
.anyTimes();
- EasyMock.expect(options.getCompilerTargetVM()).andReturn("17")
+ EasyMock.expect(options.getCompilerTargetVM()).andReturn("11")
.anyTimes();
EasyMock.replay(options);
diff --git a/test/webapp/jstl/foreach-begin-after-end.jsp
b/test/webapp/jstl/foreach-begin-after-end.jsp
index bd3f7c29bb..adbdad06f6 100644
--- a/test/webapp/jstl/foreach-begin-after-end.jsp
+++ b/test/webapp/jstl/foreach-begin-after-end.jsp
@@ -18,7 +18,7 @@
pageEncoding="UTF-8" import="java.util.Iterator,java.util.List" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
- Iterator<String> iterator = List.of("a", "b", "c", "d").iterator();
+ Iterator<String> iterator = Arrays.asList("a", "b", "c", "d").iterator();
pageContext.setAttribute("values", iterator);
pageContext.setAttribute("array", new String[] { "a", "b", "c", "d" });
%>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]