[jboss-cvs] JBoss Messaging SVN: r6585 - in trunk: tests/src/org/jboss/messaging/tests/integration/jms/server and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Apr 27 13:52:43 EDT 2009
Author: timfox
Date: 2009-04-27 13:52:43 -0400 (Mon, 27 Apr 2009)
New Revision: 6585
Modified:
trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerDeployer.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/JMSServerDeployerTest.java
Log:
https://jira.jboss.org/jira/browse/JBMESSAGING-1530
Modified: trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerDeployer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerDeployer.java 2009-04-27 17:39:25 UTC (rev 6584)
+++ trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerDeployer.java 2009-04-27 17:52:43 UTC (rev 6585)
@@ -23,7 +23,6 @@
import org.jboss.messaging.core.deployers.impl.XmlDeployer;
import org.jboss.messaging.core.logging.Logger;
import org.jboss.messaging.jms.server.JMSServerManager;
-import org.jboss.messaging.jms.server.management.JMSServerControlMBean;
import org.jboss.messaging.utils.Pair;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -147,6 +146,8 @@
*/
private void createAndBindObject(final Node node) throws Exception
{
+ log.info("** deploying node " + node.getNodeName());
+
if (node.getNodeName().equals(CONNECTION_FACTORY_NODE_NAME))
{
log.info("Got connecti0on factory node");
@@ -399,8 +400,9 @@
}
}
else if (node.getNodeName().equals(QUEUE_NODE_NAME))
- {
+ {
String queueName = node.getAttributes().getNamedItem(getKeyAttribute()).getNodeValue();
+ log.info("got queue " + queueName);
NodeList children = node.getChildNodes();
for (int i = 0; i < children.getLength(); i++)
{
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/JMSServerDeployerTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/JMSServerDeployerTest.java 2009-04-27 17:39:25 UTC (rev 6584)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/JMSServerDeployerTest.java 2009-04-27 17:52:43 UTC (rev 6585)
@@ -33,6 +33,7 @@
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
import org.jboss.messaging.core.deployers.DeploymentManager;
import org.jboss.messaging.core.deployers.impl.FileDeploymentManager;
+import org.jboss.messaging.core.logging.Logger;
import org.jboss.messaging.core.server.MessagingServer;
import org.jboss.messaging.integration.transports.netty.NettyConnectorFactory;
import org.jboss.messaging.jms.client.JBossConnectionFactory;
@@ -52,9 +53,10 @@
*/
public class JMSServerDeployerTest extends ServiceTestBase
{
-
// Constants -----------------------------------------------------
+ private static final Logger log = Logger.getLogger(JMSServerDeployerTest.class);
+
// Attributes ----------------------------------------------------
// Static --------------------------------------------------------
@@ -81,6 +83,76 @@
deployer.validate(rootNode);
}
+ public void testDeployUnusualQueueNames() throws Exception
+ {
+ doTestDeployQueuesWithUnusualNames("queue.with.dots.in.name", "/myqueue");
+
+ doTestDeployQueuesWithUnusualNames("queue with spaces in name", "/myqueue2");
+
+ doTestDeployQueuesWithUnusualNames("queue/with/slashes/in/name", "/myqueue3");
+
+ doTestDeployQueuesWithUnusualNames("queue\\with\\backslashes\\in\\name", "/myqueue4");
+
+ doTestDeployQueuesWithUnusualNames("queue with # chars and * chars in name", "queue with # chars and * chars in name", "/myqueue5");
+ }
+
+ public void testDeployUnusualTopicNames() throws Exception
+ {
+ doTestDeployTopicsWithUnusualNames("topic.with.dots.in.name", "/mytopic");
+
+ doTestDeployTopicsWithUnusualNames("topic with spaces in name", "/mytopic2");
+
+ doTestDeployTopicsWithUnusualNames("topic/with/slashes/in/name", "/mytopic3");
+
+ doTestDeployTopicsWithUnusualNames("topic\\with\\backslashes\\in\\name", "/mytopic4");
+
+ doTestDeployTopicsWithUnusualNames("topic with # chars and * chars in name", "topic with # chars and * chars in name", "/mytopic5");
+ }
+
+ private void doTestDeployQueuesWithUnusualNames(final String queueName, String htmlEncodedName, final String jndiName) throws Exception
+ {
+ JMSServerDeployer deployer = new JMSServerDeployer(jmsServer, deploymentManager, config);
+
+ String xml =
+
+ "<queue name=\"" + htmlEncodedName + "\">" + "<entry name=\"" + jndiName + "\"/>" + "</queue>";
+
+ Element rootNode = org.jboss.messaging.utils.XMLUtil.stringToElement(xml);
+
+ deployer.deploy(rootNode);
+
+ Queue queue = (Queue)context.lookup(jndiName);
+ assertNotNull(queue);
+ assertEquals(queueName, queue.getQueueName());
+ }
+
+ private void doTestDeployTopicsWithUnusualNames(final String topicName, String htmlEncodedName, final String jndiName) throws Exception
+ {
+ JMSServerDeployer deployer = new JMSServerDeployer(jmsServer, deploymentManager, config);
+
+ String xml =
+
+ "<topic name=\"" + htmlEncodedName + "\">" + "<entry name=\"" + jndiName + "\"/>" + "</topic>";
+
+ Element rootNode = org.jboss.messaging.utils.XMLUtil.stringToElement(xml);
+
+ deployer.deploy(rootNode);
+
+ Topic topic = (Topic)context.lookup(jndiName);
+ assertNotNull(topic);
+ assertEquals(topicName, topic.getTopicName());
+ }
+
+ private void doTestDeployQueuesWithUnusualNames(final String queueName, final String jndiName) throws Exception
+ {
+ doTestDeployQueuesWithUnusualNames(queueName, queueName, jndiName);
+ }
+
+ private void doTestDeployTopicsWithUnusualNames(final String topicName, final String jndiName) throws Exception
+ {
+ doTestDeployTopicsWithUnusualNames(topicName, topicName, jndiName);
+ }
+
public void testDeployFullConfiguration() throws Exception
{
JMSServerDeployer deployer = new JMSServerDeployer(jmsServer, deploymentManager, config);
@@ -94,7 +166,7 @@
"java:/connectionfactories/acme/fullConfigurationConnectionFactory" };
String[] queueBindings = new String[] { "/fullConfigurationQueue", "/queue/fullConfigurationQueue" };
String[] topicBindings = new String[] { "/fullConfigurationTopic", "/topic/fullConfigurationTopic" };
-
+
for (String binding : connectionFactoryBindings)
{
checkNoBinding(context, binding);
@@ -154,7 +226,7 @@
{
Queue queue = (Queue)context.lookup(binding);
assertNotNull(queue);
- assertEquals("fullConfigurationQueue", queue.getQueueName());
+ assertEquals("fullConfigurationQueue", queue.getQueueName());
}
for (String binding : topicBindings)
More information about the jboss-cvs-commits
mailing list