use of org.apache.activemq.artemis.jms.client.ActiveMQConnectionMetaData in project activemq-artemis by apache.
the class ManifestTest method testManifestEntries.
// Constants -----------------------------------------------------
// Static --------------------------------------------------------
// Attributes ----------------------------------------------------
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
@Test
public void testManifestEntries() throws Exception {
Properties props = System.getProperties();
String userDir = props.getProperty("build.lib");
UnitTestLogger.LOGGER.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"));
}
Aggregations