diff options
| author | Ted Ross <tross@apache.org> | 2012-05-25 19:24:21 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2012-05-25 19:24:21 +0000 |
| commit | a5f7e4f4832bb024ffb3146fbbd1464d27158bf9 (patch) | |
| tree | d52e905d91d13e9f896ca8e6c9aba587526ebfc8 /qpid | |
| parent | a2db316615b2ea92eb5ec00e3a1ef3887d097996 (diff) | |
| download | qpid-python-a5f7e4f4832bb024ffb3146fbbd1464d27158bf9.tar.gz | |
QPID-3995 - Cleans up queues created during Cucumber feature tests
Applied patch from Darryl Pierce
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1342786 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid')
6 files changed, 29 insertions, 12 deletions
diff --git a/qpid/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature b/qpid/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature index f509f49115..1f758153af 100644 --- a/qpid/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature +++ b/qpid/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature @@ -21,9 +21,9 @@ Feature: Creating a receiver Scenario: The address string is fine Given an open session - Then creating a receiver with "my-queue;{create:always}" succeeds + Then creating a receiver with "my-queue;{create:always,delete:always}" succeeds 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 an Address with the name "create-receiver-test" and subject "foo" and option "create" set to "always" and "delete" set to "always" Then creating a receiver with an Address succeeds diff --git a/qpid/cpp/bindings/qpid/ruby/features/creating_a_sender.feature b/qpid/cpp/bindings/qpid/ruby/features/creating_a_sender.feature index ac75543c2d..1c09ff837d 100644 --- a/qpid/cpp/bindings/qpid/ruby/features/creating_a_sender.feature +++ b/qpid/cpp/bindings/qpid/ruby/features/creating_a_sender.feature @@ -5,11 +5,11 @@ Feature: Creating a sender Scenario: The session is closed Given a closed session - Then creating a sender with "my-queue;{create:always}" raises an exception + Then creating a sender with "my-queue;{create:always,delete:always}" raises an exception Scenario: The connection is closed Given an open session with a closed connection - Then creating a sender with "my-queue;{create:always}" raises an exception + Then creating a sender with "my-queue;{create:always,delete:always}" raises an exception Scenario: The address is malformed Given an open session @@ -17,7 +17,7 @@ Feature: Creating a sender Scenario: The address string is valid Given an open session - Then creating a sender with "my-queue;{create:always}" succeeds + Then creating a sender with "my-queue;{create:always,delete:always}" succeeds Scenario: Using an Address object Given an open session diff --git a/qpid/cpp/bindings/qpid/ruby/features/receiving_a_message.feature b/qpid/cpp/bindings/qpid/ruby/features/receiving_a_message.feature index b68a78c337..7b6db4a5ac 100644 --- a/qpid/cpp/bindings/qpid/ruby/features/receiving_a_message.feature +++ b/qpid/cpp/bindings/qpid/ruby/features/receiving_a_message.feature @@ -4,24 +4,26 @@ Feature: Receving a message I need to be able to receive messages Scenario: Receiving after the session is closed - Given a sender and receiver for "my-queue;{create:always}" + Given a sender and receiver for "my-queue;{create:always,delete:always}" And the message "this is a test" is sent And the session is closed Then getting the next message raises an error Scenario: Receiving after the connection is closed - Given a sender and receiver for "my-queue;{create:always}" + Given a sender and receiver for "my-queue;{create:always,delete:always}" And the message "this is a test" is sent And the connection is closed Then getting the next message raises an error Scenario: No message is received on an empty queue - Given an existing receiver for "my-queue;{create:always}" + Given an existing receiver for "my-queue;{create:always,delete:always}" And the receiver has no pending messages Then getting the next message raises an error Scenario: A message is pending - Given a sender and receiver for "my-queue;{create:always}" + Given an open session + And given a sender for "my-queue;{create:always}" + And given a receiver for "my-queue;{create:always,delete:always}" And the receiver has a capacity of 1 And the message "this is a test" is sent Then the receiver should have 1 message available diff --git a/qpid/cpp/bindings/qpid/ruby/features/sending_a_message.feature b/qpid/cpp/bindings/qpid/ruby/features/sending_a_message.feature index b1127d3664..45cbd42f06 100644 --- a/qpid/cpp/bindings/qpid/ruby/features/sending_a_message.feature +++ b/qpid/cpp/bindings/qpid/ruby/features/sending_a_message.feature @@ -5,17 +5,17 @@ Feature: Sending a message Scenario: The session is closed Given an open session - And creating a sender with "my-queue;{create:always}" succeeds + And creating a sender with "my-queue;{create:always,delete:always}" succeeds And the session is closed Then sending the message "This is a test" should raise an error Scenario: The connection is closed Given an open session - And creating a sender with "my-queue;{create:always}" succeeds + And creating a sender with "my-queue;{create:always,delete:always}" succeeds And the connection is closed Then sending the message "This is a test" should raise an error Scenario: The message sends successfully Given an open session - And creating a sender with "my-queue;{create:always}" succeeds + And creating a sender with "my-queue;{create:always,delete:always}" succeeds Then sending the message "This is a test" succeeds
\ No newline at end of file diff --git a/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb b/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb index 845cc2b116..0531e5ee69 100644 --- a/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb +++ b/qpid/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb @@ -22,3 +22,10 @@ Given /^an Address with the name "([^"]*)" and subject "([^"]*)" and option "([^ 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 +end diff --git a/qpid/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb b/qpid/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb index a8c8aa4a43..e454dac345 100644 --- a/qpid/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb +++ b/qpid/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb @@ -59,3 +59,11 @@ Then /^the receiver should have (\d+) message available$/ do |available| sleep 1 @receiver.available.should == available.to_i end + +Given /^given a sender for "([^"]*)"$/ do |address| + @sender = @session.create_sender "#{address}" +end + +Given /^given a receiver for "([^"]*)"$/ do |address| + @receiver = @session.create_receiver "#{address}" +end |
