activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r424326 - /incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/Main.java
Date Fri, 21 Jul 2006 14:07:19 GMT
Author: jstrachan
Date: Fri Jul 21 07:07:18 2006
New Revision: 424326

URL: http://svn.apache.org/viewvc?rev=424326&view=rev
Log:
made the test case broker Main a little easier to run with a URI supplied on the command line

Modified:
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/Main.java

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/Main.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/Main.java?rev=424326&r1=424325&r2=424326&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/Main.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/Main.java
Fri Jul 21 07:07:18 2006
@@ -17,6 +17,7 @@
 package org.apache.activemq.test;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.broker.BrokerFactory;
 import org.apache.activemq.broker.BrokerPlugin;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.view.ConnectionDotFilePlugin;
@@ -28,6 +29,8 @@
 import javax.jms.MessageConsumer;
 import javax.jms.Session;
 
+import java.net.URI;
+
 /**
  * A helper class which can be handy for running a broker in your IDE from the
  * activemq-core module.
@@ -41,19 +44,20 @@
      */
     public static void main(String[] args) {
         String brokerURI = "broker:(tcp://localhost:61616,stomp://localhost:61613)?persistent=false&useJmx=true";
-        if (args.length > 0) {
-            brokerURI = args[0];
-        }
         try {
-            // TODO - this seems to break interceptors for some reason
-            // BrokerService broker = BrokerFactory.createBroker(new
-            // URI(brokerURI));
-            BrokerService broker = new BrokerService();
-            broker.setPersistent(false);
-            broker.setUseJmx(true);
-            broker.setPlugins(new BrokerPlugin[] { /*new DestinationDotFilePlugin(), */ new
ConnectionDotFilePlugin() });
-            broker.addConnector("tcp://localhost:61616");
-            broker.addConnector("stomp://localhost:61613");
+            BrokerService broker = null;
+            if (args.length > 0) {
+                brokerURI = args[0];
+                broker = BrokerFactory.createBroker(new URI(brokerURI));
+            }
+            else {
+                broker = new BrokerService();
+                broker.setPersistent(false);
+                broker.setUseJmx(true);
+                broker.setPlugins(new BrokerPlugin[] { new ConnectionDotFilePlugin() });
+                broker.addConnector("tcp://localhost:61616");
+                broker.addConnector("stomp://localhost:61613");
+            }
             broker.start();
 
             // lets create a dummy couple of consumers



Mime
View raw message