Author: mcpierce
Date: Mon Apr 21 18:41:51 2014
New Revision: 1588960

URL: http://svn.apache.org/r1588960
Log:
PROTON-531: Expose the passive mode in Ruby bindings.

Added the mutator methods to Messenger. Updated the Rspec tests to
verify the changes.

Modified:
    qpid/proton/trunk/proton-c/bindings/ruby/lib/qpid_proton/messenger.rb
    qpid/proton/trunk/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb

Modified: qpid/proton/trunk/proton-c/bindings/ruby/lib/qpid_proton/messenger.rb
URL: 
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/ruby/lib/qpid_proton/messenger.rb?rev=1588960&r1=1588959&r2=1588960&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/ruby/lib/qpid_proton/messenger.rb 
(original)
+++ qpid/proton/trunk/proton-c/bindings/ruby/lib/qpid_proton/messenger.rb Mon 
Apr 21 18:41:51 2014
@@ -136,6 +136,17 @@ module Qpid
         Cproton.pn_messenger_set_blocking(@impl, blocking)
       end
 
+      # Returns true if passive mode is enabled.
+      #
+      def passive?
+        Cproton.pn_messenger_is_passive(@impl)
+      end
+
+      # Turns passive mode on or off.
+      def passive=(mode)
+        Cproton.pn_messenger_set_passive(@impl, mode)
+      end
+
       # Reports whether an error occurred.
       #
       def error?

Modified: 
qpid/proton/trunk/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb
URL: 
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb?rev=1588960&r1=1588959&r2=1588960&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb 
(original)
+++ qpid/proton/trunk/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb 
Mon Apr 21 18:41:51 2014
@@ -212,6 +212,16 @@ module Qpid
         @messenger.incoming_window.should eq(window)
       end
 
+      it "can be put into passive mode" do
+        @messenger.passive = true
+        @messenger.passive?.should be_true
+      end
+
+      it "can be taken out of passive mode" do
+        @messenger.passive = false
+        @messenger.passive?.should_not be_true
+      end
+
       describe "once started" do
 
         before (:each) do



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to