summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/timeout/Client.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2006-04-04 17:33:58 +0000
committerMark Spruiell <mes@zeroc.com>2006-04-04 17:33:58 +0000
commit0bb6b4702a02941fcad8a19dfc4ee9bbc68829c3 (patch)
tree377b4e55c5f3b21e6749c246b4dd043a85b6cb52 /cpp/test/Ice/timeout/Client.cpp
parentfixing timeout bug (diff)
downloadice-0bb6b4702a02941fcad8a19dfc4ee9bbc68829c3.tar.bz2
ice-0bb6b4702a02941fcad8a19dfc4ee9bbc68829c3.tar.xz
ice-0bb6b4702a02941fcad8a19dfc4ee9bbc68829c3.zip
adding timeout test
Diffstat (limited to 'cpp/test/Ice/timeout/Client.cpp')
-rw-r--r--cpp/test/Ice/timeout/Client.cpp73
1 files changed, 73 insertions, 0 deletions
diff --git a/cpp/test/Ice/timeout/Client.cpp b/cpp/test/Ice/timeout/Client.cpp
new file mode 100644
index 00000000000..2b48c6a8573
--- /dev/null
+++ b/cpp/test/Ice/timeout/Client.cpp
@@ -0,0 +1,73 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <TestCommon.h>
+#include <Test.h>
+
+using namespace std;
+using namespace Test;
+
+int
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
+{
+ TimeoutPrx allTests(const Ice::CommunicatorPtr&);
+ TimeoutPrx timeout = allTests(communicator);
+ timeout->shutdown();
+ return EXIT_SUCCESS;
+}
+
+int
+main(int argc, char* argv[])
+{
+ int status;
+ Ice::CommunicatorPtr communicator;
+
+ try
+ {
+ Ice::PropertiesPtr properties = Ice::getDefaultProperties(argc, argv);
+
+ //
+ // 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");
+
+ //
+ // Check for AMI timeouts every second.
+ //
+ properties->setProperty("Ice.MonitorConnections", "1");
+
+ communicator = Ice::initialize(argc, argv);
+ status = run(argc, argv, communicator);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ status = EXIT_FAILURE;
+ }
+
+ if(communicator)
+ {
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
+ }
+
+ return status;
+}