tlbueno commented on a change in pull request #3929:
URL: https://github.com/apache/activemq-artemis/pull/3929#discussion_r824692227
##########
File path:
tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jms/ManifestTest.java
##########
@@ -14,53 +14,58 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.artemis.tests.unit.jms.misc;
+package org.apache.activemq.artemis.tests.smoke.jms;
import javax.jms.ConnectionMetaData;
import java.io.File;
-import java.util.Properties;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
import org.apache.activemq.artemis.core.server.ActiveMQServer;
import org.apache.activemq.artemis.core.server.ActiveMQServers;
+import org.apache.activemq.artemis.core.version.Version;
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionMetaData;
-import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.apache.activemq.artemis.tests.smoke.common.SmokeTestBase;
import org.jboss.logging.Logger;
import org.junit.Assert;
import org.junit.Test;
-public class ManifestTest extends ActiveMQTestBase {
+public class ManifestTest extends SmokeTestBase {
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();
-
- Assert.assertEquals(meta.getProviderVersion(),
attrs.getValue("ActiveMQ-Version"));
+ Version serverVersion = server.getVersion();
+ String serverFullVersion = serverVersion.getFullVersion();
+ ConnectionMetaData meta = new ActiveMQConnectionMetaData(serverVersion);
+
+ String distributionDir = basedir +
"/../../artemis-distribution/target/apache-artemis-" +
+ serverFullVersion + "-bin/apache-artemis-" + serverFullVersion;
Review comment:
@gemmellr I made few changes as you suggested. Moved it from integration
to smoke. Now there is no need for the build.lib paramerter but I didn't find a
way to get the artemis-distribution path. If I use the artemis-maven-plugin to
generate a server the generated server folder has a profile file that points to
the distrubution directory where I can look for the jars inside the lib
directory but I cannot find a way to retrieve this directory in the code. So,
for now as you can see it is partially hardcoded. Any suggestions to void this
hardcoded part?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]