activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1366566 - in /activemq/activemq-apollo/trunk: apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/ apollo-broker/src/test/scala/ apollo-scala/ apollo-stomp/src...
Date Fri, 27 Jul 2012 22:57:32 GMT
Author: chirino
Date: Fri Jul 27 22:57:32 2012
New Revision: 1366566

URL: http://svn.apache.org/viewvc?rev=1366566&view=rev
Log:
Fixing problems with starting multiple brokers with on different data dirs, had to be able
to inject different config properties to each.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/BrokerFunSuiteSupport.scala
    activemq/activemq-apollo/trunk/apollo-scala/pom.xml
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala
    activemq/activemq-apollo/trunk/apollo-util/src/test/scala/org/apache/activemq/apollo/util/FunSuiteSupport.scala

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala?rev=1366566&r1=1366565&r2=1366566&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
Fri Jul 27 22:57:32 2012
@@ -34,12 +34,12 @@ import org.apache.activemq.apollo.dto._
 import javax.management.ObjectName
 import org.fusesource.hawtdispatch.TaskTracker._
 import java.util.concurrent.TimeUnit._
-import security.SecuredResource.BrokerKind
 import reflect.BeanProperty
 import java.net.InetSocketAddress
 import org.fusesource.hawtdispatch.util.BufferPools
 import org.apache.activemq.apollo.filter.{Filterable, XPathExpression, XalanXPathEvaluator}
 import org.xml.sax.InputSource
+import java.util
 
 /**
  * <p>
@@ -49,7 +49,7 @@ import org.xml.sax.InputSource
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
 trait BrokerFactoryTrait {
-  def createBroker(brokerURI:String):Broker
+  def createBroker(brokerURI:String, props:util.Properties): Broker
 }
 
 /**
@@ -63,12 +63,13 @@ object BrokerFactory {
 
   val finder = new ClassFinder[BrokerFactoryTrait]("META-INF/services/org.apache.activemq.apollo/broker-factory.index",classOf[BrokerFactoryTrait])
 
-  def createBroker(uri:String):Broker = {
+  def createBroker(brokerURI:String):Broker = createBroker(brokerURI, System.getProperties)
+  def createBroker(uri:String, props:util.Properties):Broker = {
     if( uri == null ) {
       return null
     }
     finder.singletons.foreach { provider=>
-      val broker = provider.createBroker(uri)
+      val broker = provider.createBroker(uri, props)
       if( broker!=null ) {
         return broker;
       }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala?rev=1366566&r1=1366565&r2=1366566&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala
Fri Jul 27 22:57:32 2012
@@ -24,10 +24,11 @@ import org.apache.activemq.apollo.dto._
 import java.lang.String
 import XmlCodec._
 import org.apache.activemq.apollo.util._
+import java.util.Properties
 
 class XmlBrokerFactory extends BrokerFactoryTrait {
 
-  def createBroker(value: String): Broker = {
+  def createBroker(value:String, props:Properties): Broker = {
     try {
       var brokerURI = new URI(value)
 
@@ -47,7 +48,7 @@ class XmlBrokerFactory extends BrokerFac
       }
 
       val broker = new Broker()
-      broker.config = decode(classOf[BrokerDTO], configURL, System.getProperties)
+      broker.config = decode(classOf[BrokerDTO], configURL, props)
       return broker;
 
     } catch {

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/BrokerFunSuiteSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/BrokerFunSuiteSupport.scala?rev=1366566&r1=1366565&r2=1366566&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/BrokerFunSuiteSupport.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/BrokerFunSuiteSupport.scala
Fri Jul 27 22:57:32 2012
@@ -25,6 +25,7 @@ import org.apache.activemq.apollo.dto.{A
 import collection.immutable.HashMap
 import java.io.File
 import org.scalatest.{ParallelTestExecution, OneInstancePerTest}
+import java.util
 
 object BrokerTestSupport {
   import FutureResult._
@@ -136,7 +137,12 @@ class BrokerFunSuiteSupport extends FunS
   var port = 0
 
   def broker_config_uri = "xml:classpath:apollo.xml"
-  def createBroker = BrokerFactory.createBroker(broker_config_uri)
+
+  def createBroker = {
+    val props = new java.util.Properties(System.getProperties)
+    props.setProperty("testdatadir", test_data_dir.getCanonicalPath)
+    BrokerFactory.createBroker(broker_config_uri, props)
+  }
 
   override def beforeAll() = {
     super.beforeAll()

Modified: activemq/activemq-apollo/trunk/apollo-scala/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-scala/pom.xml?rev=1366566&r1=1366565&r2=1366566&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-scala/pom.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-scala/pom.xml Fri Jul 27 22:57:32 2012
@@ -86,7 +86,7 @@
               <goal>${scala-plugin-main-goal}</goal>
             </goals>
             <configuration>
-              <displayCmd>true</displayCmd>
+              <!-- <displayCmd>true</displayCmd> -->
               <testSourceDir>dontcompile</testSourceDir>
               <useFsc>true</useFsc>
               <once>true</once>
@@ -109,7 +109,7 @@
               <goal>${scala-plugin-test-goal}</goal>
             </goals>
             <configuration>
-              <displayCmd>true</displayCmd>
+              <!-- <displayCmd>true</displayCmd> -->
               <mainSourceDir>dontcompile</mainSourceDir>
               <useFsc>true</useFsc>
               <once>true</once>

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala?rev=1366566&r1=1366565&r2=1366566&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala
Fri Jul 27 22:57:32 2012
@@ -182,8 +182,8 @@ class StompTestSupport extends BrokerFun
 
 /**
  * These test cases check to make sure the broker stats are consistent with what
- * would be expected.  These tests can't be run in parallell since they look at
- * agreggate destination metrics.
+ * would be expected.  These tests can't be run in parallel since they look at
+ * aggregate destination metrics.
  */
 class StompMetricsTest extends StompTestSupport {
 

Modified: activemq/activemq-apollo/trunk/apollo-util/src/test/scala/org/apache/activemq/apollo/util/FunSuiteSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/test/scala/org/apache/activemq/apollo/util/FunSuiteSupport.scala?rev=1366566&r1=1366565&r2=1366566&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/test/scala/org/apache/activemq/apollo/util/FunSuiteSupport.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/test/scala/org/apache/activemq/apollo/util/FunSuiteSupport.scala
Fri Jul 27 22:57:32 2012
@@ -95,7 +95,6 @@ abstract class FunSuiteSupport extends F
         System.getProperty("basedir", _basedir)
     }
     System.setProperty("basedir", _basedir)
-    System.setProperty("testdatadir", test_data_dir.getCanonicalPath)
     test_data_dir.recursive_delete
     super.beforeAll(map)
   }



Mime
View raw message