summaryrefslogtreecommitdiff
path: root/cppe/test/IceE/faultTolerance/Client.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2005-07-05 11:09:55 +0000
committerDwayne Boone <dwayne@zeroc.com>2005-07-05 11:09:55 +0000
commit9b8cc712d4a41d71840416776bc94ee8485bb9b3 (patch)
tree7d467fdd6a66bc2b5878d82070d45adbd5c20414 /cppe/test/IceE/faultTolerance/Client.cpp
parentcleaning the cache method out of ReferenceFactory (diff)
downloadice-9b8cc712d4a41d71840416776bc94ee8485bb9b3.tar.bz2
ice-9b8cc712d4a41d71840416776bc94ee8485bb9b3.tar.xz
ice-9b8cc712d4a41d71840416776bc94ee8485bb9b3.zip
Changed Ice to IceE EVERYWHERE!!!
Diffstat (limited to 'cppe/test/IceE/faultTolerance/Client.cpp')
-rw-r--r--cppe/test/IceE/faultTolerance/Client.cpp83
1 files changed, 83 insertions, 0 deletions
diff --git a/cppe/test/IceE/faultTolerance/Client.cpp b/cppe/test/IceE/faultTolerance/Client.cpp
new file mode 100644
index 00000000000..aeec6e1e6df
--- /dev/null
+++ b/cppe/test/IceE/faultTolerance/Client.cpp
@@ -0,0 +1,83 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2005 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 <IceE/IceE.h>
+#include <TestApplication.h>
+#include <Test.h>
+
+using namespace std;
+
+void
+usage(const char* n)
+{
+ tprintf("Usage: %s port...\n", n);
+}
+
+class FaultTestApplication : public TestApplication
+{
+public:
+
+ FaultTestApplication() :
+ TestApplication("fault client")
+ {
+ }
+
+ virtual int
+ run(int argc, char* argv[])
+ {
+ IceE::PropertiesPtr properties = IceE::getDefaultProperties(argc, argv);
+
+ //
+ // This test aborts servers, so we don't want warnings.
+ //
+ properties->setProperty("IceE.Warn.Connections", "0");
+
+ setCommunicator(IceE::initialize(argc, argv));
+
+ vector<int> ports;
+ for(int i = 1; i < argc; ++i)
+ {
+ if(argv[i][0] == '-')
+ {
+ tprintf("%s: unknown option `%s'\n", argv[0], argv[i]);
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
+
+ ports.push_back(atoi(argv[i]));
+ }
+
+ if(ports.empty())
+ {
+ tprintf("%s: no ports specified\n", argv[0]);
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
+
+ try
+ {
+ void allTests(const IceE::CommunicatorPtr&, const vector<int>&);
+ allTests(communicator(), ports);
+ }
+ catch(const IceE::Exception& ex)
+ {
+ tprintf("%s\n", ex.toString().c_str());
+ test(false);
+ }
+
+ return EXIT_SUCCESS;
+ }
+};
+
+int
+main(int argc, char** argv)
+{
+ FaultTestApplication app;
+ return app.main(argc, argv);
+}