You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by mc...@apache.org on 2013/02/04 16:25:16 UTC

svn commit: r1442149 - in /qpid/trunk/qpid/cpp/bindings/qpid/ruby: ChangeLog lib/qpid_messaging/message.rb spec/qpid_messaging/message_spec.rb

Author: mcpierce
Date: Mon Feb  4 15:25:16 2013
New Revision: 1442149

URL: http://svn.apache.org/viewvc?rev=1442149&view=rev
Log:
QPID-4562: Changed Message.reply_to to accept a address string.

Previously it would accept only an instance of Qpid::Messaging::Address,
but now will create an instance from a string if necessary.

Modified:
    qpid/trunk/qpid/cpp/bindings/qpid/ruby/ChangeLog
    qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/message.rb
    qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/message_spec.rb

Modified: qpid/trunk/qpid/cpp/bindings/qpid/ruby/ChangeLog
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/ruby/ChangeLog?rev=1442149&r1=1442148&r2=1442149&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/ruby/ChangeLog (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/ruby/ChangeLog Mon Feb  4 15:25:16 2013
@@ -1,2 +1,3 @@
 Verison 0.22:
 	* Changed Qpid::Messaging::Address to use a URI on creation.
+	* Changed Qpid::Messaging::Message to allow a URI for reply_to.

Modified: qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/message.rb
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/message.rb?rev=1442149&r1=1442148&r2=1442149&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/message.rb (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/message.rb Mon Feb  4 15:25:16 2013
@@ -51,18 +51,18 @@ module Qpid
 
       # Sets the address to which replies should be sent for the +Message+.
       #
-      # *NOTE:* The address must be an instance of Address.
-      #
       # ==== Options
       #
-      # * address - an instance of +Address+
+      # * address - an instance of +Address+, or an address URI
       #
       # ==== Examples
       #
       #   msg.reply_to = Qpid:Messaging::Address.new "my-responses"
+      #   msg.reply_to = "my-feed/responses"
       #
       def reply_to=(address)
-        raise ArgumentError, "Agument must be an Address" unless address.is_a? Qpid::Messaging::Address
+        address = Qpid::Messaging::Address.new "#{address}" if !address.is_a? Qpid::Messaging::Address
+
         @message_impl.setReplyTo address.address_impl
       end
 

Modified: qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/message_spec.rb
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/message_spec.rb?rev=1442149&r1=1442148&r2=1442149&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/message_spec.rb (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/message_spec.rb Mon Feb  4 15:25:16 2013
@@ -45,6 +45,19 @@ module Qpid
         reply_to.name.should == address.name
       end
 
+      it "can set the reply to from an address string" do
+        name = "my-queue"
+        subject = "responses"
+        address = "#{name}/#{subject}"
+
+        @message.reply_to = address
+
+        reply_to = @message.reply_to
+
+        reply_to.name.should == name
+        reply_to.subject.should == subject
+      end
+
       it "should store the content when created" do
         content = @message.content
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org