ARTEMIS-2066 LegacyJMSConfiguration parser may deploy non-jms queues
This commit is contained in:
parent
f80e87768b
commit
e7e5112d51
|
@ -17,9 +17,6 @@
|
|||
package org.apache.activemq.artemis.core.config.impl;
|
||||
|
||||
import javax.management.MBeanServer;
|
||||
import javax.xml.XMLConstants;
|
||||
import javax.xml.validation.Schema;
|
||||
import javax.xml.validation.SchemaFactory;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
|
@ -110,9 +107,11 @@ public class LegacyJMSConfiguration implements Deployable {
|
|||
String xml = XMLUtil.readerToString(reader);
|
||||
xml = XMLUtil.replaceSystemProps(xml);
|
||||
Element e = XMLUtil.stringToElement(xml);
|
||||
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
|
||||
Schema schema = schemaFactory.newSchema(XMLUtil.findResource(CONFIGURATION_SCHEMA_URL));
|
||||
parseConfiguration(e);
|
||||
// only parse elements from <jms>
|
||||
NodeList children = e.getElementsByTagName(CONFIGURATION_SCHEMA_ROOT_ELEMENT);
|
||||
if (children.getLength() > 0) {
|
||||
parseConfiguration(children.item(0));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -260,6 +260,9 @@ public class RedeployTest extends ActiveMQTestBase {
|
|||
Assert.assertTrue(listQueuesNamesForAddress(embeddedActiveMQ, "config_test_queue_change").contains("config_test_queue_change_queue"));
|
||||
Assert.assertEquals(1, getQueue(embeddedActiveMQ, "config_test_queue_change_queue").getMaxConsumers());
|
||||
Assert.assertEquals(true, getQueue(embeddedActiveMQ, "config_test_queue_change_queue").isPurgeOnNoConsumers());
|
||||
|
||||
Assert.assertNull(getAddressInfo(embeddedActiveMQ, "config_test_queue_change_queue"));
|
||||
Assert.assertNull(getAddressInfo(embeddedActiveMQ, "config_test_queue_removal_queue_1"));
|
||||
} finally {
|
||||
embeddedActiveMQ.stop();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue