You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2022/02/03 14:17:24 UTC

[GitHub] [activemq-artemis] tlbueno commented on a change in pull request #3929: NO-JIRA - fix ManifestTest to look for the correct client jms jar files / move it from unit to integration tests

tlbueno commented on a change in pull request #3929:
URL: https://github.com/apache/activemq-artemis/pull/3929#discussion_r798606927



##########
File path: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ManifestTest.java
##########
@@ -31,36 +24,44 @@
 import org.junit.Assert;
 import org.junit.Test;
 
+import javax.jms.ConnectionMetaData;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Properties;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+
 public class ManifestTest extends ActiveMQTestBase {
 
    private static final Logger log = Logger.getLogger(ManifestTest.class);
-
-
+   private static List<String> jarFiles = new ArrayList<>(Arrays.asList(
+           "artemis-jms-client-", "artemis-jms-server-"));
 
    @Test
    public void testManifestEntries() throws Exception {
       Properties props = System.getProperties();
       String userDir = props.getProperty("build.lib");
-
       log.trace("userDir is " + userDir);
 
-      // The jar must be there
-      File file = new File("build/jars", "activemq-core.jar");
-      Assert.assertTrue(file.exists());
-
-      // Open the jar and load MANIFEST.MF
-      JarFile jar = new JarFile(file);
-      Manifest manifest = jar.getManifest();
-
       ActiveMQServer server = ActiveMQServers.newActiveMQServer(createBasicConfig());
-
       ConnectionMetaData meta = new ActiveMQConnectionMetaData(server.getVersion());
 
-      // Compare the value from ConnectionMetaData and MANIFEST.MF
-      Attributes attrs = manifest.getMainAttributes();
+      for (String jarFile : jarFiles) {
+         // The jar must be there
+         File file = new File(userDir, jarFile + meta.getProviderVersion() + ".jar");
+         Assert.assertTrue(file.exists());

Review comment:
       thanks for the input @gemmellr. That approach make sense and I will work on this and update the PR.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org