summaryrefslogtreecommitdiff
path: root/ruby/test/Ice/timeout/Client.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ruby/test/Ice/timeout/Client.rb')
-rwxr-xr-xruby/test/Ice/timeout/Client.rb81
1 files changed, 28 insertions, 53 deletions
diff --git a/ruby/test/Ice/timeout/Client.rb b/ruby/test/Ice/timeout/Client.rb
index 49138a2d850..cdff6a10ca3 100755
--- a/ruby/test/Ice/timeout/Client.rb
+++ b/ruby/test/Ice/timeout/Client.rb
@@ -8,61 +8,36 @@
#
# **********************************************************************
-require 'pathname'
require 'Ice'
-slice_dir = Ice.getSliceDir
-if slice_dir.empty?
- fail "Slice directory not found"
-end
-
-Ice::loadSlice("'-I" + slice_dir + "' Test.ice")
+Ice::loadSlice("'-I#{Ice.getSliceDir()}' Test.ice")
require './AllTests'
-def test(b)
- if !b
- raise RuntimeError, 'test assertion failed'
+class Client < ::TestHelper
+ def run(args)
+ #
+ # In this test, we need at least two threads in the
+ # client side thread pool for nested AMI.
+ #
+ properties = self.createTestProperties(args:args)
+
+ #
+ # For this test, we want to disable retries.
+ #
+ properties.setProperty('Ice.RetryIntervals', '-1')
+
+ #
+ # This test kills connections, so we don't want warnings.
+ #
+ properties.setProperty('Ice.Warn.Connections', '0')
+
+ #
+ # Limit the send buffer size, this test relies on the socket
+ # send() blocking after sending a given amount of data.
+ #
+ properties.setProperty("Ice.TCP.SndSize", "50000");
+
+ self.init(properties:properties) do |communicator|
+ allTests(self, communicator)
+ end
end
end
-
-def run(args, communicator)
- allTests(communicator)
- return true
-end
-
-begin
- #
- # In this test, we need at least two threads in the
- # client side thread pool for nested AMI.
- #
- initData = Ice::InitializationData.new
- initData.properties = Ice.createProperties(ARGV)
-
- #
- # For this test, we want to disable retries.
- #
- initData.properties.setProperty('Ice.RetryIntervals', '-1')
-
- #
- # This test kills connections, so we don't want warnings.
- #
- initData.properties.setProperty('Ice.Warn.Connections', '0')
-
- #
- # Limit the send buffer size, this test relies on the socket
- # send() blocking after sending a given amount of data.
- #
- initData.properties.setProperty("Ice.TCP.SndSize", "50000");
-
- communicator = Ice.initialize(ARGV, initData)
- status = run(ARGV, communicator)
-rescue => ex
- puts $!
- print ex.backtrace.join("\n")
- status = false
-end
-
-if communicator
- communicator.destroy()
-end
-
-exit(status ? 0 : 1)