summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/optional/ServerAMD.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2014-10-14 16:15:38 -0230
committerDwayne Boone <dwayne@zeroc.com>2014-10-14 16:15:38 -0230
commit204446586712f1f457b8416347541c7e32b44a9c (patch)
tree84aa9f85f95335e0576c744abe0fe930f460d44f /cpp/test/Ice/optional/ServerAMD.cpp
parentAdded comment to SessionHelper constructor (diff)
downloadice-204446586712f1f457b8416347541c7e32b44a9c.tar.bz2
ice-204446586712f1f457b8416347541c7e32b44a9c.tar.xz
ice-204446586712f1f457b8416347541c7e32b44a9c.zip
ICE-5739 missing AMD test in c++ optional
Diffstat (limited to 'cpp/test/Ice/optional/ServerAMD.cpp')
-rw-r--r--cpp/test/Ice/optional/ServerAMD.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/cpp/test/Ice/optional/ServerAMD.cpp b/cpp/test/Ice/optional/ServerAMD.cpp
new file mode 100644
index 00000000000..b5119dc994a
--- /dev/null
+++ b/cpp/test/Ice/optional/ServerAMD.cpp
@@ -0,0 +1,62 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2014 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 <TestAMDI.h>
+
+DEFINE_TEST("serveramd")
+
+using namespace std;
+
+int
+run(int, char**, const Ice::CommunicatorPtr& communicator)
+{
+ communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010");
+ Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
+ adapter->add(new InitialI(), communicator->stringToIdentity("initial"));
+ adapter->activate();
+ TEST_READY
+ communicator->waitForShutdown();
+ return EXIT_SUCCESS;
+}
+
+int
+main(int argc, char* argv[])
+{
+ int status;
+ Ice::CommunicatorPtr communicator;
+
+ try
+ {
+ communicator = Ice::initialize(argc, argv);
+ status = run(argc, argv, communicator);
+
+ }
+ 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;
+}