Sha256: aa0a66dbcc835204efc0d8b954ddf93fa14da7c7efd835b99e5d74037bbfbaf7
Contents?: true
Size: 1.74 KB
Versions: 1
Compression:
Stored size: 1.74 KB
Contents
require 'al-test-utils' class TestConnection < Test::Unit::TestCase include AlTestUtils::Config include AlTestUtils::MockLogger def setup super end def teardown ActiveLdap::Base.clear_active_connections! super end priority :must priority :normal def test_bind_format_check connector = Class.new(ActiveLdap::Base) assert(!connector.connected?) exception = nil assert_raises(ArgumentError) do begin connector.establish_connection(:bind_format => "uid=%s,dc=test", :allow_anonymous => false) connector.connection.connect rescue Exception exception = $! raise end end assert_equal("Unknown key(s): bind_format", exception.message) end def test_can_reconnect? assert(!ActiveLdap::Base.connected?) config = current_configuration.merge("retry_limit" => 10) ActiveLdap::Base.establish_connection(config) connection = ActiveLdap::Base.connection assert(!connection.send(:can_reconnect?, :reconnect_attempts => 10)) config = current_configuration.merge("retry_limit" => 10) ActiveLdap::Base.establish_connection(config) connection = ActiveLdap::Base.connection assert(!connection.send(:can_reconnect?, :reconnect_attempts => 9)) config = current_configuration.merge("retry_limit" => 10) ActiveLdap::Base.establish_connection(config) connection = ActiveLdap::Base.connection assert(connection.send(:can_reconnect?, :reconnect_attempts => 8)) config = current_configuration.merge("retry_limit" => -1) ActiveLdap::Base.establish_connection(config) connection = ActiveLdap::Base.connection assert(connection.send(:can_reconnect?, :reconnect_attempts => -10)) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
activeldap-0.9.0 | test/test_connection.rb |