summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/test/Ice/timeout/AllTests.cpp14
-rw-r--r--csharp/test/Ice/timeout/AllTests.cs14
-rw-r--r--java-compat/test/src/main/java/test/Ice/timeout/AllTests.java14
-rw-r--r--java/test/src/main/java/test/Ice/timeout/AllTests.java14
-rw-r--r--js/test/Ice/timeout/Client.js31
-rw-r--r--php/test/Ice/timeout/Client.php12
-rw-r--r--python/test/Ice/timeout/AllTests.py14
-rw-r--r--ruby/test/Ice/timeout/AllTests.rb10
8 files changed, 69 insertions, 54 deletions
diff --git a/cpp/test/Ice/timeout/AllTests.cpp b/cpp/test/Ice/timeout/AllTests.cpp
index e88ec8a2bcc..fc54b3ae59d 100644
--- a/cpp/test/Ice/timeout/AllTests.cpp
+++ b/cpp/test/Ice/timeout/AllTests.cpp
@@ -320,7 +320,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
cout << "testing close timeout... " << flush;
{
- TimeoutPrxPtr to = ICE_CHECKED_CAST(TimeoutPrx, obj->ice_timeout(250));
+ TimeoutPrxPtr to = ICE_UNCHECKED_CAST(TimeoutPrx, obj->ice_timeout(250));
Ice::ConnectionPtr connection = connect(to);
timeout->holdAdapter(600);
connection->close(Ice::ICE_SCOPED_ENUM(ConnectionClose, GracefullyWithWait));
@@ -355,11 +355,11 @@ allTests(const Ice::CommunicatorPtr& communicator)
//
Ice::InitializationData initData;
initData.properties = communicator->getProperties()->clone();
- initData.properties->setProperty("Ice.Override.Timeout", "250");
+ initData.properties->setProperty("Ice.Override.Timeout", "100");
Ice::CommunicatorHolder ich(initData);
- TimeoutPrxPtr to = ICE_CHECKED_CAST(TimeoutPrx, ich->stringToProxy(sref));
+ TimeoutPrxPtr to = ICE_UNCHECKED_CAST(TimeoutPrx, ich->stringToProxy(sref));
connect(to);
- timeout->holdAdapter(700);
+ timeout->holdAdapter(500);
try
{
to->sendData(seq);
@@ -374,7 +374,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
// Calling ice_timeout() should have no effect.
//
timeout->op(); // Ensure adapter is active.
- to = ICE_CHECKED_CAST(TimeoutPrx, to->ice_timeout(1000));
+ to = ICE_UNCHECKED_CAST(TimeoutPrx, to->ice_timeout(1000));
connect(to);
timeout->holdAdapter(500);
try
@@ -425,9 +425,9 @@ allTests(const Ice::CommunicatorPtr& communicator)
// Verify that timeout set via ice_timeout() is still used for requests.
//
timeout->op(); // Ensure adapter is active.
- to = ICE_UNCHECKED_CAST(TimeoutPrx, to->ice_timeout(250));
+ to = ICE_UNCHECKED_CAST(TimeoutPrx, to->ice_timeout(100));
connect(to);
- timeout->holdAdapter(750);
+ timeout->holdAdapter(500);
try
{
to->sendData(seq);
diff --git a/csharp/test/Ice/timeout/AllTests.cs b/csharp/test/Ice/timeout/AllTests.cs
index 29287339cb6..dd739abb307 100644
--- a/csharp/test/Ice/timeout/AllTests.cs
+++ b/csharp/test/Ice/timeout/AllTests.cs
@@ -262,7 +262,7 @@ public class AllTests : TestCommon.AllTests
Write("testing close timeout... ");
Flush();
{
- Test.TimeoutPrx to = Test.TimeoutPrxHelper.checkedCast(obj.ice_timeout(250));
+ Test.TimeoutPrx to = Test.TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(250));
Ice.Connection connection = connect(to);
timeout.holdAdapter(600);
connection.close(Ice.ConnectionClose.GracefullyWithWait);
@@ -299,11 +299,11 @@ public class AllTests : TestCommon.AllTests
string[] args = new string[0];
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = communicator.getProperties().ice_clone_();
- initData.properties.setProperty("Ice.Override.Timeout", "250");
+ initData.properties.setProperty("Ice.Override.Timeout", "100");
Ice.Communicator comm = Ice.Util.initialize(ref args, initData);
- Test.TimeoutPrx to = Test.TimeoutPrxHelper.checkedCast(comm.stringToProxy(sref));
+ Test.TimeoutPrx to = Test.TimeoutPrxHelper.uncheckedCast(comm.stringToProxy(sref));
connect(to);
- timeout.holdAdapter(700);
+ timeout.holdAdapter(500);
try
{
to.sendData(seq);
@@ -317,7 +317,7 @@ public class AllTests : TestCommon.AllTests
// Calling ice_timeout() should have no effect.
//
timeout.op(); // Ensure adapter is active.
- to = Test.TimeoutPrxHelper.checkedCast(to.ice_timeout(1000));
+ to = Test.TimeoutPrxHelper.uncheckedCast(to.ice_timeout(1000));
connect(to);
timeout.holdAdapter(500);
try
@@ -370,9 +370,9 @@ public class AllTests : TestCommon.AllTests
// Verify that timeout set via ice_timeout() is still used for requests.
//
timeout.op(); // Ensure adapter is active.
- to = Test.TimeoutPrxHelper.uncheckedCast(to.ice_timeout(250));
+ to = Test.TimeoutPrxHelper.uncheckedCast(to.ice_timeout(100));
connect(to);
- timeout.holdAdapter(750);
+ timeout.holdAdapter(500);
try
{
to.sendData(seq);
diff --git a/java-compat/test/src/main/java/test/Ice/timeout/AllTests.java b/java-compat/test/src/main/java/test/Ice/timeout/AllTests.java
index d60279ed271..932ea9b2f0d 100644
--- a/java-compat/test/src/main/java/test/Ice/timeout/AllTests.java
+++ b/java-compat/test/src/main/java/test/Ice/timeout/AllTests.java
@@ -344,7 +344,7 @@ public class AllTests
out.print("testing close timeout... ");
out.flush();
{
- TimeoutPrx to = TimeoutPrxHelper.checkedCast(obj.ice_timeout(250 * mult));
+ TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(250 * mult));
Ice.Connection connection = connect(to);
timeout.holdAdapter(600);
connection.close(Ice.ConnectionClose.GracefullyWithWait);
@@ -386,11 +386,11 @@ public class AllTests
//
Ice.InitializationData initData = app.createInitializationData();
initData.properties = communicator.getProperties()._clone();
- initData.properties.setProperty("Ice.Override.Timeout", "250");
+ initData.properties.setProperty("Ice.Override.Timeout", "100");
Ice.Communicator comm = app.initialize(initData);
- TimeoutPrx to = TimeoutPrxHelper.checkedCast(comm.stringToProxy(sref));
+ TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(comm.stringToProxy(sref));
connect(to);
- timeout.holdAdapter(700 * mult);
+ timeout.holdAdapter(500 * mult);
try
{
to.sendData(seq);
@@ -404,7 +404,7 @@ public class AllTests
// Calling ice_timeout() should have no effect.
//
timeout.op(); // Ensure adapter is active.
- to = TimeoutPrxHelper.checkedCast(to.ice_timeout(1000 * mult));
+ to = TimeoutPrxHelper.uncheckedCast(to.ice_timeout(1000 * mult));
connect(to);
timeout.holdAdapter(500 * mult);
try
@@ -464,9 +464,9 @@ public class AllTests
// Verify that timeout set via ice_timeout() is still used for requests.
//
timeout.op(); // Ensure adapter is active.
- to = TimeoutPrxHelper.uncheckedCast(to.ice_timeout(250));
+ to = TimeoutPrxHelper.uncheckedCast(to.ice_timeout(100));
connect(to);
- timeout.holdAdapter(750 * mult);
+ timeout.holdAdapter(500 * mult);
try
{
to.sendData(seq);
diff --git a/java/test/src/main/java/test/Ice/timeout/AllTests.java b/java/test/src/main/java/test/Ice/timeout/AllTests.java
index 732838fab90..b8b52064577 100644
--- a/java/test/src/main/java/test/Ice/timeout/AllTests.java
+++ b/java/test/src/main/java/test/Ice/timeout/AllTests.java
@@ -276,7 +276,7 @@ public class AllTests
out.print("testing close timeout... ");
out.flush();
{
- TimeoutPrx to = TimeoutPrx.checkedCast(obj.ice_timeout(250 * mult));
+ TimeoutPrx to = TimeoutPrx.uncheckedCast(obj.ice_timeout(250 * mult));
com.zeroc.Ice.Connection connection = connect(to);
timeout.holdAdapter(600);
connection.close(com.zeroc.Ice.ConnectionClose.GracefullyWithWait);
@@ -318,11 +318,11 @@ public class AllTests
//
com.zeroc.Ice.InitializationData initData = app.createInitializationData();
initData.properties = communicator.getProperties()._clone();
- initData.properties.setProperty("Ice.Override.Timeout", "250");
+ initData.properties.setProperty("Ice.Override.Timeout", "100");
com.zeroc.Ice.Communicator comm = app.initialize(initData);
- TimeoutPrx to = TimeoutPrx.checkedCast(comm.stringToProxy(sref));
+ TimeoutPrx to = TimeoutPrx.uncheckedCast(comm.stringToProxy(sref));
connect(to);
- timeout.holdAdapter(700 * mult);
+ timeout.holdAdapter(500 * mult);
try
{
to.sendData(seq);
@@ -336,7 +336,7 @@ public class AllTests
// Calling ice_timeout() should have no effect.
//
timeout.op(); // Ensure adapter is active.
- to = TimeoutPrx.checkedCast(to.ice_timeout(1000 * mult));
+ to = TimeoutPrx.uncheckedCast(to.ice_timeout(1000 * mult));
connect(to);
timeout.holdAdapter(500 * mult);
try
@@ -396,9 +396,9 @@ public class AllTests
// Verify that timeout set via ice_timeout() is still used for requests.
//
timeout.op(); // Ensure adapter is active.
- to = to.ice_timeout(250);
+ to = to.ice_timeout(100);
connect(to);
- timeout.holdAdapter(750 * mult);
+ timeout.holdAdapter(500 * mult);
try
{
to.sendData(seq);
diff --git a/js/test/Ice/timeout/Client.js b/js/test/Ice/timeout/Client.js
index 5e938ad5c6a..7f06427aa9f 100644
--- a/js/test/Ice/timeout/Client.js
+++ b/js/test/Ice/timeout/Client.js
@@ -17,6 +17,18 @@
var Ice = require("ice").Ice;
var Test = require("Test").Test;
+ var connect = function(prx)
+ {
+ var nRetry = 5;
+ var next = function next() {
+ if(--nRetry > 0) {
+ return prx.ice_getConnection().then(c => c, ex => next());
+ }
+ return null;
+ };
+ return next();
+ }
+
var allTests = function(out, communicator)
{
var failCB = function() { test(false); };
@@ -139,7 +151,7 @@
out.writeLine("ok");
out.write("testing close timeout... ");
to = Test.TimeoutPrx.uncheckedCast(obj.ice_timeout(500));
- return to.ice_getConnection();
+ return connect(to);
}
).then(con =>
{
@@ -190,11 +202,11 @@
initData.properties.setProperty("Ice.Override.Timeout", "2000");
}
comm = Ice.initialize(initData);
- return Test.TimeoutPrx.checkedCast(comm.stringToProxy(ref));
+ to = Test.TimeoutPrx.uncheckedCast(comm.stringToProxy(ref));
+ return connect(to);
}
- ).then(obj =>
+ ).then(c =>
{
- to = obj;
return timeout.holdAdapter(750 * 2 * mult);
}
).then(() => to.sendData(seq) // Expect TimeoutException.
@@ -205,10 +217,13 @@
test(ex instanceof Ice.TimeoutException);
return timeout.op(); // Ensure adapter is active.
}
- ).then(() => Test.TimeoutPrx.checkedCast(to.ice_timeout(1000 * mult)) // Calling ice_timeout() should have no effect.
- ).then(obj =>
+ ).then(() =>
+ {
+ to = Test.TimeoutPrx.uncheckedCast(to.ice_timeout(1000 * mult)) // Calling ice_timeout() should have no effect.
+ return connect(to);
+ }
+ ).then(c =>
{
- to = obj;
return timeout.holdAdapter(750 * 2 * mult);
}
).then(() => to.sendData(seq) // Expect TimeoutException.
@@ -264,7 +279,7 @@
).then(() =>
{
to = Test.TimeoutPrx.uncheckedCast(to.ice_timeout(100 * mult));
- return to.ice_getConnection(); // Force connection.
+ return connect(to); // Force connection.
}
).then(obj => timeout.holdAdapter(750 * mult)
).then(() => to.sendData(seq)
diff --git a/php/test/Ice/timeout/Client.php b/php/test/Ice/timeout/Client.php
index df2e15f9c81..bccb9c51f29 100644
--- a/php/test/Ice/timeout/Client.php
+++ b/php/test/Ice/timeout/Client.php
@@ -266,11 +266,11 @@ function allTests($communicator)
//
$initData = eval($NS ? "return new Ice\\InitializationData();" : "return new Ice_InitializationData();");
$initData->properties = $communicator->getProperties()->clone();
- $initData->properties->setProperty("Ice.Override.Timeout", "150");
+ $initData->properties->setProperty("Ice.Override.Timeout", "100");
$comm = eval($NS ? "return Ice\\initialize(\$initData);" : "return Ice_initialize(\$initData);");
- $to = $comm->stringToProxy($sref)->ice_checkedCast("::Test::Timeout");
+ $to = $comm->stringToProxy($sref)->ice_uncheckedCast("::Test::Timeout");
connect($to);
- $timeout->holdAdapter(800);
+ $timeout->holdAdapter(500);
try
{
$to->sendData($seq);
@@ -289,7 +289,7 @@ function allTests($communicator)
// Calling ice_timeout() should have no effect.
//
$timeout->op(); // Ensure adapter is active.
- $to = $to->ice_timeout(1000)->ice_checkedCast("::Test::Timeout");
+ $to = $to->ice_timeout(1000)->ice_uncheckedCast("::Test::Timeout");
connect($to);
$timeout->holdAdapter(800);
try
@@ -357,9 +357,9 @@ function allTests($communicator)
// Verify that timeout set via ice_timeout() is still used for requests.
//
$timeout->op(); // Ensure adapter is active.
- $to = $to->ice_timeout(250)->ice_uncheckedCast("::Test::Timeout");
+ $to = $to->ice_timeout(100)->ice_uncheckedCast("::Test::Timeout");
connect($to);
- $timeout->holdAdapter(750);
+ $timeout->holdAdapter(500);
try
{
$to->sendData($seq);
diff --git a/python/test/Ice/timeout/AllTests.py b/python/test/Ice/timeout/AllTests.py
index a706cc33cca..986fb129380 100644
--- a/python/test/Ice/timeout/AllTests.py
+++ b/python/test/Ice/timeout/AllTests.py
@@ -168,7 +168,7 @@ def allTests(communicator):
sys.stdout.write("testing close timeout... ")
sys.stdout.flush()
- to = Test.TimeoutPrx.checkedCast(obj.ice_timeout(250))
+ to = Test.TimeoutPrx.uncheckedCast(obj.ice_timeout(250))
connection = connect(to)
timeout.holdAdapter(600)
connection.close(Ice.ConnectionClose.GracefullyWithWait)
@@ -195,11 +195,11 @@ def allTests(communicator):
#
initData = Ice.InitializationData()
initData.properties = communicator.getProperties().clone()
- initData.properties.setProperty("Ice.Override.Timeout", "250")
+ initData.properties.setProperty("Ice.Override.Timeout", "100")
comm = Ice.initialize(initData)
- to = Test.TimeoutPrx.checkedCast(comm.stringToProxy(sref))
+ to = Test.TimeoutPrx.uncheckedCast(comm.stringToProxy(sref))
connect(to)
- timeout.holdAdapter(700)
+ timeout.holdAdapter(500)
try:
to.sendData(seq)
test(False)
@@ -209,7 +209,7 @@ def allTests(communicator):
# Calling ice_timeout() should have no effect.
#
timeout.op() # Ensure adapter is active.
- to = Test.TimeoutPrx.checkedCast(to.ice_timeout(1000))
+ to = Test.TimeoutPrx.uncheckedCast(to.ice_timeout(1000))
connect(to)
timeout.holdAdapter(500)
try:
@@ -247,9 +247,9 @@ def allTests(communicator):
# Verify that timeout set via ice_timeout() is still used for requests.
#
timeout.op() # Ensure adapter is active.
- to = Test.TimeoutPrx.uncheckedCast(to.ice_timeout(250))
+ to = Test.TimeoutPrx.uncheckedCast(to.ice_timeout(100))
connect(to)
- timeout.holdAdapter(750)
+ timeout.holdAdapter(500)
try:
to.sendData(seq)
test(False)
diff --git a/ruby/test/Ice/timeout/AllTests.rb b/ruby/test/Ice/timeout/AllTests.rb
index 746191bf588..423e9ed284f 100644
--- a/ruby/test/Ice/timeout/AllTests.rb
+++ b/ruby/test/Ice/timeout/AllTests.rb
@@ -109,7 +109,7 @@ def allTests(communicator)
print "testing close timeout... "
STDOUT.flush
- to = Test::TimeoutPrx.checkedCast(obj.ice_timeout(250))
+ to = Test::TimeoutPrx.uncheckedCast(obj.ice_timeout(250))
connection = connect(to);
timeout.holdAdapter(600)
connection.close(Ice::ConnectionClose::GracefullyWithWait)
@@ -139,7 +139,7 @@ def allTests(communicator)
initData.properties = communicator.getProperties().clone()
initData.properties.setProperty("Ice.Override.Timeout", "100")
comm = Ice.initialize(initData)
- to = Test::TimeoutPrx::checkedCast(comm.stringToProxy(sref))
+ to = Test::TimeoutPrx::uncheckedCast(comm.stringToProxy(sref))
connect(to)
timeout.holdAdapter(500)
begin
@@ -152,7 +152,7 @@ def allTests(communicator)
# Calling ice_timeout() should have no effect.
#
timeout.op() # Ensure adapter is active.
- to = Test::TimeoutPrx::checkedCast(to.ice_timeout(1000))
+ to = Test::TimeoutPrx::uncheckedCast(to.ice_timeout(1000))
connect(to)
timeout.holdAdapter(500)
begin
@@ -196,9 +196,9 @@ def allTests(communicator)
# Verify that timeout set via ice_timeout() is still used for requests.
#
timeout.op() # Ensure adapter is active.
- to = Test::TimeoutPrx::uncheckedCast(to.ice_timeout(250))
+ to = Test::TimeoutPrx::uncheckedCast(to.ice_timeout(100))
connect(to)
- timeout.holdAdapter(750)
+ timeout.holdAdapter(500)
begin
to.sendData(seq)
test(false)