[jboss-cvs] JBoss Messaging SVN: r7884 - branches/Branch_1_4/integration/AS5/tests-src/org/jboss/test/messaging/tools/container.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 29 12:53:14 EDT 2009


Author: gaohoward
Date: 2009-10-29 12:53:14 -0400 (Thu, 29 Oct 2009)
New Revision: 7884

Modified:
   branches/Branch_1_4/integration/AS5/tests-src/org/jboss/test/messaging/tools/container/LocalTestServer.java
Log:
JBMESSAGING-1742


Modified: branches/Branch_1_4/integration/AS5/tests-src/org/jboss/test/messaging/tools/container/LocalTestServer.java
===================================================================
--- branches/Branch_1_4/integration/AS5/tests-src/org/jboss/test/messaging/tools/container/LocalTestServer.java	2009-10-29 11:15:21 UTC (rev 7883)
+++ branches/Branch_1_4/integration/AS5/tests-src/org/jboss/test/messaging/tools/container/LocalTestServer.java	2009-10-29 16:53:14 UTC (rev 7884)
@@ -738,7 +738,35 @@
       sc.invoke(deston, "create", new Object[0], new String[0]);
       sc.invoke(deston, "start", new Object[0], new String[0]);
    }
+   
+   public void deployDestination(boolean isQueue, String name, String jndiName, boolean clustered, boolean keepMessage) throws Exception
+   {
+      String config = "<mbean code=\"org.jboss.jms.server.destination." + (isQueue ? "QueueService" : "TopicService") +
+                      "\"" +
+                      "       name=\"jboss.messaging.destination:service=" +
+                      (isQueue ? "Queue" : "Topic") +
+                      ",name=" +
+                      name +
+                      "\"" +
+                      "       xmbean-dd=\"xmdesc/" +
+                      (isQueue ? "Queue" : "Topic") +
+                      "-xmbean.xml\">" +
+                      (jndiName != null ? "    <attribute name=\"JNDIName\">" + jndiName + "</attribute>" : "") +
+                      "       <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>" +
+                      "       <attribute name=\"Clustered\">" +
+                      String.valueOf(clustered) +
+                      "</attribute>" +
+                      "       <attribute name=\"DropOldMessageOnRedeploy\">" +
+                      String.valueOf(!keepMessage) +
+                      "</attribute>" +                      
+                      "</mbean>";
 
+      MBeanConfigurationElement mbean = new MBeanConfigurationElement(XMLUtil.stringToElement(config));
+      ObjectName deston = sc.registerAndConfigureService(mbean);
+      sc.invoke(deston, "create", new Object[0], new String[0]);
+      sc.invoke(deston, "start", new Object[0], new String[0]);
+   }
+   
    public void deployDestination(boolean isQueue,
                                  String name,
                                  String jndiName,
@@ -1113,6 +1141,17 @@
       return postOfficeObjectName;
    }
 
+   public void deployQueue(String name, String jndiName, boolean clustered, boolean keepMessage) throws Exception
+   {
+      deployDestination(true, name, jndiName, clustered, keepMessage);
+   }
+
+   public void deployTopic(String name, String jndiName, boolean clustered, boolean keepMessage) throws Exception
+   {
+      deployDestination(false, name, jndiName, clustered, keepMessage);
+      
+   }
+
    // Inner classes --------------------------------------------------------------------------------
 
 }




More information about the jboss-cvs-commits mailing list