summaryrefslogtreecommitdiff
path: root/cpp/test/IceGrid/deployer/AllTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/IceGrid/deployer/AllTests.cpp')
-rw-r--r--cpp/test/IceGrid/deployer/AllTests.cpp34
1 files changed, 32 insertions, 2 deletions
diff --git a/cpp/test/IceGrid/deployer/AllTests.cpp b/cpp/test/IceGrid/deployer/AllTests.cpp
index a33d10487fa..bbefc798469 100644
--- a/cpp/test/IceGrid/deployer/AllTests.cpp
+++ b/cpp/test/IceGrid/deployer/AllTests.cpp
@@ -92,8 +92,7 @@ typedef IceUtil::Handle<SessionKeepAliveThread> SessionKeepAliveThreadPtr;
void
allTests(const Ice::CommunicatorPtr& comm)
{
- RegistryPrx registry = IceGrid::RegistryPrx::checkedCast(
- comm->stringToProxy("IceGrid/Registry"));
+ RegistryPrx registry = IceGrid::RegistryPrx::checkedCast(comm->stringToProxy("IceGrid/Registry"));
test(registry);
AdminSessionPrx session = registry->createAdminSession("foo", "bar");
@@ -349,6 +348,37 @@ allTests(const Ice::CommunicatorPtr& comm)
cout << "ok" << endl;
+ cout << "testing validation... " << flush;
+ TemplateDescriptor templ;
+ templ.parameters.push_back("name");
+ templ.parameters.push_back("nam3");
+ templ.parameters.push_back("nam2");
+ templ.parameters.push_back("nam3");
+ templ.descriptor = new ServerDescriptor();
+ ServerDescriptorPtr server = ServerDescriptorPtr::dynamicCast(templ.descriptor);
+ server->id = "test";
+ server->exe = "${test.dir}/server";
+ ApplicationDescriptor desc;
+ desc.name = "App";
+ desc.serverTemplates["ServerTemplate"] = templ;
+ try
+ {
+ session->startUpdate();
+ admin->addApplication(desc);
+ session->finishUpdate();
+ test(false);
+ }
+ catch(const DeploymentException& ex)
+ {
+ test(ex.reason.find("duplicate parameters") != string::npos);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ test(false);
+ }
+ cout << "ok" << endl;
+
keepAlive->destroy();
keepAlive->getThreadControl().join();
keepAlive = 0;