qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcpie...@apache.org
Subject svn commit: r1442141 - in /qpid/trunk/qpid/cpp/bindings/qpid/ruby: ./ examples/ features/ features/step_definitions/ lib/qpid_messaging/ spec/qpid_messaging/
Date Mon, 04 Feb 2013 14:48:15 GMT
Author: mcpierce
Date: Mon Feb  4 14:48:15 2013
New Revision: 1442141

URL: http://svn.apache.org/viewvc?rev=1442141&view=rev
Log:
QPID-4563: Changed the Address constructor to take a URI.

Previously it took the components of an address. Now it takes a single
string URI for the address.

Updated all cucumber and rspec tests to reflect these changes. Also
fixed up the example apps.

Added:
    qpid/trunk/qpid/cpp/bindings/qpid/ruby/ChangeLog
Modified:
    qpid/trunk/qpid/cpp/bindings/qpid/ruby/examples/client.rb
    qpid/trunk/qpid/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature
    qpid/trunk/qpid/cpp/bindings/qpid/ruby/features/creating_a_sender.feature
    qpid/trunk/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb
    qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/address.rb
    qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/message.rb
    qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/address_spec.rb
    qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/message_spec.rb
    qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/session_spec.rb

Added: qpid/trunk/qpid/cpp/bindings/qpid/ruby/ChangeLog
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/ruby/ChangeLog?rev=1442141&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/ruby/ChangeLog (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/ruby/ChangeLog Mon Feb  4 14:48:15 2013
@@ -0,0 +1,2 @@
+Verison 0.22:
+	* Changed Qpid::Messaging::Address to use a URI on creation.

Modified: qpid/trunk/qpid/cpp/bindings/qpid/ruby/examples/client.rb
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/ruby/examples/client.rb?rev=1442141&r1=1442140&r2=1442141&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/ruby/examples/client.rb (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/ruby/examples/client.rb Mon Feb  4 14:48:15 2013
@@ -29,9 +29,7 @@ if __FILE__ == $0
   connection.open
   session = connection.create_session
   sender = session.create_sender "service_queue"
-  response_queue = Qpid::Messaging::Address.new("#response-queue", "",
-                                                :create => :always,
-                                                :delete => :always)
+  response_queue = Qpid::Messaging::Address.new("#response-queue;{create:always}")
   receiver = session.create_receiver response_queue
 
   ["Twas brillig, and the slithy toves",

Modified: qpid/trunk/qpid/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature?rev=1442141&r1=1442140&r2=1442141&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature Mon Feb  4
14:48:15 2013
@@ -25,5 +25,5 @@ Feature: Creating a receiver
 
   Scenario: Using an Address object
     Given an open session
-    And an Address with the name "create-receiver-test" and subject "foo" and option "create"
set to "always" and "delete" set to "always"
+    And an Address with the uri "create-receiver-test;{create:always}"
     Then creating a receiver with an Address succeeds

Modified: qpid/trunk/qpid/cpp/bindings/qpid/ruby/features/creating_a_sender.feature
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/ruby/features/creating_a_sender.feature?rev=1442141&r1=1442140&r2=1442141&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/ruby/features/creating_a_sender.feature (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/ruby/features/creating_a_sender.feature Mon Feb  4 14:48:15
2013
@@ -21,5 +21,5 @@ Feature: Creating a sender
 
   Scenario: Using an Address object
     Given an open session
-    And an Address with the name "my-queue" and subject "my-subject" and option "create"
set to "always"
+    And an Address with the uri "my-queue/my-subject;{create:always}"
     Then creating a sender with an Address succeeds

Modified: qpid/trunk/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb?rev=1442141&r1=1442140&r2=1442141&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb Mon
Feb  4 14:48:15 2013
@@ -17,15 +17,6 @@
 # under the License.
 #
 
-Given /^an Address with the name "([^"]*)" and subject "([^"]*)" and option "([^"]*)" set
to "([^"]*)"$/ do |name, subject, key, value|
-  options = Hash.new
-  options["#{key}"] = "#{value}"
-  @address = Qpid::Messaging::Address.new "#{name}", "#{subject}", options
-end
-
-Given /^an Address with the name "([^"]*)" and subject "([^"]*)" and option "([^"]*)" set
to "([^"]*)" and "([^"]*)" set to "([^"]*)"$/ do |name, subject, key1, value1, key2, value2|
-  options = Hash.new
-  options["#{key1}"] = "#{value1}"
-  options["#{key2}"] = "#{value2}"
-  @address = Qpid::Messaging::Address.new "#{name}", "#{subject}", options
+Given /^an Address with the uri "(.*?)"$/ do |address|
+  @address = Qpid::Messaging::Address.new "#{address}"
 end

