activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1237035 - in /activemq/activemq-apollo/trunk: ./ apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/
Date Sat, 28 Jan 2012 10:28:38 GMT
Author: chirino
Date: Sat Jan 28 10:28:38 2012
New Revision: 1237035

URL: http://svn.apache.org/viewvc?rev=1237035&view=rev
Log:
Fixes APLO-136: Broker complains when a dot is used in a dsub name

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/DestinationParser.scala
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala
    activemq/activemq-apollo/trunk/pom.xml

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/DestinationParser.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/DestinationParser.scala?rev=1237035&r1=1237034&r2=1237035&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/DestinationParser.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/DestinationParser.scala
Sat Jan 28 10:28:38 2012
@@ -130,7 +130,7 @@ class DestinationParser extends PathPars
       var name = value.substring(topic_prefix.length)
       return new TopicDestinationDTO(parts(name))
     } else if (dsub_prefix != null && value.startsWith(dsub_prefix)) {
-      var name = value.substring(dsub_prefix.length)
+      var name = sanitize_destination_part(value.substring(dsub_prefix.length))
       return new DurableSubscriptionDestinationDTO(name).direct();
     } else if (temp_topic_prefix != null && value.startsWith(temp_topic_prefix))
{
       var name = value.substring(temp_topic_prefix.length)

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala?rev=1237035&r1=1237034&r2=1237035&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
Sat Jan 28 10:28:38 2012
@@ -1216,7 +1216,7 @@ class StompProtocolHandler extends Proto
       } }
 
       if( !topics.isEmpty ) {
-        val dsub = new DurableSubscriptionDestinationDTO(decode_header(id))
+        val dsub = new DurableSubscriptionDestinationDTO(destination_parser.sanitize_destination_part(decode_header(id)))
         dsub.selector = if (selector == null) null else selector._1
         topics.foreach( dsub.topics.add(_) )
         dsubs += dsub

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=1237035&r1=1237034&r2=1237035&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
Sat Jan 28 10:28:38 2012
@@ -887,6 +887,29 @@ class DurableSubscriptionOnLevelDBTest e
 
   override val broker_config_uri: String = "xml:classpath:apollo-stomp-leveldb.xml"
 
+
+  test("Can create dsubs with dots in them") {
+    connect("1.1")
+
+    client.write(
+      "SUBSCRIBE\n" +
+      "destination:/topic/sometopic\n" +
+      "id:sub.1\n" +
+      "persistent:true\n" +
+      "receipt:0\n" +
+      "\n")
+    wait_for_receipt("0")
+
+    client.write(
+      "SEND\n" +
+      "destination:/dsub/sub.1\n" +
+      "receipt:0\n" +
+      "\n" +
+      "content\n")
+    wait_for_receipt("0")
+
+  }
+
   test("Duplicate SUBSCRIBE updates durable subscription bindings") {
     connect("1.1")
 

Modified: activemq/activemq-apollo/trunk/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/pom.xml?rev=1237035&r1=1237034&r2=1237035&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/pom.xml (original)
+++ activemq/activemq-apollo/trunk/pom.xml Sat Jan 28 10:28:38 2012
@@ -464,6 +464,7 @@
 
   <profiles>
     
+    <!-- Integration tests.  Take a long time to run so, disabled by default -->
     <profile>
       <id>itests</id>
       <modules>



Mime
View raw message