This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 5de9316aa2 Add test case for jar modifications during build
5de9316aa2 is described below

commit 5de9316aa2980d234c3278eee69255655540e6c9
Author: remm <r...@apache.org>
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: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to