activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1236492 - in /activemq/activemq-apollo/trunk/apollo-openwire/src: main/scala/org/apache/activemq/apollo/openwire/ test/resources/
Date Fri, 27 Jan 2012 02:12:35 GMT
Author: chirino
Date: Fri Jan 27 02:12:35 2012
New Revision: 1236492

URL: http://svn.apache.org/viewvc?rev=1236492&view=rev
Log:
Fixes the last failing openwire test.

Modified:
    activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/DestinationAdvisoryRouterListener.scala
    activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/DestinationConverter.scala
    activemq/activemq-apollo/trunk/apollo-openwire/src/test/resources/apollo-openwire.xml
    activemq/activemq-apollo/trunk/apollo-openwire/src/test/resources/log4j.properties

Modified: activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/DestinationAdvisoryRouterListener.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/DestinationAdvisoryRouterListener.scala?rev=1236492&r1=1236491&r2=1236492&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/DestinationAdvisoryRouterListener.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/DestinationAdvisoryRouterListener.scala
Fri Jan 27 02:12:35 2012
@@ -80,7 +80,7 @@ class DestinationAdvisoryRouterListener(
 
   def on_create(dest: DomainDestination, security: SecurityContext) = {
     val ow_destination = to_activemq_destination(Array(dest.destination_dto))
-    if (!AdvisorySupport.isAdvisoryTopic(ow_destination)) {
+    if (ow_destination!=null && !AdvisorySupport.isAdvisoryTopic(ow_destination))
{
       destination_advisories.getOrElseUpdate(ow_destination, {
         var info = new DestinationInfo(null, DestinationInfo.ADD_OPERATION_TYPE, ow_destination)
         val topic = AdvisorySupport.getDestinationAdvisoryTopic(ow_destination);
@@ -93,7 +93,7 @@ class DestinationAdvisoryRouterListener(
 
   def on_destroy(dest: DomainDestination, security: SecurityContext) = {
     val destination = to_activemq_destination(Array(dest.destination_dto))
-    if (!AdvisorySupport.isAdvisoryTopic(destination)) {
+    if (destination!=null && !AdvisorySupport.isAdvisoryTopic(destination)) {
       for (info <- destination_advisories.remove(destination)) {
         var info = new DestinationInfo(null, DestinationInfo.REMOVE_OPERATION_TYPE, destination)
         val topic = AdvisorySupport.getDestinationAdvisoryTopic(destination);
@@ -104,7 +104,7 @@ class DestinationAdvisoryRouterListener(
 
   def on_bind(dest: DomainDestination, consumer: DeliveryConsumer, security: SecurityContext)
= {
     val destination = to_activemq_destination(Array(dest.destination_dto))
-    if (AdvisorySupport.isDestinationAdvisoryTopic(destination) && !destination_advisories.isEmpty)
{
+    if (destination!=null && AdvisorySupport.isDestinationAdvisoryTopic(destination)
&& !destination_advisories.isEmpty) {
       // replay the destination advisories..
       val producer = new ProducerRoute {
         override def on_connected = {

Modified: activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/DestinationConverter.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/DestinationConverter.scala?rev=1236492&r1=1236491&r2=1236492&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/DestinationConverter.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/DestinationConverter.scala
Fri Jan 27 02:12:35 2012
@@ -66,28 +66,31 @@ object DestinationConverter {
   def to_activemq_destination(dest:Array[DestinationDTO]):ActiveMQDestination = {
     import collection.JavaConversions._
 
-    val rc = dest.map { dest =>
+    val rc = dest.flatMap { dest =>
 
       val temp = dest.path.headOption == Some("temp")
       dest match {
         case dest:QueueDestinationDTO =>
           if( temp ) {
-            new ActiveMQTempQueue(dest.path.toList.drop(2).map(OPENWIRE_PARSER.unsanitize_destination_part(_)).mkString(":"))
+            Some(new ActiveMQTempQueue(dest.path.toList.drop(2).map(OPENWIRE_PARSER.unsanitize_destination_part(_)).mkString(":")))
           } else {
             val name = OPENWIRE_PARSER.encode_path(asScalaBuffer(dest.path).toList.map(OPENWIRE_PARSER.unsanitize_destination_part(_)))
-            new ActiveMQQueue(name)
+            Some(new ActiveMQQueue(name))
           }
         case dest:TopicDestinationDTO =>
           if( temp ) {
-            new ActiveMQTempTopic(dest.path.toList.drop(2).map(OPENWIRE_PARSER.unsanitize_destination_part(_)).mkString(":"))
+            Some(new ActiveMQTempTopic(dest.path.toList.drop(2).map(OPENWIRE_PARSER.unsanitize_destination_part(_)).mkString(":")))
           } else {
             val name = OPENWIRE_PARSER.encode_path(asScalaBuffer(dest.path).toList.map(OPENWIRE_PARSER.unsanitize_destination_part(_)))
-            new ActiveMQTopic(name)
+            Some(new ActiveMQTopic(name))
           }
+        case _ => None 
       }
     }
 
-    if( rc.length == 1) {
+    if( rc.length == 0) {
+      null
+    } else if( rc.length == 1) {
       rc(0)
     } else {
       val c = new ActiveMQQueue()

Modified: activemq/activemq-apollo/trunk/apollo-openwire/src/test/resources/apollo-openwire.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/test/resources/apollo-openwire.xml?rev=1236492&r1=1236491&r2=1236492&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/test/resources/apollo-openwire.xml
(original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/test/resources/apollo-openwire.xml
Fri Jan 27 02:12:35 2012
@@ -24,5 +24,6 @@
     </virtual_host>
 
     <connector id="tcp" protocol="openwire" bind="tcp://0.0.0.0:0"/>
+    <!--<web_admin bind="http://127.0.0.1:61680"/>-->
 
 </broker>
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-openwire/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/test/resources/log4j.properties?rev=1236492&r1=1236491&r2=1236492&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/test/resources/log4j.properties (original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/test/resources/log4j.properties Fri
Jan 27 02:12:35 2012
@@ -24,11 +24,11 @@ log4j.rootLogger=WARN, console, logfile
 #
 # Uncomment one of the following to enable debug logging
 #
-log4j.logger.org.apache.activemq.apollo=TRACE
-log4j.logger.org.apache.activemq.apollo.openwire=TRACE
-log4j.logger.org.apache.activemq.apollo.broker=TRACE
-log4j.logger.org.apache.activemq.apollo.web=TRACE
-log4j.logger.org.apache.activemq.apollo.cli=TRACE
+#log4j.logger.org.apache.activemq.apollo=TRACE
+#log4j.logger.org.apache.activemq.apollo.openwire=TRACE
+#log4j.logger.org.apache.activemq.apollo.broker=TRACE
+#log4j.logger.org.apache.activemq.apollo.web=TRACE
+#log4j.logger.org.apache.activemq.apollo.cli=TRACE
 
 # Console Settings
 log4j.appender.console=org.apache.log4j.ConsoleAppender



Mime
View raw message