diff options
| author | Darryl L. Pierce <mcpierce@apache.org> | 2013-02-04 14:48:15 +0000 |
|---|---|---|
| committer | Darryl L. Pierce <mcpierce@apache.org> | 2013-02-04 14:48:15 +0000 |
| commit | c07e2dc33dcf4cf71d5220f0c64cd5afca5e87b9 (patch) | |
| tree | 0df73bdf424276ca114a2162721f465b8dddd935 /cpp | |
| parent | 38ef7182917fbb93b1b1a5db2fa46b6d285dbff2 (diff) | |
| download | qpid-python-c07e2dc33dcf4cf71d5220f0c64cd5afca5e87b9.tar.gz | |
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.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1442141 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
10 files changed, 17 insertions, 34 deletions
diff --git a/cpp/bindings/qpid/ruby/ChangeLog b/cpp/bindings/qpid/ruby/ChangeLog new file mode 100644 index 0000000000..4c96f91026 --- /dev/null +++ b/cpp/bindings/qpid/ruby/ChangeLog @@ -0,0 +1,2 @@ +Verison 0.22: + * Changed Qpid::Messaging::Address to use a URI on creation. diff --git a/cpp/bindings/qpid/ruby/examples/client.rb b/cpp/bindings/qpid/ruby/examples/client.rb index be7e70722e..f400acfd13 100644 --- a/cpp/bindings/qpid/ruby/examples/client.rb +++ b/cpp/bindings/qpid/ruby/examples/client.rb @@ -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", diff --git a/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature b/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature index 1f758153af..9a2db1a08e 100644 --- a/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature +++ b/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature @@ -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 diff --git a/cpp/bindings/qpid/ruby/features/creating_a_sender.feature b/cpp/bindings/qpid/ruby/features/creating_a_sender.feature index 1c09ff837d..868d019e5d 100644 --- a/cpp/bindings/qpid/ruby/features/creating_a_sender.feature +++ b/cpp/bindings/qpid/ruby/features/creating_a_sender.feature @@ -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 diff --git a/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb b/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb index 0531e5ee69..19ac5f84d3 100644 --- a/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb +++ b/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb @@ -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 diff --git a/cpp/bindings/qpid/ruby/lib/qpid_messaging/address.rb b/cpp/bindings/qpid/ruby/lib/qpid_messaging/address.rb index fc4b313b22..7a4b0b08b6 100644 --- a/cpp/bindings/qpid/ruby/lib/qpid_messaging/address.rb +++ b/cpp/bindings/qpid/ruby/lib/qpid_messaging/address.rb @@ -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: diff --git a/cpp/bindings/qpid/ruby/lib/qpid_messaging/message.rb b/cpp/bindings/qpid/ruby/lib/qpid_messaging/message.rb index 5b724b5ef0..9e5425cdd2 100644 --- a/cpp/bindings/qpid/ruby/lib/qpid_messaging/message.rb +++ b/cpp/bindings/qpid/ruby/lib/qpid_messaging/message.rb @@ -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+. diff --git a/cpp/bindings/qpid/ruby/spec/qpid_messaging/address_spec.rb b/cpp/bindings/qpid/ruby/spec/qpid_messaging/address_spec.rb index 784fb6fe77..05c97ddf30 100644 --- a/cpp/bindings/qpid/ruby/spec/qpid_messaging/address_spec.rb +++ b/cpp/bindings/qpid/ruby/spec/qpid_messaging/address_spec.rb @@ -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/ diff --git a/cpp/bindings/qpid/ruby/spec/qpid_messaging/message_spec.rb b/cpp/bindings/qpid/ruby/spec/qpid_messaging/message_spec.rb index e34e58f563..17b92c13a5 100644 --- a/cpp/bindings/qpid/ruby/spec/qpid_messaging/message_spec.rb +++ b/cpp/bindings/qpid/ruby/spec/qpid_messaging/message_spec.rb @@ -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 diff --git a/cpp/bindings/qpid/ruby/spec/qpid_messaging/session_spec.rb b/cpp/bindings/qpid/ruby/spec/qpid_messaging/session_spec.rb index 0b103a31e6..754e2ca88f 100644 --- a/cpp/bindings/qpid/ruby/spec/qpid_messaging/session_spec.rb +++ b/cpp/bindings/qpid/ruby/spec/qpid_messaging/session_spec.rb @@ -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). |