Modified: qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/address.rb
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/address.rb?rev=1442141&r1=1442140&r2=1442141&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/address.rb (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/address.rb Mon Feb  4 14:48:15
2013
@@ -70,26 +70,18 @@ module Qpid
     #
     class Address
 
-      # Creates a new +Address+ object.
+      # Creates a new +Address+ object from an address URI.
       #
       # ==== Options
       #
-      # * name - The name for the +Address+.
-      # * subject - The subject for the +Address+
-      # * :create - See the class documentation.
-      # * :assert - See the class documentation.
-      # * :delete - See the class documentation.
-      # * :node   - See the class documentation.
-      # * :link   - See the class documentation.
-      # * :mode   - See the class documentation.
+      # * uri - the address URI
       #
       # ==== Examples
       #
-      #   addr = Qpid::Messaging::Address.new "my-queue"
-      #   addr = Qpid::Messaging::Address.new "my-queue", "testing", :create => :always
+      #   addr = Qpid::Messaging::Address.new "my-queue;{create:always}"
       #
-      def initialize(name, subject, options = {}, _type = "", address_impl = nil)
-        @address_impl = address_impl || Cqpid::Address.new(name, subject, convert_options(options),
_type)
+      def initialize(uri, address_impl = nil)
+        @address_impl = address_impl || Cqpid::Address.new(uri)
       end
 
       def address_impl # :nodoc:

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=1442141&r1=1442140&r2=1442141&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 14:48:15
2013
@@ -71,7 +71,7 @@ module Qpid
       def reply_to
         address_impl = @message_impl.getReplyTo
         # only return an address if a reply to was specified
-        Qpid::Messaging::Address.new(nil, nil, nil, nil, address_impl) if address_impl
+        Qpid::Messaging::Address.new(nil, address_impl) if address_impl
       end
 
       # Sets the subject for the +Message+.

Modified: qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/address_spec.rb
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/address_spec.rb?rev=1442141&r1=1442140&r2=1442141&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/address_spec.rb (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/address_spec.rb Mon Feb  4
14:48:15 2013
@@ -26,7 +26,7 @@ module Qpid
     describe Address do
 
       before(:each) do
-        @address = Qpid::Messaging::Address.new "my-name", "my-subject", :create => :always
+        @address = Qpid::Messaging::Address.new "my-name/my-subject;{create:always}"
       end
 
       it "stores the name, subject and options when created" do
@@ -72,7 +72,7 @@ module Qpid
       end
 
       it "can return a string representation" do
-        address = Qpid::Messaging::Address.new "foo", "bar", :create => :always, :link
=> :durable
+        address = Qpid::Messaging::Address.new "foo/bar:{create:always,link:durable}"
         result = address.to_s
 
         result.should =~ /foo\/bar/

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=1442141&r1=1442140&r2=1442141&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
14:48:15 2013
@@ -36,7 +36,7 @@ module Qpid
       end
 
       it "can set the reply to address" do
-        address = Qpid::Messaging::Address.new "my-queue", ""
+        address = Qpid::Messaging::Address.new "my-queue;{create:always}"
 
         @message.reply_to = address
 

Modified: qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/session_spec.rb
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/session_spec.rb?rev=1442141&r1=1442140&r2=1442141&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/session_spec.rb (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/session_spec.rb Mon Feb  4
14:48:15 2013
@@ -46,7 +46,7 @@ module Qpid
       end
 
       it "creates a Sender from an Address" do
-        address = Qpid::Messaging::Address.new "my-queu", "", :create => :always
+        address = Qpid::Messaging::Address.new "my-queue;{create:always}"
 
         @session_impl.should_receive(:createSender).
           with(address.address_impl).



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


Mime
View raw message