summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/proxy/Collocated.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/Ice/proxy/Collocated.cpp')
-rw-r--r--cpp/test/Ice/proxy/Collocated.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/cpp/test/Ice/proxy/Collocated.cpp b/cpp/test/Ice/proxy/Collocated.cpp
new file mode 100644
index 00000000000..f27d5051d8c
--- /dev/null
+++ b/cpp/test/Ice/proxy/Collocated.cpp
@@ -0,0 +1,63 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2007 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 <TestI.h>
+
+using namespace std;
+
+int
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator,
+ const Ice::InitializationData& initData)
+{
+ communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
+ Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
+ adapter->add(new MyDerivedClassI, communicator->stringToIdentity("test"));
+ adapter->activate();
+
+ Test::MyClassPrx allTests(const Ice::CommunicatorPtr&, bool);
+ allTests(communicator, true);
+
+ return EXIT_SUCCESS;
+}
+
+int
+main(int argc, char* argv[])
+{
+ int status;
+ Ice::CommunicatorPtr communicator;
+
+ try
+ {
+ Ice::InitializationData initData;
+ initData.properties = Ice::createProperties(argc, argv);
+ communicator = Ice::initialize(argc, argv, initData);
+ status = run(argc, argv, communicator, initData);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
+
+ if(communicator)
+ {
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
+ }
+
+ return status;
+}