This is an automated email from the ASF dual-hosted git repository.
remm 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 2da7daeed5 Add test case for jar modifications during build
2da7daeed5 is described below
commit 2da7daeed56068cc96e6f0c503ba27b627c80373
Author: remm <[email protected]>
AuthorDate: Tue Jul 16 14:28:11 2024 +0200
Add test case for jar modifications during build
They do not visibly impact regular functionality otherwise so they need
a specific test.
---
test/org/apache/catalina/startup/TestTomcatNoServer.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/test/org/apache/catalina/startup/TestTomcatNoServer.java
b/test/org/apache/catalina/startup/TestTomcatNoServer.java
index 882bd4a5a3..34f26c98dc 100644
--- a/test/org/apache/catalina/startup/TestTomcatNoServer.java
+++ b/test/org/apache/catalina/startup/TestTomcatNoServer.java
@@ -21,6 +21,8 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
import org.junit.Assert;
import org.junit.Test;
@@ -86,4 +88,14 @@ public class TestTomcatNoServer {
Assert.fail("Embedded is missing [" + missingInWebXml.size() + "]
entries compared to conf/web.xml");
}
}
+
+ @Test
+ public void testJarsDecoration() throws Exception {
+ File libDir = new File(LoggingBaseTest.getBuildDirectory(), "lib");
+ try (JarFile catalinaJar = new JarFile(new File(libDir,
"tomcat-util.jar"))) {
+ Manifest manifest = catalinaJar.getManifest();
+
Assert.assertFalse(manifest.getMainAttributes().getValue("Export-Package").isEmpty());
+ Assert.assertNotNull(catalinaJar.getJarEntry("module-info.class"));
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]