qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject [1/6] qpid-proton git commit: NO-JIRA: [ruby] container tests use method name as container-id
Date Wed, 06 Dec 2017 15:59:43 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master 594872e7f -> 7c004d3eb


NO-JIRA: [ruby] container tests use method name as container-id

Easier to read PN_TRACE_FRM=1 debug output


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/098f84d7
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/098f84d7
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/098f84d7

Branch: refs/heads/master
Commit: 098f84d75a98fe8a8c9b514c11a9f4201bdc0e41
Parents: 594872e
Author: Alan Conway <aconway@redhat.com>
Authored: Tue Dec 5 10:38:28 2017 -0500
Committer: Alan Conway <aconway@redhat.com>
Committed: Tue Dec 5 16:52:39 2017 -0500

----------------------------------------------------------------------
 proton-c/bindings/ruby/tests/test_container.rb | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/098f84d7/proton-c/bindings/ruby/tests/test_container.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/tests/test_container.rb b/proton-c/bindings/ruby/tests/test_container.rb
index 519ca65..be74be8 100644
--- a/proton-c/bindings/ruby/tests/test_container.rb
+++ b/proton-c/bindings/ruby/tests/test_container.rb
@@ -72,7 +72,7 @@ class ContainerTest < Minitest::Test
       end
     end.new
 
-    c = TestContainer.new(rh, {}, "test_simple")
+    c = TestContainer.new(rh, {}, __method__)
     c.connect(c.url, {:handler => sh}).open_sender({:name => "testlink"})
     c.run
 
@@ -93,7 +93,7 @@ class ContainerTest < Minitest::Test
       def on_connection_opened(e) @@opened += 1; super; end
     end
     hs = 3.times.collect { handler_class.new }
-    c = TestContainer.new(hs)
+    c = TestContainer.new(hs, {},  __method__)
     c.connect(c.url)
     c.run
     assert_equal 6, handler_class.opened # Opened at each end * 3 handlers
@@ -101,7 +101,7 @@ class ContainerTest < Minitest::Test
 
   def test_auto_stop_one
     # A listener and a connection
-    c = Container.new
+    c = Container.new(__method__)
     threads = 3.times.collect { Thread.new { c.run } }
     sleep(0.01) while c.running < 3
     l = c.listen_io(TCPServer.new(0), ListenOnceHandler.new({ :handler => CloseOnOpenHandler.new}))
@@ -112,7 +112,7 @@ class ContainerTest < Minitest::Test
 
   def test_auto_stop_two
     # Connect between different containers
-    c1, c2 = Container.new, Container.new
+    c1, c2 = Container.new("#{__method__}-1"), Container.new("#{__method__}-2")
     threads = [ Thread.new {c1.run }, Thread.new {c2.run } ]
     l = c1.listen_io(TCPServer.new(0), ListenOnceHandler.new({ :handler => CloseOnOpenHandler.new}))
     c2.connect("amqp://:#{l.to_io.addr[1]}", { :handler => CloseOnOpenHandler.new} )
@@ -122,7 +122,7 @@ class ContainerTest < Minitest::Test
   end
 
   def test_auto_stop_listener_only
-    c = Container.new
+    c = Container.new(__method__)
     # Listener only, external close
     t = Thread.new { c.run }
     l = c.listen_io(TCPServer.new(0))
@@ -131,7 +131,7 @@ class ContainerTest < Minitest::Test
   end
 
   def test_stop_empty
-    c = Container.new
+    c = Container.new(__method__)
     threads = 3.times.collect { Thread.new { c.run } }
     sleep(0.01) while c.running < 3
     assert_nil threads[0].join(0.001) # Not stopped
@@ -143,7 +143,7 @@ class ContainerTest < Minitest::Test
   end
 
   def test_stop
-    c = Container.new
+    c = Container.new(__method__)
     c.auto_stop = false
 
     l = c.listen_io(TCPServer.new(0))
@@ -233,7 +233,7 @@ mech_list: EXTERNAL DIGEST-MD5 SCRAM-SHA-1 CRAM-MD5 PLAIN ANONYMOUS
 
   def test_sasl_anonymous()
     s = SASLHandler.new("amqp://",  {:sasl_allowed_mechs => "ANONYMOUS"})
-    TestContainer.new(s, {:sasl_allowed_mechs => "ANONYMOUS"}).run
+    TestContainer.new(s, {:sasl_allowed_mechs => "ANONYMOUS"}, __method__).run
     assert_nil(s.connections[0].user)
   end
 
@@ -253,7 +253,7 @@ mech_list: EXTERNAL DIGEST-MD5 SCRAM-SHA-1 CRAM-MD5 PLAIN ANONYMOUS
     opts = {:sasl_allowed_mechs => "PLAIN",:sasl_allow_insecure_mechs => true,
             :user => 'user', :password => 'default_password' }
     s = SASLHandler.new("amqp://", opts)
-    TestContainer.new(s, {:sasl_allowed_mechs => "PLAIN",:sasl_allow_insecure_mechs =>
true}).run
+    TestContainer.new(s, {:sasl_allowed_mechs => "PLAIN",:sasl_allow_insecure_mechs =>
true}, __method__).run
     assert_equal(2, s.connections.size)
     assert_equal("user", s.auth_user)
   end
@@ -262,7 +262,7 @@ mech_list: EXTERNAL DIGEST-MD5 SCRAM-SHA-1 CRAM-MD5 PLAIN ANONYMOUS
   def test_disallow_insecure()
     # Don't set allow_insecure_mechs, but try to use PLAIN
     s = SASLHandler.new("amqp://user:password@", {:sasl_allowed_mechs => "PLAIN", :sasl_allow_insecure_mechs
=> true})
-    e = assert_raises(TestError) { TestContainer.new(s, {:sasl_allowed_mechs => "PLAIN"}).run
}
+    e = assert_raises(TestError) { TestContainer.new(s, {:sasl_allowed_mechs => "PLAIN"},
__method__).run }
     assert_match(/amqp:unauthorized-access.*Authentication failed/, e.to_s)
   end
 end


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


Mime
View raw message